diff --git a/swaggerci/containerservice.DefaultTag/.gitattributes b/swaggerci/containerservice.DefaultTag/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/.gitignore b/swaggerci/containerservice.DefaultTag/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/Az.ContainerService.csproj b/swaggerci/containerservice.DefaultTag/Az.ContainerService.csproj new file mode 100644 index 000000000000..d7f6671eeb4d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/Az.ContainerService.csproj @@ -0,0 +1,44 @@ + + + + 0.1.0 + 7.1 + netstandard2.0 + Library + Az.ContainerService.private + Microsoft.Azure.PowerShell.Cmdlets.ContainerService + true + false + ./bin + $(OutputPath) + Az.ContainerService.nuspec + true + + + 1998, 1591 + true + + + + + false + TRACE;DEBUG;NETSTANDARD + + + + true + true + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + + + + + + $(DefaultItemExcludes);resources/** + + + \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/Az.ContainerService.format.ps1xml b/swaggerci/containerservice.DefaultTag/Az.ContainerService.format.ps1xml new file mode 100644 index 000000000000..ee28f90a054f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/Az.ContainerService.format.ps1xml @@ -0,0 +1,7503 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.AgentPoolsAbortLatestOperationAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.AgentPoolsAbortLatestOperationAcceptedResponseHeaders + + + + + + + + + + + + + + + AzureAsyncOperation + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.AgentPoolsDeleteAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.AgentPoolsDeleteAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.AgentPoolsDeleteMachinesAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.AgentPoolsDeleteMachinesAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ContainerServiceIdentity + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ContainerServiceIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AgentPoolName + + + CommandId + + + ConfigName + + + Id + + + LoadBalancerName + + + Location + + + MachineName + + + Mode + + + OperationId + + + PrivateEndpointConnectionName + + + ResourceGroupName + + + ResourceName + + + RoleName + + + SubscriptionId + + + TrustedAccessRoleBindingName + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.LoadBalancersDeleteAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.LoadBalancersDeleteAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersAbortLatestOperationAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersAbortLatestOperationAcceptedResponseHeaders + + + + + + + + + + + + + + + AzureAsyncOperation + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersDeleteAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersDeleteAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersGetCommandResultAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersGetCommandResultAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersResetAadProfileAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersResetAadProfileAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersRunCommandAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersRunCommandAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersStartAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersStartAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersStopAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ManagedClustersStopAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders + + + + + + + + + + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResource + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResource + + + + + + + + + + + + + + + + + + + + + Location + + + ReferralResource + + + ResourceId + + + TenantId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorAdditionalInfo + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorAdditionalInfo + + + + + + + + + + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetail + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetail + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResult + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EndTime + + + Id + + + Name + + + PercentComplete + + + ResourceId + + + StartTime + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ProxyResource + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ProxyResource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemData + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlySchedule + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlySchedule + + + + + + + + + + + + + + + DayOfMonth + + + IntervalMonth + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AccessProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AccessProfile + + + + + + + + + + + + KubeConfig + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingObservability + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingObservability + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPool + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPool + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + AzureAsyncOperation + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfile + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersions + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersions + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + + + + + + + + + + + + + + + + + + Default + + + IsPreview + + + KubernetesVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolDeleteMachinesParameter + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolDeleteMachinesParameter + + + + + + + + + + + + MachineName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfile + + + + + + + + + + + + PublicIPPrefixSize + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfile + + + + + + + + + + + + InstallGpuDriver + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolListResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfile + + + + + + + + + + + + ApplicationSecurityGroup + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfile + + + + + + + + + + + + + + + + + + EnableSecureBoot + + + EnableVtpm + + + SshAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfile + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfileProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfileProperties + + + + + + + + + + + + + + + + + + KubernetesVersion + + + LatestNodeImageVersion + + + OSType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfilePropertiesUpgradesItem + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfilePropertiesUpgradesItem + + + + + + + + + + + + + + + IsPreview + + + KubernetesVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettings + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettings + + + + + + + + + + + + + + + + + + + + + DrainTimeoutInMinute + + + MaxSurge + + + NodeSoakDurationInMinute + + + UndrainableNodeBehavior + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfile + + + + + + + + + + + + DisableOutboundNat + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfile + + + + + + + + + + + + + + + + + + MaxCount + + + MinCount + + + Size + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKms + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKms + + + + + + + + + + + + + + + + + + + + + Enabled + + + KeyId + + + KeyVaultNetworkAccess + + + KeyVaultResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBody + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBody + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CommandResultProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CommandResultProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + ExitCode + + + FinishedAt + + + Log + + + ProvisioningState + + + Reason + + + StartedAt + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CompatibleVersions + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CompatibleVersions + + + + + + + + + + + + + + + Name + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceLinuxProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceLinuxProfile + + + + + + + + + + + + AdminUsername + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DnsServiceIP + + + IPFamily + + + LoadBalancerSku + + + NetworkDataplane + + + NetworkMode + + + NetworkPlugin + + + NetworkPluginMode + + + NetworkPolicy + + + OutboundType + + + PodCidr + + + PodCidrs + + + ServiceCidr + + + ServiceCidrs + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfig + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfig + + + + + + + + + + + + + + + Enabled + + + Mode + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + + + + + + + + + + + + + + + + + + + + + Scheduler + + + TcpFinTimeoutSecond + + + TcpTimeoutSecond + + + UdpTimeoutSecond + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKey + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKey + + + + + + + + + + + + KeyData + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData + + + + + + + + + + + + SourceResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CredentialResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CredentialResult + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailySchedule + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailySchedule + + + + + + + + + + + + IntervalDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DateSpan + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DateSpan + + + + + + + + + + + + + + + End + + + Start + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDependency + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDependency + + + + + + + + + + + + DomainName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDetail + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDetail + + + + + + + + + + + + + + + + + + + + + Description + + + IPAddress + + + Port + + + Protocol + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ExtendedLocation + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ExtendedLocation + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersion + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersion + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsList + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsProperties + + + + + + + + + + + + + + + IsDefaultVersion + + + Support + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTag + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTag + + + + + + + + + + + + + + + Tag + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGateway + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGateway + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGateway + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGateway + + + + + + + + + + + + + + + Enabled + + + Mode + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthority + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthority + + + + + + + + + + + + + + + + + + + + + + + + CertChainObjectName + + + CertObjectName + + + KeyObjectName + + + KeyVaultId + + + RootCertObjectName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMesh + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMesh + + + + + + + + + + + + Revision + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfig + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfig + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AllowedUnsafeSysctl + + + ContainerLogMaxFile + + + ContainerLogMaxSizeMb + + + CpuCfsQuota + + + CpuCfsQuotaPeriod + + + CpuManagerPolicy + + + FailSwapOn + + + ImageGcHighThreshold + + + ImageGcLowThreshold + + + PodMaxPid + + + TopologyManagerPolicy + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesPatchVersion + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesPatchVersion + + + + + + + + + + + + Upgrade + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersion + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersion + + + + + + + + + + + + + + + + + + IsDefault + + + IsPreview + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionCapabilities + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionCapabilities + + + + + + + + + + + + SupportPlan + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector + + + + + + + + + + + + MatchLabel + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirement + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirement + + + + + + + + + + + + + + + + + + Key + + + Operator + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfig + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfig + + + + + + + + + + + + + + + + + + SwapFileSizeMb + + + TransparentHugePageDefrag + + + TransparentHugePageEnabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancer + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerListResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerProperties + + + + + + + + + + + + + + + + + + + + + AllowServicePlacement + + + Name + + + PrimaryAgentPoolName + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Machine + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Machine + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineIPAddress + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineIPAddress + + + + + + + + + + + + + + + Family + + + IP + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineListResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineProperties + + + + + + + + + + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfiguration + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationListResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceWindow + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceWindow + + + + + + + + + + + + + + + + + + + + + DurationHour + + + StartDate + + + StartTime + + + UtcOffset + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedCluster + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedCluster + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + ETag + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AdminGroupObjectID + + + ClientAppId + + + EnableAzureRbac + + + Managed + + + ServerAppId + + + ServerAppSecret + + + TenantId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAccessProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAccessProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfile + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfileConfig + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfileConfig + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfileIdentity + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfileIdentity + + + + + + + + + + + + + + + + + + ClientId + + + ObjectId + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ArtifactStreamingProfileEnabled + + + AvailabilityZone + + + CapacityReservationGroupId + + + Count + + + CreationDataSourceResourceId + + + CurrentOrchestratorVersion + + + ETag + + + EnableAutoScaling + + + EnableCustomCaTrust + + + EnableEncryptionAtHost + + + EnableFips + + + EnableNodePublicIP + + + EnableUltraSsd + + + GatewayProfilePublicIPPrefixSize + + + GpuInstanceProfile + + + GpuProfileInstallGpuDriver + + + HostGroupId + + + KubeletConfigAllowedUnsafeSysctl + + + KubeletConfigContainerLogMaxFile + + + KubeletConfigContainerLogMaxSizeMb + + + KubeletConfigCpuCfsQuota + + + KubeletConfigCpuCfsQuotaPeriod + + + KubeletConfigCpuManagerPolicy + + + KubeletConfigFailSwapOn + + + KubeletConfigImageGcHighThreshold + + + KubeletConfigImageGcLowThreshold + + + KubeletConfigPodMaxPid + + + KubeletConfigTopologyManagerPolicy + + + KubeletDiskType + + + LinuxOSConfigSwapFileSizeMb + + + LinuxOSConfigTransparentHugePageDefrag + + + LinuxOSConfigTransparentHugePageEnabled + + + MaxCount + + + MaxPod + + + MessageOfTheDay + + + MinCount + + + Mode + + + NetworkProfileApplicationSecurityGroup + + + NodeImageVersion + + + NodeInitializationTaint + + + NodePublicIPPrefixId + + + NodeTaint + + + OSDiskSizeGb + + + OSDiskType + + + OSSku + + + OSType + + + OrchestratorVersion + + + PodIPAllocationMode + + + PodSubnetId + + + PowerStateCode + + + ProvisioningState + + + ProximityPlacementGroupId + + + ScaleDownMode + + + ScaleSetEvictionPolicy + + + ScaleSetPriority + + + SecurityProfileEnableSecureBoot + + + SecurityProfileEnableVtpm + + + SecurityProfileSshAccess + + + SpotMaxPrice + + + Type + + + UpgradeSettingDrainTimeoutInMinute + + + UpgradeSettingMaxSurge + + + UpgradeSettingNodeSoakDurationInMinute + + + UpgradeSettingUndrainableNodeBehavior + + + VMSize + + + VnetSubnetId + + + WindowProfileDisableOutboundNat + + + WorkloadRuntime + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AvailabilityZone + + + CapacityReservationGroupId + + + Count + + + CurrentOrchestratorVersion + + + ETag + + + EnableAutoScaling + + + EnableCustomCaTrust + + + EnableEncryptionAtHost + + + EnableFips + + + EnableNodePublicIP + + + EnableUltraSsd + + + GpuInstanceProfile + + + HostGroupId + + + KubeletDiskType + + + MaxCount + + + MaxPod + + + MessageOfTheDay + + + MinCount + + + Mode + + + NodeImageVersion + + + NodeInitializationTaint + + + NodePublicIPPrefixId + + + NodeTaint + + + OSDiskSizeGb + + + OSDiskType + + + OSSku + + + OSType + + + OrchestratorVersion + + + PodIPAllocationMode + + + PodSubnetId + + + ProvisioningState + + + ProximityPlacementGroupId + + + ScaleDownMode + + + ScaleSetEvictionPolicy + + + ScaleSetPriority + + + SpotMaxPrice + + + Type + + + VMSize + + + VnetSubnetId + + + WorkloadRuntime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabels + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabels + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTags + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAiToolchainOperatorProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAiToolchainOperatorProfile + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterApiServerAccessProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterApiServerAccessProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AuthorizedIPRange + + + DisableRunCommand + + + EnablePrivateCluster + + + EnablePrivateClusterPublicFqdn + + + EnableVnetIntegration + + + PrivateDnsZone + + + SubnetId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAutoUpgradeProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAutoUpgradeProfile + + + + + + + + + + + + + + + NodeOSUpgradeChannel + + + UpgradeChannel + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs + + + + + + + + + + + + + + + Enabled + + + Port + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics + + + + + + + + + + + + + + + Enabled + + + Port + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsights + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsights + + + + + + + + + + + + + + + + + + + + + + + + DisableCustomMetric + + + DisablePrometheusMetricsScraping + + + Enabled + + + LogAnalyticsWorkspaceResourceId + + + SyslogPort + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetrics + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetrics + + + + + + + + + + + + + + + MetricAnnotationsAllowList + + + MetricLabelsAllowlist + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetrics + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetrics + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterBootstrapProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterBootstrapProfile + + + + + + + + + + + + + + + ArtifactSource + + + ContainerRegistryId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysis + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysis + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterHttpProxyConfig + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterHttpProxyConfig + + + + + + + + + + + + + + + + + + + + + + + + EffectiveNoProxy + + + HttpProxy + + + HttpsProxy + + + NoProxy + + + TrustedCa + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentity + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentity + + + + + + + + + + + + + + + + + + PrincipalId + + + TenantId + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRouting + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRouting + + + + + + + + + + + + + + + DnsZoneResourceId + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterListResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfile + + + + + + + + + + + + + + + + + + + + + + + + AllocatedOutboundPort + + + BackendPoolType + + + ClusterServiceLoadBalancerHealthProbeMode + + + EnableMultipleStandardLoadBalancer + + + IdleTimeoutInMinute + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileManagedOutboundIPs + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileManagedOutboundIPs + + + + + + + + + + + + + + + Count + + + CountIPv6 + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterManagedOutboundIPProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterManagedOutboundIPProfile + + + + + + + + + + + + Count + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNatGatewayProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNatGatewayProfile + + + + + + + + + + + + IdleTimeoutInMinute + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeProvisioningProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeProvisioningProfile + + + + + + + + + + + + Mode + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeResourceGroupProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeResourceGroupProfile + + + + + + + + + + + + RestrictionLevel + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterOidcIssuerProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterOidcIssuerProfile + + + + + + + + + + + + + + + Enabled + + + IssuerUrl + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentity + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentity + + + + + + + + + + + + + + + + + + + + + BindingSelector + + + Name + + + Namespace + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityException + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityException + + + + + + + + + + + + + + + Name + + + Namespace + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionPodLabels + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionPodLabels + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProfile + + + + + + + + + + + + + + + AllowNetworkPluginKubenet + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBody + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBody + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfile + + + + + + + + + + + + + + + + + + KubernetesVersion + + + Name + + + OSType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileUpgradesItem + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileUpgradesItem + + + + + + + + + + + + + + + IsPreview + + + KubernetesVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AzurePortalFqdn + + + CurrentKubernetesVersion + + + DisableLocalAccount + + + DiskEncryptionSetId + + + DnsPrefix + + + EnableNamespaceResource + + + EnablePodSecurityPolicy + + + EnableRbac + + + Fqdn + + + FqdnSubdomain + + + KubernetesVersion + + + MaxAgentPool + + + NodeResourceGroup + + + PrivateFqdn + + + ProvisioningState + + + PublicNetworkAccess + + + ResourceUid + + + SupportPlan + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAutoScalerProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAutoScalerProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BalanceSimilarNodeGroup + + + DaemonsetEvictionForEmptyNode + + + DaemonsetEvictionForOccupiedNode + + + Expander + + + IgnoreDaemonsetsUtilization + + + MaxEmptyBulkDelete + + + MaxGracefulTerminationSec + + + MaxNodeProvisionTime + + + MaxTotalUnreadyPercentage + + + NewPodScaleUpDelay + + + OkTotalUnreadyCount + + + ScaleDownDelayAfterAdd + + + ScaleDownDelayAfterDelete + + + ScaleDownDelayAfterFailure + + + ScaleDownUnneededTime + + + ScaleDownUnreadyTime + + + ScaleDownUtilizationThreshold + + + ScanInterval + + + SkipNodesWithLocalStorage + + + SkipNodesWithSystemPod + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesForSnapshot + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesForSnapshot + + + + + + + + + + + + + + + EnableRbac + + + KubernetesVersion + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfile + + + + + + + + + + + + CustomCaTrustCertificate + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefender + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefender + + + + + + + + + + + + LogAnalyticsWorkspaceResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoring + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoring + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleaner + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleaner + + + + + + + + + + + + + + + Enabled + + + IntervalHour + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrity + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrity + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestriction + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestriction + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentity + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentity + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfile + + + + + + + + + + + + + + + ClientId + + + Secret + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSku + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSku + + + + + + + + + + + + + + + Name + + + Tier + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshot + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotListResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotProperties + + + + + + + + + + + + SnapshotType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStaticEgressGatewayProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStaticEgressGatewayProfile + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriver + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriver + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriver + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriver + + + + + + + + + + + + + + + Enabled + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriver + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriver + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotController + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotController + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterUpgradeProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterUpgradeProfile + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWindowsProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWindowsProfile + + + + + + + + + + + + + + + + + + + + + AdminPassword + + + AdminUsername + + + EnableCsiProxy + + + LicenseType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKeda + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKeda + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + + + + + + + + + + + + + + + AddonAutoscaling + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedServiceIdentityUserAssignedIdentitiesValue + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedServiceIdentityUserAssignedIdentitiesValue + + + + + + + + + + + + + + + ClientId + + + PrincipalId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfile + + + + + + + + + + + + + + + Count + + + Size + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevision + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevision + + + + + + + + + + + + + + + Revision + + + Upgrade + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfileList + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfileList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfileList + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfileList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfileProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfileProperties + + + + + + + + + + + + + + + Revision + + + Upgrade + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkMonitoring + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkMonitoring + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshot + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshot + + + + + + + + + + + + + + + + + + + + + + + + LoadBalancerSku + + + NetworkMode + + + NetworkPlugin + + + NetworkPluginMode + + + NetworkPolicy + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationStatusResultList + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationStatusResultList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValue + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValue + + + + + + + + + + + + + + + Name + + + Origin + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValueDisplay + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValueDisplay + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionProfile + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionProperty + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionProperty + + + + + + + + + + + + + + + EnableFipsImage + + + OSType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OutboundEnvironmentEndpoint + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OutboundEnvironmentEndpoint + + + + + + + + + + + + Category + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OutboundEnvironmentEndpointCollection + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OutboundEnvironmentEndpointCollection + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRange + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRange + + + + + + + + + + + + + + + + + + PortEnd + + + PortStart + + + Protocol + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerState + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerState + + + + + + + + + + + + Code + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpoint + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpoint + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnection + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnection + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionProperties + + + + + + + + + + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResource + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResource + + + + + + + + + + + + + + + + + + + + + + + + + + + GroupId + + + Id + + + Name + + + PrivateLinkServiceId + + + RequiredMember + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkServiceConnectionState + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkServiceConnectionState + + + + + + + + + + + + + + + Description + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RebalanceLoadBalancersRequestBody + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RebalanceLoadBalancersRequestBody + + + + + + + + + + + + LoadBalancerName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlySchedule + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlySchedule + + + + + + + + + + + + + + + + + + DayOfWeek + + + IntervalMonth + + + WeekIndex + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReference + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReference + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RunCommandRequest + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RunCommandRequest + + + + + + + + + + + + + + + + + + ClusterToken + + + Command + + + Context + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RunCommandResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RunCommandResult + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersion + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersion + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsList + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsList + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsProperties + + + + + + + + + + + + + + + IsDefaultVersion + + + Support + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsProfile + + + + + + + + + + + + + + + + + + + + + ExcludedNamespace + + + Level + + + SystemExcludedNamespace + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ServiceMeshProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ServiceMeshProfile + + + + + + + + + + + + Mode + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Snapshot + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Snapshot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotListResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EnableFips + + + KubernetesVersion + + + NodeImageVersion + + + OSSku + + + OSType + + + SnapshotType + + + VMSize + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SubResource + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SubResource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfig + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfig + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FsAioMaxNr + + + FsFileMax + + + FsInotifyMaxUserWatch + + + FsNrOpen + + + KernelThreadsMax + + + NetCoreNetdevMaxBacklog + + + NetCoreOptmemMax + + + NetCoreRmemDefault + + + NetCoreRmemMax + + + NetCoreSomaxconn + + + NetCoreWmemDefault + + + NetCoreWmemMax + + + NetIpv4IPLocalPortRange + + + NetIpv4NeighDefaultGcThresh1 + + + NetIpv4NeighDefaultGcThresh2 + + + NetIpv4NeighDefaultGcThresh3 + + + NetIpv4TcpFinTimeout + + + NetIpv4TcpKeepaliveProbe + + + NetIpv4TcpKeepaliveTime + + + NetIpv4TcpMaxSynBacklog + + + NetIpv4TcpMaxTwBucket + + + NetIpv4TcpTwReuse + + + NetIpv4TcpkeepaliveIntvl + + + NetNetfilterNfConntrackBucket + + + NetNetfilterNfConntrackMax + + + VMMaxMapCount + + + VMSwappiness + + + VMVfsCachePressure + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObjectTags + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObjectTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeInWeek + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeInWeek + + + + + + + + + + + + + + + Day + + + HourSlot + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeSpan + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeSpan + + + + + + + + + + + + + + + End + + + Start + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRole + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRole + + + + + + + + + + + + + + + Name + + + SourceResourceType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBinding + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBinding + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingListResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingProperties + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingProperties + + + + + + + + + + + + + + + + + + ProvisioningState + + + Role + + + SourceResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleListResult + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleRule + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleRule + + + + + + + + + + + + + + + + + + + + + + + + ApiGroup + + + NonResourceUrL + + + Resource + + + ResourceName + + + Verb + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettings + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettings + + + + + + + + + + + + + + + ForceUpgrade + + + Until + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity + + + + + + + + + + + + + + + + + + ClientId + + + ObjectId + + + ResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachineNodes + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachineNodes + + + + + + + + + + + + + + + Count + + + Size + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklySchedule + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklySchedule + + + + + + + + + + + + + + + DayOfWeek + + + IntervalWeek + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfile + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfile + + + + + + + + + + + + + + + + + + DnsServer + + + Enabled + + + RootDomainName + + + + + + + + \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/Az.ContainerService.nuspec b/swaggerci/containerservice.DefaultTag/Az.ContainerService.nuspec new file mode 100644 index 000000000000..f5439b25c92f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/Az.ContainerService.nuspec @@ -0,0 +1,32 @@ + + + + Az.ContainerService + 0.1.0 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell: $(service-name) cmdlets + + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM PSModule $(service-name) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/Az.ContainerService.psd1 b/swaggerci/containerservice.DefaultTag/Az.ContainerService.psd1 new file mode 100644 index 000000000000..19435c068e5b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/Az.ContainerService.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = 'e457dfe6-ca8d-4a61-8156-58f1ed0038ce' + RootModule = './Az.ContainerService.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: ContainerService cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.ContainerService.private.dll' + FormatsToProcess = './Az.ContainerService.format.ps1xml' + FunctionsToExport = 'Get-AzContainerServiceAgentPool', 'Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion', 'Get-AzContainerServiceAgentPoolUpgradeProfile', 'Get-AzContainerServiceLoadBalancer', 'Get-AzContainerServiceMachine', 'Get-AzContainerServiceMaintenanceConfiguration', 'Get-AzContainerServiceManagedCluster', 'Get-AzContainerServiceManagedClusterAccessProfile', 'Get-AzContainerServiceManagedClusterAdminCredentials', 'Get-AzContainerServiceManagedClusterCommandResult', 'Get-AzContainerServiceManagedClusterGuardrailVersion', 'Get-AzContainerServiceManagedClusterKuberneteVersion', 'Get-AzContainerServiceManagedClusterMeshRevisionProfile', 'Get-AzContainerServiceManagedClusterMeshUpgradeProfile', 'Get-AzContainerServiceManagedClusterMonitoringUserCredentials', 'Get-AzContainerServiceManagedClusterOSOption', 'Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint', 'Get-AzContainerServiceManagedClusterSafeguardVersion', 'Get-AzContainerServiceManagedClusterSnapshot', 'Get-AzContainerServiceManagedClusterUpgradeProfile', 'Get-AzContainerServiceManagedClusterUserCredentials', 'Get-AzContainerServiceOperationStatusResult', 'Get-AzContainerServicePrivateEndpointConnection', 'Get-AzContainerServicePrivateLinkResource', 'Get-AzContainerServiceSnapshot', 'Get-AzContainerServiceTrustedAccessRole', 'Get-AzContainerServiceTrustedAccessRoleBinding', 'Import-AzContainerServiceManagedCluster', 'Invoke-AzContainerServiceAbortAgentPoolLatestOperation', 'Invoke-AzContainerServiceAbortManagedClusterLatestOperation', 'Invoke-AzContainerServiceResolvePrivateLinkServiceId', 'Invoke-AzContainerServiceRotateManagedClusterCertificate', 'Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey', 'New-AzContainerServiceAgentPool', 'New-AzContainerServiceLoadBalancer', 'New-AzContainerServiceMaintenanceConfiguration', 'New-AzContainerServiceManagedCluster', 'New-AzContainerServiceManagedClusterSnapshot', 'New-AzContainerServiceSnapshot', 'New-AzContainerServiceTrustedAccessRoleBinding', 'Remove-AzContainerServiceAgentPool', 'Remove-AzContainerServiceAgentPoolMachine', 'Remove-AzContainerServiceLoadBalancer', 'Remove-AzContainerServiceMaintenanceConfiguration', 'Remove-AzContainerServiceManagedCluster', 'Remove-AzContainerServiceManagedClusterSnapshot', 'Remove-AzContainerServicePrivateEndpointConnection', 'Remove-AzContainerServiceSnapshot', 'Remove-AzContainerServiceTrustedAccessRoleBinding', 'Reset-AzContainerServiceManagedClusterAadProfile', 'Reset-AzContainerServiceManagedClusterServicePrincipalProfile', 'Start-AzContainerServiceManagedCluster', 'Start-AzContainerServiceManagedClusterCommand', 'Stop-AzContainerServiceManagedCluster', 'Update-AzContainerServiceAgentPoolNodeImageVersion', 'Update-AzContainerServiceManagedClusterSnapshotTag', 'Update-AzContainerServiceManagedClusterTag', 'Update-AzContainerServiceSnapshotTag', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ContainerService' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/Az.ContainerService.psm1 b/swaggerci/containerservice.DefaultTag/Az.ContainerService.psm1 new file mode 100644 index 000000000000..d8f9efaa24b5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/Az.ContainerService.psm1 @@ -0,0 +1,111 @@ +# region Generated + # ---------------------------------------------------------------------------------- + # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. + # ---------------------------------------------------------------------------------- + # Load required Az.Accounts module + $accountsName = 'Az.Accounts' + $accountsModule = Get-Module -Name $accountsName + if(-not $accountsModule) { + $localAccountsPath = Join-Path $PSScriptRoot 'generated/modules' + if(Test-Path -Path $localAccountsPath) { + $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1 + if($localAccounts) { + $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru + } + } + if(-not $accountsModule) { + $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0 + if($hasAdequateVersion) { + $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru + } + } + } + + if(-not $accountsModule) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop + } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop + } + Write-Information "Loaded Module '$($accountsModule.Name)'" + + # Load the private module dll + $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.ContainerService.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module]::Instance + + # Ask for the shared functionality table + $VTable = Register-AzModule + + # Tweaks the pipeline on module load + $instance.OnModuleLoad = $VTable.OnModuleLoad + + # Following two delegates are added for telemetry + $instance.GetTelemetryId = $VTable.GetTelemetryId + $instance.Telemetry = $VTable.Telemetry + + # Delegate to sanitize the output object + $instance.SanitizeOutput = $VTable.SanitizerHandler + + # Delegate to get the telemetry info + $instance.GetTelemetryInfo = $VTable.GetTelemetryInfo + + # Tweaks the pipeline per call + $instance.OnNewRequest = $VTable.OnNewRequest + + # Gets shared parameter values + $instance.GetParameterValue = $VTable.GetParameterValue + + # Allows shared module to listen to events from this module + $instance.EventListener = $VTable.EventListener + + # Gets shared argument completers + $instance.ArgumentCompleter = $VTable.ArgumentCompleter + + # The name of the currently selected Azure profile + $instance.ProfileName = $VTable.ProfileName + + # Load the custom module + $customModulePath = Join-Path $PSScriptRoot './custom/Az.ContainerService.custom.psm1' + if(Test-Path $customModulePath) { + $null = Import-Module -Name $customModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = Join-Path $PSScriptRoot './exports' + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } + + # Finalize initialization of this module + $instance.Init(); + Write-Information "Loaded Module '$($instance.Name)'" +# endregion diff --git a/swaggerci/containerservice.DefaultTag/MSSharedLibKey.snk b/swaggerci/containerservice.DefaultTag/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/MSSharedLibKey.snk differ diff --git a/swaggerci/containerservice.DefaultTag/README.md b/swaggerci/containerservice.DefaultTag/README.md new file mode 100644 index 000000000000..e42604372b1a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/README.md @@ -0,0 +1,24 @@ + +# Az.ContainerService +This directory contains the PowerShell module for the ContainerService service. + +--- +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.ContainerService`, see [how-to.md](how-to.md). + diff --git a/swaggerci/containerservice.DefaultTag/build-module.ps1 b/swaggerci/containerservice.DefaultTag/build-module.ps1 new file mode 100644 index 000000000000..d607f150d92d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/build-module.ps1 @@ -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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [Switch]$DisableAfterBuildTasks) +$ErrorActionPreference = 'Stop' + +if($PSEdition -ne 'Core') { + Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.' +} + +if(-not $Isolated -and -not $Debugger) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + + if($LastExitCode -ne 0) { + # Build failed. Don't attempt to run the module. + return + } + + if($Test) { + . (Join-Path $PSScriptRoot 'test-module.ps1') + if($LastExitCode -ne 0) { + # Tests failed. Don't attempt to run the module. + return + } + } + + if($Docs) { + . (Join-Path $PSScriptRoot 'generate-help.ps1') + if($LastExitCode -ne 0) { + # Docs generation failed. Don't attempt to run the module. + return + } + } + + if($Pack) { + . (Join-Path $PSScriptRoot 'pack-module.ps1') + if($LastExitCode -ne 0) { + # Packing failed. Don't attempt to run the module. + return + } + } + + $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1' + if($Code) { + . $runModulePath -Code + } elseif($Run) { + . $runModulePath + } else { + Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script." + } + return +} + +$binFolder = Join-Path $PSScriptRoot 'bin' +$objFolder = Join-Path $PSScriptRoot 'obj' + +if(-not $Debugger) { + Write-Host -ForegroundColor Green 'Cleaning build folders...' + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder + + if((Test-Path $binFolder) -or (Test-Path $objFolder)) { + Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?' + Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.' + } + + Write-Host -ForegroundColor Green 'Compiling module...' + $buildConfig = 'Debug' + if($Release) { + $buildConfig = 'Release' + } + dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo + if($LastExitCode -ne 0) { + Write-Error 'Compilation failed.' + } + + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release') +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.ContainerService.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} + +# Load DLL to use build-time cmdlets +$null = Import-Module -Name $dll + +$modulePaths = $dll +$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.ContainerService.custom.psm1' +if(Test-Path $customPsm1) { + $modulePaths = @($dll, $customPsm1) +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(Test-Path $exportsFolder) { + $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $exportsFolder + +$internalFolder = Join-Path $PSScriptRoot 'internal' +if(Test-Path $internalFolder) { + $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $internalFolder + +$psd1 = Join-Path $PSScriptRoot './Az.ContainerService.psd1' +$guid = Get-ModuleGuid -Psd1Path $psd1 +$moduleName = 'Az.ContainerService' +$examplesFolder = Join-Path $PSScriptRoot 'examples' +$null = New-Item -ItemType Directory -Force -Path $examplesFolder + +Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...' +$modelCmdlets = @() +$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets' +if (Test-Path $modelCmdletFolder) { + $null = Remove-Item -Force -Recurse -Path $modelCmdletFolder +} +if ($modelCmdlets.Count -gt 0) { + . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') + CreateModelCmdlet($modelCmdlets) +} + +if($NoDocs) { + Write-Host -ForegroundColor Green 'Creating exports...' + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder +} else { + Write-Host -ForegroundColor Green 'Creating exports and docs...' + $moduleDescription = 'Microsoft Azure PowerShell: ContainerService cmdlets' + $docsFolder = Join-Path $PSScriptRoot 'docs' + if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue + } + $null = New-Item -ItemType Directory -Force -Path $docsFolder + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo +} + +Write-Host -ForegroundColor Green 'Creating format.ps1xml...' +$formatPs1xml = Join-Path $PSScriptRoot './Az.ContainerService.format.ps1xml' +Export-FormatPs1xml -FilePath $formatPs1xml + +Write-Host -ForegroundColor Green 'Creating psd1...' +$customFolder = Join-Path $PSScriptRoot 'custom' +Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid + +Write-Host -ForegroundColor Green 'Creating test stubs...' +$testFolder = Join-Path $PSScriptRoot 'test' +$null = New-Item -ItemType Directory -Force -Path $testFolder +Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder + +Write-Host -ForegroundColor Green 'Creating example stubs...' +Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder + +if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')) +{ + Write-Host -ForegroundColor Green 'Creating ux metadata...' + . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1') +} + +if (-not $DisableAfterBuildTasks){ + $afterBuildTasksPath = Join-Path $PSScriptRoot '' + $afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable + if(Test-Path -Path $afterBuildTasksPath -PathType leaf){ + Write-Host -ForegroundColor Green 'Running after build tasks...' + . $afterBuildTasksPath @afterBuildTasksArgs + } +} + + +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/swaggerci/containerservice.DefaultTag/check-dependencies.ps1 b/swaggerci/containerservice.DefaultTag/check-dependencies.ps1 new file mode 100644 index 000000000000..ec3055201a71 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/check-dependencies.ps1 @@ -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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) { + if($predicate) { + $module = Get-Module -ListAvailable -Name $moduleName + if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) { + $null = New-Item -ItemType Directory -Force -Path $path + Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..." + if ($requiredVersion) { + Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path + }elseif($versionMinimum) { + Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path + } else { + Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path + } + } + } +} + +$ProgressPreference = 'SilentlyContinue' +$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1 + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5' +DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1' + +$tools = Join-Path $PSScriptRoot 'tools' +$resourceDir = Join-Path $tools 'Resources' +$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1' + +if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) { + Write-Host -ForegroundColor Green "Building local Resource module used for test..." + Set-Location $resourceDir + $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources + $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/ + Set-Location $HOME/.PSSharedModules/Resources + $null = .\build-module.ps1 + Set-Location $PSScriptRoot +} diff --git a/swaggerci/containerservice.DefaultTag/create-model-cmdlets.ps1 b/swaggerci/containerservice.DefaultTag/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..69a7ec879ff3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/create-model-cmdlets.ps1 @@ -0,0 +1,167 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +function CreateModelCmdlet { + + param([string[]]$Models) + + if ($Models.Count -eq 0) + { + return + } + + $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models' + $OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets' + $null = New-Item -ItemType Directory -Force -Path $OutputDir + if (''.length -gt 0) { + $ModuleName = '' + } else { + $ModuleName = 'Az.ContainerService' + } + + $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs + $Content = '' + $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 ) + { $Content += get-content $_.fullname -raw + } } + + $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content) + $Nodes = $Tree.ChildNodes().ChildNodes() + foreach ($Model in $Models) + { + $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") } + if ($InterfaceNode.count -eq 0) { + continue + } + # through a queue, we iterate all the parent models. + $Queue = @($InterfaceNode) + $visited = @("I$Model") + $AllInterfaceNodes = @() + while ($Queue.count -ne 0) + { + $AllInterfaceNodes += $Queue[0] + # Baselist contains the direct parent models. + foreach ($parent in $Queue[0].BaseList.Types) + { + if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value))) + { + $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) }) + $visited = [Array]$visited + $parent.Type.Right.Identifier.Value + } + } + $first, $Queue = $Queue + } + + $Namespace = $InterfaceNode.Parent.Name + $ObjectType = $Model + $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}" + # remove duplicated module name + if ($ObjectType.StartsWith('ContainerService')) { + $ModulePrefix = '' + } else { + $ModulePrefix = 'ContainerService' + } + $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir + + $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string] + $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string] + foreach ($Node in $AllInterfaceNodes) + { + foreach ($Member in $Node.Members) + { + $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments + $Required = $false + $Description = "" + $Readonly = $False + foreach ($Argument in $Arguments) + { + if ($Argument.NameEquals.Name.Identifier.Value -eq "Required") + { + $Required = $Argument.Expression.Token.Value + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Description") + { + $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"') + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly") + { + $Readonly = $Argument.Expression.Token.Value + } + } + if ($Readonly) + { + continue + } + $Identifier = $Member.Identifier.Value + $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1] + $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string] + if ($Required) + { + $ParameterDefinePropertyList.Add("Mandatory") + } + if ($Description -ne "") + { + $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"") + } + $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList) + # check whether completer is needed + $completer = ''; + if($Type.Split('.').Split('.')[-2] -eq 'Support') { + # If Type is an array, need to strip [] + $strippedType = $Type.Replace('[]', '') + $completer += "`n [ArgumentCompleter([${strippedType}])]" + } + $ParameterDefineScript = " + [Parameter($ParameterDefineProperty)]${completer} + [${Type}] + `$${Identifier}" + $ParameterDefineScriptList.Add($ParameterDefineScript) + $ParameterAssignScriptList.Add(" + if (`$PSBoundParameters.ContainsKey('${Identifier}')) { + `$Object.${Identifier} = `$${Identifier} + }") + } + } + $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator "," + $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator "" + + $Script = " +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ${ObjectType}. +.Description +Create an in-memory object for ${ObjectType}. + +.Outputs +${ObjectTypeWithNamespace} +.Link +https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object +#> +function New-Az${ModulePrefix}${ObjectType}Object { + [OutputType('${ObjectTypeWithNamespace}')] + [CmdletBinding(PositionalBinding=`$false)] + Param( +${ParameterDefineScript} + ) + + process { + `$Object = [${ObjectTypeWithNamespace}]::New() +${ParameterAssignScript} + return `$Object + } +} +" + Set-Content -Path $OutputPath -Value $Script + } +} diff --git a/swaggerci/containerservice.DefaultTag/custom/Az.ContainerService.custom.psm1 b/swaggerci/containerservice.DefaultTag/custom/Az.ContainerService.custom.psm1 new file mode 100644 index 000000000000..52fd60195924 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/custom/Az.ContainerService.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.ContainerService.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.ContainerService.internal.psm1' + if(Test-Path $internalModulePath) { + $null = Import-Module -Name $internalModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export script cmdlets + Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias) +# endregion diff --git a/swaggerci/containerservice.DefaultTag/custom/README.md b/swaggerci/containerservice.DefaultTag/custom/README.md new file mode 100644 index 000000000000..966cbdb8c8e5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.ContainerService` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.ContainerService.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.ContainerService` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.ContainerService.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.ContainerService.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.ContainerService`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.ContainerService.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.ContainerService.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.ContainerService`. +- `Microsoft.Azure.PowerShell.Cmdlets.ContainerService.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.ContainerService`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/docs/Az.ContainerService.md b/swaggerci/containerservice.DefaultTag/docs/Az.ContainerService.md new file mode 100644 index 000000000000..e5e57a4450fa --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Az.ContainerService.md @@ -0,0 +1,201 @@ +--- +Module Name: Az.ContainerService +Module Guid: e457dfe6-ca8d-4a61-8156-58f1ed0038ce +Download Help Link: https://learn.microsoft.com/powershell/module/az.containerservice +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.ContainerService Module +## Description +Microsoft Azure PowerShell: ContainerService cmdlets + +## Az.ContainerService Cmdlets +### [Get-AzContainerServiceAgentPool](Get-AzContainerServiceAgentPool.md) +Gets the specified managed cluster agent pool. + +### [Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion](Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.md) +See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + +### [Get-AzContainerServiceAgentPoolUpgradeProfile](Get-AzContainerServiceAgentPoolUpgradeProfile.md) +Gets the upgrade profile for an agent pool. + +### [Get-AzContainerServiceLoadBalancer](Get-AzContainerServiceLoadBalancer.md) +Gets the specified load balancer. + +### [Get-AzContainerServiceMachine](Get-AzContainerServiceMachine.md) +Get a specific machine in the specified agent pool. + +### [Get-AzContainerServiceMaintenanceConfiguration](Get-AzContainerServiceMaintenanceConfiguration.md) +Gets the specified maintenance configuration of a managed cluster. + +### [Get-AzContainerServiceManagedCluster](Get-AzContainerServiceManagedCluster.md) +Gets a managed cluster. + +### [Get-AzContainerServiceManagedClusterAccessProfile](Get-AzContainerServiceManagedClusterAccessProfile.md) +**WARNING**: This API will be deprecated. +Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . + +### [Get-AzContainerServiceManagedClusterAdminCredentials](Get-AzContainerServiceManagedClusterAdminCredentials.md) +Lists the admin credentials of a managed cluster. + +### [Get-AzContainerServiceManagedClusterCommandResult](Get-AzContainerServiceManagedClusterCommandResult.md) +Gets the results of a command which has been run on the Managed Cluster. + +### [Get-AzContainerServiceManagedClusterGuardrailVersion](Get-AzContainerServiceManagedClusterGuardrailVersion.md) +Contains Guardrails version along with its support info and whether it is a default version. + +### [Get-AzContainerServiceManagedClusterKuberneteVersion](Get-AzContainerServiceManagedClusterKuberneteVersion.md) +Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version + +### [Get-AzContainerServiceManagedClusterMeshRevisionProfile](Get-AzContainerServiceManagedClusterMeshRevisionProfile.md) +Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades + +### [Get-AzContainerServiceManagedClusterMeshUpgradeProfile](Get-AzContainerServiceManagedClusterMeshUpgradeProfile.md) +Gets available upgrades for a service mesh in a cluster. + +### [Get-AzContainerServiceManagedClusterMonitoringUserCredentials](Get-AzContainerServiceManagedClusterMonitoringUserCredentials.md) +Lists the cluster monitoring user credentials of a managed cluster. + +### [Get-AzContainerServiceManagedClusterOSOption](Get-AzContainerServiceManagedClusterOSOption.md) +Gets supported OS options in the specified subscription. + +### [Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint](Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.md) +Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. +The operation returns properties of each egress endpoint. + +### [Get-AzContainerServiceManagedClusterSafeguardVersion](Get-AzContainerServiceManagedClusterSafeguardVersion.md) +Contains Safeguards version along with its support info and whether it is a default version. + +### [Get-AzContainerServiceManagedClusterSnapshot](Get-AzContainerServiceManagedClusterSnapshot.md) +Gets a managed cluster snapshot. + +### [Get-AzContainerServiceManagedClusterUpgradeProfile](Get-AzContainerServiceManagedClusterUpgradeProfile.md) +Gets the upgrade profile of a managed cluster. + +### [Get-AzContainerServiceManagedClusterUserCredentials](Get-AzContainerServiceManagedClusterUserCredentials.md) +Lists the user credentials of a managed cluster. + +### [Get-AzContainerServiceOperationStatusResult](Get-AzContainerServiceOperationStatusResult.md) +Get the status of a specific operation in the specified managed cluster. + +### [Get-AzContainerServicePrivateEndpointConnection](Get-AzContainerServicePrivateEndpointConnection.md) +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + +### [Get-AzContainerServicePrivateLinkResource](Get-AzContainerServicePrivateLinkResource.md) +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + +### [Get-AzContainerServiceSnapshot](Get-AzContainerServiceSnapshot.md) +Gets a snapshot. + +### [Get-AzContainerServiceTrustedAccessRole](Get-AzContainerServiceTrustedAccessRole.md) +List supported trusted access roles. + +### [Get-AzContainerServiceTrustedAccessRoleBinding](Get-AzContainerServiceTrustedAccessRoleBinding.md) +Get a trusted access role binding. + +### [Import-AzContainerServiceManagedCluster](Import-AzContainerServiceManagedCluster.md) +Rebalance nodes across specific load balancers. + +### [Invoke-AzContainerServiceAbortAgentPoolLatestOperation](Invoke-AzContainerServiceAbortAgentPoolLatestOperation.md) +Aborts the currently running operation on the agent pool. +The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. + +### [Invoke-AzContainerServiceAbortManagedClusterLatestOperation](Invoke-AzContainerServiceAbortManagedClusterLatestOperation.md) +Aborts the currently running operation on the managed cluster. +The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. + +### [Invoke-AzContainerServiceResolvePrivateLinkServiceId](Invoke-AzContainerServiceResolvePrivateLinkServiceId.md) +Gets the private link service ID for the specified managed cluster. + +### [Invoke-AzContainerServiceRotateManagedClusterCertificate](Invoke-AzContainerServiceRotateManagedClusterCertificate.md) +See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + +### [Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey](Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.md) +Rotates the service account signing keys of a managed cluster. + +### [New-AzContainerServiceAgentPool](New-AzContainerServiceAgentPool.md) +Creates or updates an agent pool in the specified managed cluster. + +### [New-AzContainerServiceLoadBalancer](New-AzContainerServiceLoadBalancer.md) +Creates or updates a load balancer in the specified managed cluster. + +### [New-AzContainerServiceMaintenanceConfiguration](New-AzContainerServiceMaintenanceConfiguration.md) +Creates or updates a maintenance configuration in the specified managed cluster. + +### [New-AzContainerServiceManagedCluster](New-AzContainerServiceManagedCluster.md) +Creates or updates a managed cluster. + +### [New-AzContainerServiceManagedClusterSnapshot](New-AzContainerServiceManagedClusterSnapshot.md) +Creates or updates a managed cluster snapshot. + +### [New-AzContainerServiceSnapshot](New-AzContainerServiceSnapshot.md) +Creates or updates a snapshot. + +### [New-AzContainerServiceTrustedAccessRoleBinding](New-AzContainerServiceTrustedAccessRoleBinding.md) +Create or update a trusted access role binding + +### [Remove-AzContainerServiceAgentPool](Remove-AzContainerServiceAgentPool.md) +Deletes an agent pool in the specified managed cluster. + +### [Remove-AzContainerServiceAgentPoolMachine](Remove-AzContainerServiceAgentPoolMachine.md) +Deletes specific machines in an agent pool. + +### [Remove-AzContainerServiceLoadBalancer](Remove-AzContainerServiceLoadBalancer.md) +Deletes a load balancer in the specified managed cluster. + +### [Remove-AzContainerServiceMaintenanceConfiguration](Remove-AzContainerServiceMaintenanceConfiguration.md) +Deletes a maintenance configuration. + +### [Remove-AzContainerServiceManagedCluster](Remove-AzContainerServiceManagedCluster.md) +Deletes a managed cluster. + +### [Remove-AzContainerServiceManagedClusterSnapshot](Remove-AzContainerServiceManagedClusterSnapshot.md) +Deletes a managed cluster snapshot. + +### [Remove-AzContainerServicePrivateEndpointConnection](Remove-AzContainerServicePrivateEndpointConnection.md) +Deletes a private endpoint connection. + +### [Remove-AzContainerServiceSnapshot](Remove-AzContainerServiceSnapshot.md) +Deletes a snapshot. + +### [Remove-AzContainerServiceTrustedAccessRoleBinding](Remove-AzContainerServiceTrustedAccessRoleBinding.md) +Delete a trusted access role binding. + +### [Reset-AzContainerServiceManagedClusterAadProfile](Reset-AzContainerServiceManagedClusterAadProfile.md) +**WARNING**: This API will be deprecated. +Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. + +### [Reset-AzContainerServiceManagedClusterServicePrincipalProfile](Reset-AzContainerServiceManagedClusterServicePrincipalProfile.md) +This action cannot be performed on a cluster that is not using a service principal + +### [Start-AzContainerServiceManagedCluster](Start-AzContainerServiceManagedCluster.md) +See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + +### [Start-AzContainerServiceManagedClusterCommand](Start-AzContainerServiceManagedClusterCommand.md) +AKS will create a pod to run the command. +This is primarily useful for private clusters. +For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + +### [Stop-AzContainerServiceManagedCluster](Stop-AzContainerServiceManagedCluster.md) +This can only be performed on Azure Virtual Machine Scale set backed clusters. +Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. +A cluster does not accrue charges while it is stopped. +See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + +### [Update-AzContainerServiceAgentPoolNodeImageVersion](Update-AzContainerServiceAgentPoolNodeImageVersion.md) +Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. +AKS provides one new image per week with the latest updates. +For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + +### [Update-AzContainerServiceManagedClusterSnapshotTag](Update-AzContainerServiceManagedClusterSnapshotTag.md) +Updates tags on a managed cluster snapshot. + +### [Update-AzContainerServiceManagedClusterTag](Update-AzContainerServiceManagedClusterTag.md) +Updates tags on a managed cluster. + +### [Update-AzContainerServiceSnapshotTag](Update-AzContainerServiceSnapshotTag.md) +Updates tags on a snapshot. + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceAgentPool.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceAgentPool.md new file mode 100644 index 000000000000..4f92b34baa6d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceAgentPool.md @@ -0,0 +1,170 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceagentpool +schema: 2.0.0 +--- + +# Get-AzContainerServiceAgentPool + +## SYNOPSIS +Gets the specified managed cluster agent pool. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceAgentPool -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceAgentPool -Name -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceAgentPool -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the specified managed cluster agent pool. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the agent pool. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: AgentPoolName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.md new file mode 100644 index 000000000000..cc2b1b553af6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.md @@ -0,0 +1,149 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceagentpoolavailableagentpoolversion +schema: 2.0.0 +--- + +# Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion + +## SYNOPSIS +See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + +## SYNTAX + +### Get (Default) +``` +Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceAgentPoolUpgradeProfile.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceAgentPoolUpgradeProfile.md new file mode 100644 index 000000000000..64bc10eb456b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceAgentPoolUpgradeProfile.md @@ -0,0 +1,164 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceagentpoolupgradeprofile +schema: 2.0.0 +--- + +# Get-AzContainerServiceAgentPoolUpgradeProfile + +## SYNOPSIS +Gets the upgrade profile for an agent pool. + +## SYNTAX + +### Get (Default) +``` +Get-AzContainerServiceAgentPoolUpgradeProfile -AgentPoolName -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceAgentPoolUpgradeProfile -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the upgrade profile for an agent pool. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AgentPoolName +The name of the agent pool. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceLoadBalancer.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceLoadBalancer.md new file mode 100644 index 000000000000..400eacaa3aba --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceLoadBalancer.md @@ -0,0 +1,170 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceloadbalancer +schema: 2.0.0 +--- + +# Get-AzContainerServiceLoadBalancer + +## SYNOPSIS +Gets the specified load balancer. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceLoadBalancer -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceLoadBalancer -Name -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceLoadBalancer -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the specified load balancer. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the load balancer. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: LoadBalancerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceMachine.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceMachine.md new file mode 100644 index 000000000000..dd9231d62fcc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceMachine.md @@ -0,0 +1,185 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemachine +schema: 2.0.0 +--- + +# Get-AzContainerServiceMachine + +## SYNOPSIS +Get a specific machine in the specified agent pool. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceMachine -AgentPoolName -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceMachine -AgentPoolName -Name -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceMachine -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Get a specific machine in the specified agent pool. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AgentPoolName +The name of the agent pool. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +host name of the machine + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: MachineName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceMaintenanceConfiguration.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceMaintenanceConfiguration.md new file mode 100644 index 000000000000..1c9dbcff7c5b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceMaintenanceConfiguration.md @@ -0,0 +1,170 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemaintenanceconfiguration +schema: 2.0.0 +--- + +# Get-AzContainerServiceMaintenanceConfiguration + +## SYNOPSIS +Gets the specified maintenance configuration of a managed cluster. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceMaintenanceConfiguration -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceMaintenanceConfiguration -ConfigName -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceMaintenanceConfiguration -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the specified maintenance configuration of a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ConfigName +The name of the maintenance configuration. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..78fa18a9b96d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedCluster.md @@ -0,0 +1,161 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedcluster +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedCluster + +## SYNOPSIS +Gets a managed cluster. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceManagedCluster [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +### Get +``` +Get-AzContainerServiceManagedCluster -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedCluster -InputObject [-DefaultProfile ] + [] +``` + +### List1 +``` +Get-AzContainerServiceManagedCluster -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterAccessProfile.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterAccessProfile.md new file mode 100644 index 000000000000..b823eb695d24 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterAccessProfile.md @@ -0,0 +1,198 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusteraccessprofile +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterAccessProfile + +## SYNOPSIS +**WARNING**: This API will be deprecated. +Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . + +## SYNTAX + +### Get (Default) +``` +Get-AzContainerServiceManagedClusterAccessProfile -ResourceGroupName -ResourceName + -RoleName [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedClusterAccessProfile -InputObject + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +**WARNING**: This API will be deprecated. +Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RoleName +The name of the role for managed cluster accessProfile resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterAdminCredentials.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterAdminCredentials.md new file mode 100644 index 000000000000..7aeed87836d2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterAdminCredentials.md @@ -0,0 +1,171 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusteradmincredentials +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterAdminCredentials + +## SYNOPSIS +Lists the admin credentials of a managed cluster. + +## SYNTAX + +``` +Get-AzContainerServiceManagedClusterAdminCredentials -ResourceGroupName -ResourceName + [-SubscriptionId ] [-ServerFqdn ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Lists the admin credentials of a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServerFqdn +server fqdn type for credentials to be returned + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterCommandResult.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterCommandResult.md new file mode 100644 index 000000000000..2c8ab9e20ed8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterCommandResult.md @@ -0,0 +1,180 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustercommandresult +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterCommandResult + +## SYNOPSIS +Gets the results of a command which has been run on the Managed Cluster. + +## SYNTAX + +### Get (Default) +``` +Get-AzContainerServiceManagedClusterCommandResult -CommandId -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] + [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedClusterCommandResult -InputObject + [-DefaultProfile ] [-PassThru] [] +``` + +## DESCRIPTION +Gets the results of a command which has been run on the Managed Cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -CommandId +Id of the command. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterGuardrailVersion.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterGuardrailVersion.md new file mode 100644 index 000000000000..997270bf4597 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterGuardrailVersion.md @@ -0,0 +1,154 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterguardrailversion +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterGuardrailVersion + +## SYNOPSIS +Contains Guardrails version along with its support info and whether it is a default version. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceManagedClusterGuardrailVersion -Location [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceManagedClusterGuardrailVersion -Location -Version + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedClusterGuardrailVersion -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Contains Guardrails version along with its support info and whether it is a default version. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of the Azure region. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Version +Safeguards version + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterKuberneteVersion.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterKuberneteVersion.md new file mode 100644 index 000000000000..053c72e18ed1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterKuberneteVersion.md @@ -0,0 +1,108 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterkuberneteversion +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterKuberneteVersion + +## SYNOPSIS +Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version + +## SYNTAX + +``` +Get-AzContainerServiceManagedClusterKuberneteVersion -Location [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The name of the Azure region. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterMeshRevisionProfile.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterMeshRevisionProfile.md new file mode 100644 index 000000000000..8d1de62f1810 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterMeshRevisionProfile.md @@ -0,0 +1,154 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustermeshrevisionprofile +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterMeshRevisionProfile + +## SYNOPSIS +Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceManagedClusterMeshRevisionProfile -Location [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceManagedClusterMeshRevisionProfile -Location -Mode + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedClusterMeshRevisionProfile -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of the Azure region. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Mode +The mode of the mesh. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.md new file mode 100644 index 000000000000..66aa677fbb11 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.md @@ -0,0 +1,170 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustermeshupgradeprofile +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterMeshUpgradeProfile + +## SYNOPSIS +Gets available upgrades for a service mesh in a cluster. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceManagedClusterMeshUpgradeProfile -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceManagedClusterMeshUpgradeProfile -Mode -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedClusterMeshUpgradeProfile -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets available upgrades for a service mesh in a cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Mode +The mode of the mesh. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.md new file mode 100644 index 000000000000..ed58c54b6669 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.md @@ -0,0 +1,171 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustermonitoringusercredentials +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterMonitoringUserCredentials + +## SYNOPSIS +Lists the cluster monitoring user credentials of a managed cluster. + +## SYNTAX + +``` +Get-AzContainerServiceManagedClusterMonitoringUserCredentials -ResourceGroupName + -ResourceName [-SubscriptionId ] [-ServerFqdn ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Lists the cluster monitoring user credentials of a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServerFqdn +server fqdn type for credentials to be returned + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterOSOption.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterOSOption.md new file mode 100644 index 000000000000..e38838977c7a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterOSOption.md @@ -0,0 +1,148 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterosoption +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterOSOption + +## SYNOPSIS +Gets supported OS options in the specified subscription. + +## SYNTAX + +### Get (Default) +``` +Get-AzContainerServiceManagedClusterOSOption -Location [-SubscriptionId ] + [-ResourceType ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedClusterOSOption -InputObject [-ResourceType ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets supported OS options in the specified subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of the Azure region. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceType +The resource type for which the OS options needs to be returned + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.md new file mode 100644 index 000000000000..d91f5b52d6dc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.md @@ -0,0 +1,126 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusteroutboundnetworkdependencyendpoint +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint + +## SYNOPSIS +Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. +The operation returns properties of each egress endpoint. + +## SYNTAX + +``` +Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. +The operation returns properties of each egress endpoint. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterSafeguardVersion.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterSafeguardVersion.md new file mode 100644 index 000000000000..c37a30a3b085 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterSafeguardVersion.md @@ -0,0 +1,154 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustersafeguardversion +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterSafeguardVersion + +## SYNOPSIS +Contains Safeguards version along with its support info and whether it is a default version. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceManagedClusterSafeguardVersion -Location [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceManagedClusterSafeguardVersion -Location -Version + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedClusterSafeguardVersion -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Contains Safeguards version along with its support info and whether it is a default version. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The name of the Azure region. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Version +Safeguards version + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterSnapshot.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterSnapshot.md new file mode 100644 index 000000000000..cf05dda4ab09 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterSnapshot.md @@ -0,0 +1,161 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustersnapshot +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterSnapshot + +## SYNOPSIS +Gets a managed cluster snapshot. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceManagedClusterSnapshot [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +### Get +``` +Get-AzContainerServiceManagedClusterSnapshot -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedClusterSnapshot -InputObject + [-DefaultProfile ] [] +``` + +### List1 +``` +Get-AzContainerServiceManagedClusterSnapshot -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets a managed cluster snapshot. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterUpgradeProfile.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterUpgradeProfile.md new file mode 100644 index 000000000000..eb83bd9a6a4d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterUpgradeProfile.md @@ -0,0 +1,149 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterupgradeprofile +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterUpgradeProfile + +## SYNOPSIS +Gets the upgrade profile of a managed cluster. + +## SYNTAX + +### Get (Default) +``` +Get-AzContainerServiceManagedClusterUpgradeProfile -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceManagedClusterUpgradeProfile -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the upgrade profile of a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterUserCredentials.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterUserCredentials.md new file mode 100644 index 000000000000..5ddd8380244d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceManagedClusterUserCredentials.md @@ -0,0 +1,187 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterusercredentials +schema: 2.0.0 +--- + +# Get-AzContainerServiceManagedClusterUserCredentials + +## SYNOPSIS +Lists the user credentials of a managed cluster. + +## SYNTAX + +``` +Get-AzContainerServiceManagedClusterUserCredentials -ResourceGroupName -ResourceName + [-SubscriptionId ] [-Format ] [-ServerFqdn ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Lists the user credentials of a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Format +Only apply to AAD clusters, specifies the format of returned kubeconfig. +Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServerFqdn +server fqdn type for credentials to be returned + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceOperationStatusResult.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceOperationStatusResult.md new file mode 100644 index 000000000000..4613fc016f37 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceOperationStatusResult.md @@ -0,0 +1,198 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceoperationstatusresult +schema: 2.0.0 +--- + +# Get-AzContainerServiceOperationStatusResult + +## SYNOPSIS +Get the status of a specific operation in the specified managed cluster. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceOperationStatusResult -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceOperationStatusResult -OperationId -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get1 +``` +Get-AzContainerServiceOperationStatusResult -AgentPoolName -OperationId + -ResourceGroupName -ResourceName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceOperationStatusResult -InputObject + [-DefaultProfile ] [] +``` + +### GetViaIdentity1 +``` +Get-AzContainerServiceOperationStatusResult -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get the status of a specific operation in the specified managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AgentPoolName +The name of the agent pool. + +```yaml +Type: System.String +Parameter Sets: Get1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity, GetViaIdentity1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -OperationId +The ID of an ongoing async operation. + +```yaml +Type: System.String +Parameter Sets: Get, Get1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, Get1, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get, Get1, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, Get1, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServicePrivateEndpointConnection.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServicePrivateEndpointConnection.md new file mode 100644 index 000000000000..05b5acc28355 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServicePrivateEndpointConnection.md @@ -0,0 +1,170 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceprivateendpointconnection +schema: 2.0.0 +--- + +# Get-AzContainerServicePrivateEndpointConnection + +## SYNOPSIS +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServicePrivateEndpointConnection -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServicePrivateEndpointConnection -Name -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServicePrivateEndpointConnection -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the private endpoint connection. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: PrivateEndpointConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServicePrivateLinkResource.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServicePrivateLinkResource.md new file mode 100644 index 000000000000..9656689b0236 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServicePrivateLinkResource.md @@ -0,0 +1,124 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceprivatelinkresource +schema: 2.0.0 +--- + +# Get-AzContainerServicePrivateLinkResource + +## SYNOPSIS +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + +## SYNTAX + +``` +Get-AzContainerServicePrivateLinkResource -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceSnapshot.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceSnapshot.md new file mode 100644 index 000000000000..fb5e79b5cc0a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceSnapshot.md @@ -0,0 +1,160 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicesnapshot +schema: 2.0.0 +--- + +# Get-AzContainerServiceSnapshot + +## SYNOPSIS +Gets a snapshot. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceSnapshot [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceSnapshot -ResourceGroupName -ResourceName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceSnapshot -InputObject [-DefaultProfile ] + [] +``` + +### List1 +``` +Get-AzContainerServiceSnapshot -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets a snapshot. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceTrustedAccessRole.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceTrustedAccessRole.md new file mode 100644 index 000000000000..e2745c1145cd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceTrustedAccessRole.md @@ -0,0 +1,108 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicetrustedaccessrole +schema: 2.0.0 +--- + +# Get-AzContainerServiceTrustedAccessRole + +## SYNOPSIS +List supported trusted access roles. + +## SYNTAX + +``` +Get-AzContainerServiceTrustedAccessRole -Location [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +List supported trusted access roles. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The name of the Azure region. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceTrustedAccessRoleBinding.md b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceTrustedAccessRoleBinding.md new file mode 100644 index 000000000000..ca7197c5be5e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Get-AzContainerServiceTrustedAccessRoleBinding.md @@ -0,0 +1,170 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicetrustedaccessrolebinding +schema: 2.0.0 +--- + +# Get-AzContainerServiceTrustedAccessRoleBinding + +## SYNOPSIS +Get a trusted access role binding. + +## SYNTAX + +### List (Default) +``` +Get-AzContainerServiceTrustedAccessRoleBinding -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzContainerServiceTrustedAccessRoleBinding -Name -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzContainerServiceTrustedAccessRoleBinding -InputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get a trusted access role binding. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of trusted access role binding. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: TrustedAccessRoleBindingName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Import-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/docs/Import-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..cb96d5430d2f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Import-AzContainerServiceManagedCluster.md @@ -0,0 +1,260 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/import-azcontainerservicemanagedcluster +schema: 2.0.0 +--- + +# Import-AzContainerServiceManagedCluster + +## SYNOPSIS +Rebalance nodes across specific load balancers. + +## SYNTAX + +### LoadExpanded (Default) +``` +Import-AzContainerServiceManagedCluster -ResourceGroupName -ResourceName + [-SubscriptionId ] [-LoadBalancerName ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +### Load +``` +Import-AzContainerServiceManagedCluster -ResourceGroupName -ResourceName + -Parameter [-SubscriptionId ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### LoadViaIdentity +``` +Import-AzContainerServiceManagedCluster -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +### LoadViaIdentityExpanded +``` +Import-AzContainerServiceManagedCluster -InputObject + [-LoadBalancerName ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Rebalance nodes across specific load balancers. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: LoadViaIdentity, LoadViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LoadBalancerName +The load balancer names list. + +```yaml +Type: System.String[] +Parameter Sets: LoadExpanded, LoadViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +The names of the load balancers to rebalance. +If set to empty, all load balancers will be rebalanced. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody +Parameter Sets: Load, LoadViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Load, LoadExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Load, LoadExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Load, LoadExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.md b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.md new file mode 100644 index 000000000000..9c9b8c927aa3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerserviceabortagentpoollatestoperation +schema: 2.0.0 +--- + +# Invoke-AzContainerServiceAbortAgentPoolLatestOperation + +## SYNOPSIS +Aborts the currently running operation on the agent pool. +The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. + +## SYNTAX + +### Abort (Default) +``` +Invoke-AzContainerServiceAbortAgentPoolLatestOperation -AgentPoolName -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### AbortViaIdentity +``` +Invoke-AzContainerServiceAbortAgentPoolLatestOperation -InputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Aborts the currently running operation on the agent pool. +The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AgentPoolName +The name of the agent pool. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: AbortViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.md b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.md new file mode 100644 index 000000000000..68bf4f0f2799 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerserviceabortmanagedclusterlatestoperation +schema: 2.0.0 +--- + +# Invoke-AzContainerServiceAbortManagedClusterLatestOperation + +## SYNOPSIS +Aborts the currently running operation on the managed cluster. +The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. + +## SYNTAX + +### Abort (Default) +``` +Invoke-AzContainerServiceAbortManagedClusterLatestOperation -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### AbortViaIdentity +``` +Invoke-AzContainerServiceAbortManagedClusterLatestOperation -InputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Aborts the currently running operation on the managed cluster. +The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: AbortViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceResolvePrivateLinkServiceId.md b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceResolvePrivateLinkServiceId.md new file mode 100644 index 000000000000..a03c2c322599 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceResolvePrivateLinkServiceId.md @@ -0,0 +1,288 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerserviceresolveprivatelinkserviceid +schema: 2.0.0 +--- + +# Invoke-AzContainerServiceResolvePrivateLinkServiceId + +## SYNOPSIS +Gets the private link service ID for the specified managed cluster. + +## SYNTAX + +### PostExpanded (Default) +``` +Invoke-AzContainerServiceResolvePrivateLinkServiceId -ResourceGroupName -ResourceName + [-SubscriptionId ] [-GroupId ] [-Id ] [-Name ] [-RequiredMember ] + [-Type ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### Post +``` +Invoke-AzContainerServiceResolvePrivateLinkServiceId -ResourceGroupName -ResourceName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### PostViaIdentity +``` +Invoke-AzContainerServiceResolvePrivateLinkServiceId -InputObject + -Parameter [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### PostViaIdentityExpanded +``` +Invoke-AzContainerServiceResolvePrivateLinkServiceId -InputObject + [-GroupId ] [-Id ] [-Name ] [-RequiredMember ] [-Type ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Gets the private link service ID for the specified managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GroupId +The group ID of the resource. + +```yaml +Type: System.String +Parameter Sets: PostExpanded, PostViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +The ID of the private link resource. + +```yaml +Type: System.String +Parameter Sets: PostExpanded, PostViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: PostViaIdentity, PostViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the private link resource. + +```yaml +Type: System.String +Parameter Sets: PostExpanded, PostViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +A private link resource +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource +Parameter Sets: Post, PostViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -RequiredMember +The RequiredMembers of the resource + +```yaml +Type: System.String[] +Parameter Sets: PostExpanded, PostViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Post, PostExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Post, PostExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Post, PostExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +The resource type. + +```yaml +Type: System.String +Parameter Sets: PostExpanded, PostViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceRotateManagedClusterCertificate.md b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceRotateManagedClusterCertificate.md new file mode 100644 index 000000000000..8f2ae7427b13 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceRotateManagedClusterCertificate.md @@ -0,0 +1,226 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerservicerotatemanagedclustercertificate +schema: 2.0.0 +--- + +# Invoke-AzContainerServiceRotateManagedClusterCertificate + +## SYNOPSIS +See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + +## SYNTAX + +### Rotate (Default) +``` +Invoke-AzContainerServiceRotateManagedClusterCertificate -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### RotateViaIdentity +``` +Invoke-AzContainerServiceRotateManagedClusterCertificate -InputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: RotateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.md b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.md new file mode 100644 index 000000000000..7ab80192cca5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.md @@ -0,0 +1,226 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerservicerotatemanagedclusterserviceaccountsigningkey +schema: 2.0.0 +--- + +# Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey + +## SYNOPSIS +Rotates the service account signing keys of a managed cluster. + +## SYNTAX + +### Rotate (Default) +``` +Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### RotateViaIdentity +``` +Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey -InputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Rotates the service account signing keys of a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: RotateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceAgentPool.md b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceAgentPool.md new file mode 100644 index 000000000000..34750907c536 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceAgentPool.md @@ -0,0 +1,1431 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerserviceagentpool +schema: 2.0.0 +--- + +# New-AzContainerServiceAgentPool + +## SYNOPSIS +Creates or updates an agent pool in the specified managed cluster. + +## SYNTAX + +``` +New-AzContainerServiceAgentPool -Name -ResourceGroupName -ResourceName + [-SubscriptionId ] [-IfMatch ] [-IfNoneMatch ] [-ArtifactStreamingProfileEnabled] + [-AvailabilityZone ] [-CapacityReservationGroupId ] [-Count ] + [-CreationDataSourceResourceId ] [-EnableAutoScaling] [-EnableCustomCaTrust] + [-EnableEncryptionAtHost] [-EnableFips] [-EnableNodePublicIP] [-EnableUltraSsd] + [-GatewayProfilePublicIPPrefixSize ] [-GpuInstanceProfile ] + [-GpuProfileInstallGpuDriver] [-HostGroupId ] [-KubeletConfigAllowedUnsafeSysctl ] + [-KubeletConfigContainerLogMaxFile ] [-KubeletConfigContainerLogMaxSizeMb ] + [-KubeletConfigCpuCfsQuota] [-KubeletConfigCpuCfsQuotaPeriod ] + [-KubeletConfigCpuManagerPolicy ] [-KubeletConfigFailSwapOn] + [-KubeletConfigImageGcHighThreshold ] [-KubeletConfigImageGcLowThreshold ] + [-KubeletConfigPodMaxPid ] [-KubeletConfigTopologyManagerPolicy ] + [-KubeletDiskType ] [-LinuxOSConfigSwapFileSizeMb ] + [-LinuxOSConfigSysctl ] [-LinuxOSConfigTransparentHugePageDefrag ] + [-LinuxOSConfigTransparentHugePageEnabled ] [-MaxCount ] [-MaxPod ] + [-MessageOfTheDay ] [-MinCount ] [-Mode ] + [-NetworkProfileAllowedHostPort ] [-NetworkProfileApplicationSecurityGroup ] + [-NetworkProfileNodePublicIPTag ] [-NodeInitializationTaint ] [-NodeLabel ] + [-NodePublicIPPrefixId ] [-NodeTaint ] [-OrchestratorVersion ] + [-OSDiskSizeGb ] [-OSDiskType ] [-OSSku ] [-OSType ] + [-PodIPAllocationMode ] [-PodSubnetId ] [-PowerStateCode ] + [-PropertiesType ] [-ProximityPlacementGroupId ] + [-ScaleAutoscale ] [-ScaleDownMode ] + [-ScaleManual ] [-ScaleSetEvictionPolicy ] + [-ScaleSetPriority ] [-SecurityProfileEnableSecureBoot] [-SecurityProfileEnableVtpm] + [-SecurityProfileSshAccess ] [-SpotMaxPrice ] [-Tag ] + [-UpgradeSettingDrainTimeoutInMinute ] [-UpgradeSettingMaxSurge ] + [-UpgradeSettingNodeSoakDurationInMinute ] + [-UpgradeSettingUndrainableNodeBehavior ] + [-VirtualMachineNodesStatus ] [-VMSize ] [-VnetSubnetId ] + [-WindowProfileDisableOutboundNat] [-WorkloadRuntime ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates an agent pool in the specified managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ArtifactStreamingProfileEnabled +Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. +To use this feature, container images must also enable artifact streaming on ACR. +If not specified, the default is false. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AvailabilityZone +The list of Availability zones to use for nodes. +This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CapacityReservationGroupId +AKS will associate the specified agent pool with the Capacity Reservation Group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Count +Number of agents (VMs) to host docker containers. +Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. +The default value is 1. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CreationDataSourceResourceId +This is the ARM ID of the source object to be used to create the target object. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableAutoScaling +Whether to enable auto-scaler + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableCustomCaTrust +When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node trust stores. +Defaults to false. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableEncryptionAtHost +This is only supported on certain VM sizes and in certain Azure regions. +For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableFips +See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableNodePublicIP +Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. +A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. +For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). +The default is false. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableUltraSsd +Whether to enable UltraSSD + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GatewayProfilePublicIPPrefixSize +The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. +The size of Public IPPrefix should be selected by the user. +Each node in the agent pool is assigned with one IP from the IPPrefix. +The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. +Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). +The default value is 31. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GpuInstanceProfile +GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GpuProfileInstallGpuDriver +The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. +GPU Driver Installation can only be set true when VM has an associated GPU resource. +Setting this field to false prevents automatic GPU driver installation. +In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HostGroupId +This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. +For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The request should only proceed if an entity matches this string. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfNoneMatch +The request should only proceed if no entity matches this string. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigAllowedUnsafeSysctl +Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigContainerLogMaxFile +The maximum number of container log files that can be present for a container. +The number must be ≥ 2. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigContainerLogMaxSizeMb +The maximum size (e.g. +10Mi) of container log file before it is rotated. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigCpuCfsQuota +The default is true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigCpuCfsQuotaPeriod +The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. +For example: '300ms', '2h45m'. +Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigCpuManagerPolicy +The default is 'none'. +See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. +Allowed values are 'none' and 'static'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigFailSwapOn +If set to true it will make the Kubelet fail to start if swap is enabled on the node. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigImageGcHighThreshold +To disable image garbage collection, set to 100. +The default is 85% + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigImageGcLowThreshold +This cannot be set higher than imageGcHighThreshold. +The default is 80% + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigPodMaxPid +The maximum number of processes per pod. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletConfigTopologyManagerPolicy +For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). +The default is 'none'. +Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeletDiskType +Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LinuxOSConfigSwapFileSizeMb +The size in MB of a swap file that will be created on each node. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LinuxOSConfigSysctl +Sysctl settings for Linux agent nodes. +To construct, see NOTES section for LINUXOSCONFIGSYSCTL properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LinuxOSConfigTransparentHugePageDefrag +Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. +The default is 'madvise'. +For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LinuxOSConfigTransparentHugePageEnabled +Valid values are 'always', 'madvise', and 'never'. +The default is 'always'. +For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxCount +The maximum number of nodes for auto-scaling + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaxPod +The maximum number of pods that can run on a node. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MessageOfTheDay +A base64-encoded string which will be written to /etc/motd after decoding. +This allows customization of the message of the day for Linux nodes. +It must not be specified for Windows nodes. +It must be a static string (i.e., will be printed raw and not be executed as a script). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MinCount +The minimum number of nodes for auto-scaling + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Mode +A cluster must have at least one 'System' Agent Pool at all times. +For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the agent pool. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: AgentPoolName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkProfileAllowedHostPort +The port ranges that are allowed to access. +The specified ranges are allowed to overlap. +To construct, see NOTES section for NETWORKPROFILEALLOWEDHOSTPORT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkProfileApplicationSecurityGroup +The IDs of the application security groups which agent pool will associate when created. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkProfileNodePublicIPTag +IPTags of instance-level public IPs. +To construct, see NOTES section for NETWORKPROFILENODEPUBLICIPTAG properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeInitializationTaint +These taints will not be reconciled by AKS and can be removed with a kubectl call. +This field can be modified after node pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. +node image upgrade) happens. +These taints allow for required configuration to run before the node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeLabel +The node labels to be persisted across all nodes in agent pool. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodePublicIPPrefixId +This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeTaint +The taints added to new nodes during node pool create and scale. +For example, key=value:NoSchedule. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OrchestratorVersion +Both patch version \ and \ are supported. +When \ is specified, the latest supported patch version is chosen automatically. +Updating the agent pool with the same \ once it has been created will not trigger an upgrade, even if a newer patch version is available. +As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. +The node pool version must have the same major version as the control plane. +The node pool minor version must be within two minor versions of the control plane version. +The node pool version cannot be greater than the control plane version. +For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OSDiskSizeGb +OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. +If you specify 0, it will apply the default osDisk size according to the vmSize specified. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OSDiskType +The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. +Otherwise, defaults to 'Managed'. +May not be changed after creation. +For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OSSku +Specifies the OS SKU used by the agent pool. +If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. +And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OSType +The operating system type. +The default is Linux. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PodIPAllocationMode +The IP allocation mode for pods in the agent pool. +Must be used with podSubnetId. +The default is 'DynamicIndividual'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PodSubnetId +If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). +This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PowerStateCode +Tells whether the cluster is Running or Stopped + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesType +The type of Agent Pool. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProximityPlacementGroupId +The ID for Proximity Placement Group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScaleAutoscale +Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. +Currently, at most one AutoScaleProfile is allowed. +To construct, see NOTES section for SCALEAUTOSCALE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScaleDownMode +This also effects the cluster autoscaler behavior. +If not specified, it defaults to Delete. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScaleManual +Specifications on how to scale the VirtualMachines agent pool to a fixed size. +Currently, at most one ManualScaleProfile is allowed. +To construct, see NOTES section for SCALEMANUAL properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScaleSetEvictionPolicy +This cannot be specified unless the scaleSetPriority is 'Spot'. +If not specified, the default is 'Delete'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScaleSetPriority +The Virtual Machine Scale Set priority. +If not specified, the default is 'Regular'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SecurityProfileEnableSecureBoot +Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. +For more details, see aka.ms/aks/trustedlaunch. +If not specified, the default is false. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SecurityProfileEnableVtpm +vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. +For more details, see aka.ms/aks/trustedlaunch. +If not specified, the default is false. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SecurityProfileSshAccess +SSH access method of an agent pool. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SpotMaxPrice +Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. +For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + +```yaml +Type: System.Single +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +The tags to be persisted on the agent pool virtual machine scale set. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UpgradeSettingDrainTimeoutInMinute +The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. +This eviction wait time honors waiting on pod disruption budgets. +If this time is exceeded, the upgrade fails. +If not specified, the default is 30 minutes. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UpgradeSettingMaxSurge +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, the default is 1. +For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UpgradeSettingNodeSoakDurationInMinute +The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. +If not specified, the default is 0 minutes. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UpgradeSettingUndrainableNodeBehavior +Defines the behavior for undrainable nodes during upgrade. +The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VirtualMachineNodesStatus +The status of nodes in a VirtualMachines agent pool. +To construct, see NOTES section for VIRTUALMACHINENODESSTATUS properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMSize +VM size availability varies by region. +If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. +For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VnetSubnetId +If this is not specified, a VNET and subnet will be generated and used. +If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. +This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WindowProfileDisableOutboundNat +The default value is false. +Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkloadRuntime +Determines the type of workload a node can run. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceLoadBalancer.md b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceLoadBalancer.md new file mode 100644 index 000000000000..3833a1498ba1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceLoadBalancer.md @@ -0,0 +1,334 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerserviceloadbalancer +schema: 2.0.0 +--- + +# New-AzContainerServiceLoadBalancer + +## SYNOPSIS +Creates or updates a load balancer in the specified managed cluster. + +## SYNTAX + +``` +New-AzContainerServiceLoadBalancer -Name -ResourceGroupName -ResourceName + [-SubscriptionId ] [-AllowServicePlacement] + [-NodeSelectorMatchExpression ] [-NodeSelectorMatchLabel ] + [-PrimaryAgentPoolName ] [-PropertiesName ] + [-ServiceLabelSelectorMatchExpression ] + [-ServiceLabelSelectorMatchLabel ] + [-ServiceNamespaceSelectorMatchExpression ] + [-ServiceNamespaceSelectorMatchLabel ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Creates or updates a load balancer in the specified managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AllowServicePlacement +Whether to automatically place services on the load balancer. +If not supplied, the default value is true. +If set to false manually, both of the external and the internal load balancer will not be selected for services unless they explicitly target it. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the load balancer. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: LoadBalancerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeSelectorMatchExpression +matchExpressions is a list of label selector requirements. +The requirements are ANDed. +To construct, see NOTES section for NODESELECTORMATCHEXPRESSION properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeSelectorMatchLabel +matchLabels is an array of {key=value} pairs. +A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. +The requirements are ANDed. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrimaryAgentPoolName +Required field. +A string value that must specify the ID of an existing agent pool. +All nodes in the given pool will always be added to this load balancer. +This agent pool must have at least one node and minCount\>=1 for autoscaling operations. +An agent pool can only be the primary pool for a single load balancer. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesName +Name of the public load balancer. +There will be an internal load balancer created if needed, and the name will be `\-internal`. +The internal lb shares the same configurations as the external one. +The internal lbs are not needed to be included in LoadBalancer list. +There must be a name of kubernetes in the list. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceLabelSelectorMatchExpression +matchExpressions is a list of label selector requirements. +The requirements are ANDed. +To construct, see NOTES section for SERVICELABELSELECTORMATCHEXPRESSION properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceLabelSelectorMatchLabel +matchLabels is an array of {key=value} pairs. +A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. +The requirements are ANDed. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceNamespaceSelectorMatchExpression +matchExpressions is a list of label selector requirements. +The requirements are ANDed. +To construct, see NOTES section for SERVICENAMESPACESELECTORMATCHEXPRESSION properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceNamespaceSelectorMatchLabel +matchLabels is an array of {key=value} pairs. +A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. +The requirements are ANDed. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceMaintenanceConfiguration.md b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceMaintenanceConfiguration.md new file mode 100644 index 000000000000..e72318f83e32 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceMaintenanceConfiguration.md @@ -0,0 +1,413 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicemaintenanceconfiguration +schema: 2.0.0 +--- + +# New-AzContainerServiceMaintenanceConfiguration + +## SYNOPSIS +Creates or updates a maintenance configuration in the specified managed cluster. + +## SYNTAX + +``` +New-AzContainerServiceMaintenanceConfiguration -ConfigName -ResourceGroupName + -ResourceName [-SubscriptionId ] [-AbsoluteMonthlyDayOfMonth ] + [-AbsoluteMonthlyIntervalMonth ] [-DailyIntervalDay ] [-MaintenanceWindowDurationHour ] + [-MaintenanceWindowNotAllowedDate ] [-MaintenanceWindowStartDate ] + [-MaintenanceWindowStartTime ] [-MaintenanceWindowUtcOffset ] [-NotAllowedTime ] + [-RelativeMonthlyDayOfWeek ] [-RelativeMonthlyIntervalMonth ] + [-RelativeMonthlyWeekIndex ] [-TimeInWeek ] [-WeeklyDayOfWeek ] + [-WeeklyIntervalWeek ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a maintenance configuration in the specified managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AbsoluteMonthlyDayOfMonth +The date of the month. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AbsoluteMonthlyIntervalMonth +Specifies the number of months between each set of occurrences. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ConfigName +The name of the maintenance configuration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DailyIntervalDay +Specifies the number of days between each set of occurrences. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaintenanceWindowDurationHour +Length of maintenance window range from 4 to 24 hours. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaintenanceWindowNotAllowedDate +Date ranges on which upgrade is not allowed. +'utcOffset' applies to this field. +For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. +To construct, see NOTES section for MAINTENANCEWINDOWNOTALLOWEDDATE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaintenanceWindowStartDate +The date the maintenance window activates. +If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. +If not specified, the maintenance window will be active right away. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaintenanceWindowStartTime +The start time of the maintenance window. +Accepted values are from '00:00' to '23:59'. +'utcOffset' applies to this field. +For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MaintenanceWindowUtcOffset +The UTC offset in format +/-HH:mm. +For example, '+05:30' for IST and '-07:00' for PST. +If not specified, the default is '+00:00'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NotAllowedTime +Time slots on which upgrade is not allowed. +To construct, see NOTES section for NOTALLOWEDTIME properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RelativeMonthlyDayOfWeek +Specifies on which day of the week the maintenance occurs. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RelativeMonthlyIntervalMonth +Specifies the number of months between each set of occurrences. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RelativeMonthlyWeekIndex +Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeInWeek +If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. +To construct, see NOTES section for TIMEINWEEK properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WeeklyDayOfWeek +Specifies on which day of the week the maintenance occurs. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WeeklyIntervalWeek +Specifies the number of weeks between each set of occurrences. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..ff6f77ad92c3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceManagedCluster.md @@ -0,0 +1,2473 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicemanagedcluster +schema: 2.0.0 +--- + +# New-AzContainerServiceManagedCluster + +## SYNOPSIS +Creates or updates a managed cluster. + +## SYNTAX + +``` +New-AzContainerServiceManagedCluster -ResourceGroupName -ResourceName -Location + [-SubscriptionId ] [-IfMatch ] [-IfNoneMatch ] + [-AadProfileAdminGroupObjectID ] [-AadProfileClientAppId ] [-AadProfileEnableAzureRbac] + [-AadProfileManaged] [-AadProfileServerAppId ] [-AadProfileServerAppSecret ] + [-AadProfileTenantId ] [-AddonProfile ] + [-AgentPoolProfile ] [-AiToolchainOperatorProfileEnabled] + [-ApiServerAccessProfileAuthorizedIPRange ] [-ApiServerAccessProfileDisableRunCommand] + [-ApiServerAccessProfileEnablePrivateCluster] [-ApiServerAccessProfileEnablePrivateClusterPublicFqdn] + [-ApiServerAccessProfileEnableVnetIntegration] [-ApiServerAccessProfilePrivateDnsZone ] + [-ApiServerAccessProfileSubnetId ] [-AutoInstrumentationEnabled] + [-AutoScalerProfileBalanceSimilarNodeGroup ] [-AutoScalerProfileDaemonsetEvictionForEmptyNode] + [-AutoScalerProfileDaemonsetEvictionForOccupiedNode] [-AutoScalerProfileExpander ] + [-AutoScalerProfileIgnoreDaemonsetsUtilization] [-AutoScalerProfileMaxEmptyBulkDelete ] + [-AutoScalerProfileMaxGracefulTerminationSec ] [-AutoScalerProfileMaxNodeProvisionTime ] + [-AutoScalerProfileMaxTotalUnreadyPercentage ] [-AutoScalerProfileNewPodScaleUpDelay ] + [-AutoScalerProfileOkTotalUnreadyCount ] [-AutoScalerProfileScaleDownDelayAfterAdd ] + [-AutoScalerProfileScaleDownDelayAfterDelete ] + [-AutoScalerProfileScaleDownDelayAfterFailure ] [-AutoScalerProfileScaleDownUnneededTime ] + [-AutoScalerProfileScaleDownUnreadyTime ] [-AutoScalerProfileScaleDownUtilizationThreshold ] + [-AutoScalerProfileScanInterval ] [-AutoScalerProfileSkipNodesWithLocalStorage ] + [-AutoScalerProfileSkipNodesWithSystemPod ] + [-AutoUpgradeProfileNodeOSUpgradeChannel ] + [-AutoUpgradeProfileUpgradeChannel ] [-AzureKeyVaultKmEnabled] + [-AzureKeyVaultKmKeyId ] [-AzureKeyVaultKmKeyVaultNetworkAccess ] + [-AzureKeyVaultKmKeyVaultResourceId ] [-BlobCsiDriverEnabled] + [-BootstrapProfileArtifactSource ] [-BootstrapProfileContainerRegistryId ] + [-ComponentEgressGateway ] [-ComponentIngressGateway ] + [-ContainerInsightDisableCustomMetric] [-ContainerInsightDisablePrometheusMetricsScraping] + [-ContainerInsightEnabled] [-ContainerInsightLogAnalyticsWorkspaceResourceId ] + [-ContainerInsightSyslogPort ] [-CostAnalysisEnabled] [-CreationDataSourceResourceId ] + [-DefenderLogAnalyticsWorkspaceResourceId ] [-DisableLocalAccount] [-DiskCsiDriverEnabled] + [-DiskCsiDriverVersion ] [-DiskEncryptionSetId ] [-DnsPrefix ] + [-EnableNamespaceResource] [-EnablePodSecurityPolicy] [-EnableRbac] [-ExtendedLocationName ] + [-ExtendedLocationType ] [-FileCsiDriverEnabled] [-FqdnSubdomain ] + [-GmsaProfileDnsServer ] [-GmsaProfileEnabled] [-GmsaProfileRootDomainName ] + [-HttpProxyConfigHttpProxy ] [-HttpProxyConfigHttpsProxy ] + [-HttpProxyConfigNoProxy ] [-HttpProxyConfigTrustedCa ] + [-IdentityDelegatedResource ] [-IdentityProfile ] + [-IdentityType ] [-IdentityUserAssignedIdentity ] [-ImageCleanerEnabled] + [-ImageCleanerIntervalHour ] [-ImageIntegrityEnabled] [-IstioRevision ] [-KedaEnabled] + [-Kind ] [-KubernetesVersion ] [-KubeStateMetricAnnotationsAllowList ] + [-KubeStateMetricLabelsAllowlist ] [-LinuxProfileAdminUsername ] [-MetricEnabled] + [-NetworkProfile ] [-NodeProvisioningProfileMode ] + [-NodeResourceGroup ] [-NodeResourceGroupProfileRestrictionLevel ] + [-NodeRestrictionEnabled] [-OidcIssuerProfileEnabled] [-OpenTelemetryLogEnabled] + [-OpenTelemetryLogPort ] [-OpenTelemetryMetricEnabled] [-OpenTelemetryMetricPort ] + [-OverrideSettingForceUpgrade] [-OverrideSettingUntil ] [-PluginCertChainObjectName ] + [-PluginCertObjectName ] [-PluginKeyObjectName ] [-PluginKeyVaultId ] + [-PluginRootCertObjectName ] [-PodIdentityProfileAllowNetworkPluginKubenet] + [-PodIdentityProfileEnabled] [-PodIdentityProfileUserAssignedIdentity ] + [-PodIdentityProfileUserAssignedIdentityException ] + [-PrivateLinkResource ] [-PublicNetworkAccess ] + [-SafeguardProfileExcludedNamespace ] [-SafeguardProfileLevel ] + [-SafeguardProfileVersion ] [-SecurityMonitoringEnabled] + [-SecurityProfileCustomCaTrustCertificate ] [-ServiceMeshProfileMode ] + [-ServicePrincipalProfileClientId ] [-ServicePrincipalProfileSecret ] + [-SkuName ] [-SkuTier ] [-SnapshotControllerEnabled] + [-SshPublicKey ] [-SupportPlan ] [-Tag ] + [-VerticalPodAutoscalerAddonAutoscaling ] [-VerticalPodAutoscalerEnabled] + [-WebAppRoutingDnsZoneResourceId ] [-WebAppRoutingEnabled] [-WindowProfileAdminPassword ] + [-WindowProfileAdminUsername ] [-WindowProfileEnableCsiProxy] + [-WindowProfileLicenseType ] [-WorkloadIdentityEnabled] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AadProfileAdminGroupObjectID +The list of AAD group object IDs that will have admin role of the cluster. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AadProfileClientAppId +(DEPRECATED) The client AAD application ID. +Learn more at https://aka.ms/aks/aad-legacy. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AadProfileEnableAzureRbac +Whether to enable Azure RBAC for Kubernetes authorization. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AadProfileManaged +Whether to enable managed AAD. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AadProfileServerAppId +(DEPRECATED) The server AAD application ID. +Learn more at https://aka.ms/aks/aad-legacy. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AadProfileServerAppSecret +(DEPRECATED) The server AAD application secret. +Learn more at https://aka.ms/aks/aad-legacy. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AadProfileTenantId +The AAD tenant ID to use for authentication. +If not specified, will use the tenant of the deployment subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AddonProfile +The profile of managed cluster add-on. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AgentPoolProfile +The agent pool properties. +To construct, see NOTES section for AGENTPOOLPROFILE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AiToolchainOperatorProfileEnabled +Indicates if AI toolchain operator enabled or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiServerAccessProfileAuthorizedIPRange +IP ranges are specified in CIDR format, e.g. +137.117.106.88/29. +This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. +For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiServerAccessProfileDisableRunCommand +Whether to disable run command for the cluster or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiServerAccessProfileEnablePrivateCluster +For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiServerAccessProfileEnablePrivateClusterPublicFqdn +Whether to create additional public FQDN for private cluster or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiServerAccessProfileEnableVnetIntegration +Whether to enable apiserver vnet integration for the cluster or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiServerAccessProfilePrivateDnsZone +The default is System. +For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). +Allowed values are 'system' and 'none'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ApiServerAccessProfileSubnetId +It is required when: 1. +creating a new cluster with BYO Vnet; 2. +updating an existing cluster to enable apiserver vnet integration. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoInstrumentationEnabled +Indicates if Application Monitoring Auto Instrumentation is enabled or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileBalanceSimilarNodeGroup +Valid values are 'true' and 'false' + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileDaemonsetEvictionForEmptyNode +If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. +If the daemonset pod cannot be evicted another node will be chosen for scaling. +If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileDaemonsetEvictionForOccupiedNode +If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. +If the daemonset pod cannot be evicted another node will be chosen for scaling. +If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileExpander +Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileIgnoreDaemonsetsUtilization +If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileMaxEmptyBulkDelete +The default is 10. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileMaxGracefulTerminationSec +The default is 600. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileMaxNodeProvisionTime +The default is '15m'. +Values must be an integer followed by an 'm'. +No unit of time other than minutes (m) is supported. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileMaxTotalUnreadyPercentage +The default is 45. +The maximum is 100 and the minimum is 0. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileNewPodScaleUpDelay +For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. +The default is '0s'. +Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileOkTotalUnreadyCount +This must be an integer. +The default is 3. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileScaleDownDelayAfterAdd +The default is '10m'. +Values must be an integer followed by an 'm'. +No unit of time other than minutes (m) is supported. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileScaleDownDelayAfterDelete +The default is the scan-interval. +Values must be an integer followed by an 'm'. +No unit of time other than minutes (m) is supported. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileScaleDownDelayAfterFailure +The default is '3m'. +Values must be an integer followed by an 'm'. +No unit of time other than minutes (m) is supported. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileScaleDownUnneededTime +The default is '10m'. +Values must be an integer followed by an 'm'. +No unit of time other than minutes (m) is supported. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileScaleDownUnreadyTime +The default is '20m'. +Values must be an integer followed by an 'm'. +No unit of time other than minutes (m) is supported. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileScaleDownUtilizationThreshold +The default is '0.5'. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileScanInterval +The default is '10'. +Values must be an integer number of seconds. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileSkipNodesWithLocalStorage +The default is true. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoScalerProfileSkipNodesWithSystemPod +The default is true. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoUpgradeProfileNodeOSUpgradeChannel +The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AutoUpgradeProfileUpgradeChannel +For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureKeyVaultKmEnabled +Whether to enable Azure Key Vault key management service. +The default is false. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureKeyVaultKmKeyId +Identifier of Azure Key Vault key. +See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. +When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. +When Azure Key Vault key management service is disabled, leave the field empty. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureKeyVaultKmKeyVaultNetworkAccess +Network access of key vault. +The possible values are `Public` and `Private`. +`Public` means the key vault allows public access from all networks. +`Private` means the key vault disables public access and enables private link. +The default value is `Public`. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureKeyVaultKmKeyVaultResourceId +Resource ID of key vault. +When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. +When keyVaultNetworkAccess is `Public`, leave the field empty. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BlobCsiDriverEnabled +Whether to enable AzureBlob CSI Driver. +The default value is false. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BootstrapProfileArtifactSource +The source where the artifacts are downloaded from. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BootstrapProfileContainerRegistryId +The resource Id of Azure Container Registry. +The registry must have private network access, premium SKU and zone redundancy. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ComponentEgressGateway +Istio egress gateways. +To construct, see NOTES section for COMPONENTEGRESSGATEWAY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ComponentIngressGateway +Istio ingress gateways. +To construct, see NOTES section for COMPONENTINGRESSGATEWAY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerInsightDisableCustomMetric +Indicates whether custom metrics collection has to be disabled or not. +If not specified the default is false. +No custom metrics will be emitted if this field is false but the container insights enabled field is false + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerInsightDisablePrometheusMetricsScraping +Indicates whether prometheus metrics scraping is disabled or not. +If not specified the default is false. +No prometheus metrics will be emitted if this field is false but the container insights enabled field is false + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerInsightEnabled +Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerInsightLogAnalyticsWorkspaceResourceId +Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerInsightSyslogPort +The syslog host port. +If not specified, the default port is 28330. + +```yaml +Type: System.Int64 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CostAnalysisEnabled +The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. +Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. +If not specified, the default is false. +For more information see aka.ms/aks/docs/cost-analysis. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CreationDataSourceResourceId +This is the ARM ID of the source object to be used to create the target object. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefenderLogAnalyticsWorkspaceResourceId +Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. +When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. +When Microsoft Defender is disabled, leave the field empty. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisableLocalAccount +If set to true, getting static credentials will be disabled for this cluster. +This must only be used on Managed Clusters that are AAD enabled. +For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskCsiDriverEnabled +Whether to enable AzureDisk CSI Driver. +The default value is true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskCsiDriverVersion +The version of AzureDisk CSI Driver. +The default value is v1. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskEncryptionSetId +This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DnsPrefix +This cannot be updated once the Managed Cluster has been created. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableNamespaceResource +The default value is false. +It can be enabled/disabled on creation and updating of the managed cluster. +See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM Resource. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnablePodSecurityPolicy +(DEPRECATED) Whether to enable Kubernetes pod security policy (preview). +PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. +Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableRbac +Whether to enable Kubernetes Role-Based Access Control. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExtendedLocationName +The name of the extended location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExtendedLocationType +The type of the extended location. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileCsiDriverEnabled +Whether to enable AzureFile CSI Driver. +The default value is true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FqdnSubdomain +This cannot be updated once the Managed Cluster has been created. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GmsaProfileDnsServer +Specifies the DNS server for Windows gMSA. + + + Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GmsaProfileEnabled +Specifies whether to enable Windows gMSA in the managed cluster. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -GmsaProfileRootDomainName +Specifies the root domain name for Windows gMSA. + + + Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HttpProxyConfigHttpProxy +The HTTP proxy server endpoint to use. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HttpProxyConfigHttpsProxy +The HTTPS proxy server endpoint to use. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HttpProxyConfigNoProxy +The endpoints that should not go through proxy. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HttpProxyConfigTrustedCa +Alternative CA cert to use for connecting to proxy servers. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityDelegatedResource +The delegated identity resources assigned to this managed cluster. +This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. +Internal use only. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityProfile +Identities associated with the cluster. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The request should only proceed if an entity matches this string. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfNoneMatch +The request should only proceed if no entity matches this string. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImageCleanerEnabled +Whether to enable Image Cleaner on AKS cluster. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImageCleanerIntervalHour +Image Cleaner scanning interval in hours. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImageIntegrityEnabled +Whether to enable image integrity. +The default value is false. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IstioRevision +The list of revisions of the Istio control plane. +When an upgrade is not in progress, this holds one value. +When canary upgrade is in progress, this can only hold two consecutive values. +For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KedaEnabled +Whether to enable KEDA. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +This is primarily used to expose different UI experiences in the portal for different kinds + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubernetesVersion +When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. +All upgrades must be performed sequentially by major version number. +For example, upgrades between 1.14.x -\> 1.15.x or 1.15.x -\> 1.16.x are allowed, however 1.14.x -\> 1.16.x is not allowed. +See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeStateMetricAnnotationsAllowList +Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KubeStateMetricLabelsAllowlist +Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LinuxProfileAdminUsername +The administrator username to use for Linux VMs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The geo-location where the resource lives + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MetricEnabled +Whether to enable the Prometheus collector + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkProfile +The network configuration profile. +To construct, see NOTES section for NETWORKPROFILE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeProvisioningProfileMode +Once the mode it set to Auto, it cannot be changed back to Manual. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeResourceGroup +The name of the resource group containing agent pool nodes. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeResourceGroupProfileRestrictionLevel +The restriction level applied to the cluster's node resource group + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NodeRestrictionEnabled +Whether to enable Node Restriction + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OidcIssuerProfileEnabled +Whether the OIDC issuer is enabled. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OpenTelemetryLogEnabled +Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OpenTelemetryLogPort +The Open Telemetry host port for Open Telemetry logs and traces. +If not specified, the default port is 28331. + +```yaml +Type: System.Int64 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OpenTelemetryMetricEnabled +Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OpenTelemetryMetricPort +The Open Telemetry host port for Open Telemetry metrics. +If not specified, the default port is 28333. + +```yaml +Type: System.Int64 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OverrideSettingForceUpgrade +Whether to force upgrade the cluster. +Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. +Enable this option only with caution. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OverrideSettingUntil +Until when the overrides are effective. +Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. +This field is not set by default. +It must be set for the overrides to take effect. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PluginCertChainObjectName +Certificate chain object name in Azure Key Vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PluginCertObjectName +Intermediate certificate object name in Azure Key Vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PluginKeyObjectName +Intermediate certificate private key object name in Azure Key Vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PluginKeyVaultId +The resource ID of the Key Vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PluginRootCertObjectName +Root certificate object name in Azure Key Vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PodIdentityProfileAllowNetworkPluginKubenet +Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. +See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PodIdentityProfileEnabled +Whether the pod identity addon is enabled. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PodIdentityProfileUserAssignedIdentity +The pod identities to use in the cluster. +To construct, see NOTES section for PODIDENTITYPROFILEUSERASSIGNEDIDENTITY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PodIdentityProfileUserAssignedIdentityException +The pod identity exceptions to allow. +To construct, see NOTES section for PODIDENTITYPROFILEUSERASSIGNEDIDENTITYEXCEPTION properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateLinkResource +Private link resources associated with the cluster. +To construct, see NOTES section for PRIVATELINKRESOURCE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +Allow or deny public network access for AKS + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SafeguardProfileExcludedNamespace +List of namespaces excluded from Safeguards checks + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SafeguardProfileLevel +The Safeguards level to be used. +By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SafeguardProfileVersion +The version of constraints to use + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SecurityMonitoringEnabled +Whether to enable Defender threat detection + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SecurityProfileCustomCaTrustCertificate +A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. +For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + +```yaml +Type: System.Byte[][] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceMeshProfileMode +Mode of the service mesh. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalProfileClientId +The ID for the service principal. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServicePrincipalProfileSecret +The secret password associated with the service principal in plain text. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The name of a managed cluster SKU. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuTier +If not specified, the default is 'Free'. +See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SnapshotControllerEnabled +Whether to enable Snapshot Controller. +The default value is true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SshPublicKey +The list of SSH public keys used to authenticate with Linux-based VMs. +A maximum of 1 key may be specified. +To construct, see NOTES section for SSHPUBLICKEY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SupportPlan +The support plan for the Managed Cluster. +If unspecified, the default is 'KubernetesOfficial'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VerticalPodAutoscalerAddonAutoscaling +Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VerticalPodAutoscalerEnabled +Whether to enable VPA add-on in cluster. +Default value is false. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WebAppRoutingDnsZoneResourceId +Resource IDs of the DNS zones to be associated with the Web App Routing add-on. +Used only when Web App Routing is enabled. +Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WebAppRoutingEnabled +Whether to enable Web App Routing. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WindowProfileAdminPassword +Specifies the password of the administrator account. + + + **Minimum-length:** 8 characters + + **Max-length:** 123 characters + + **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + Has lower characters +Has upper characters + Has a digit + Has a special character (Regex match [\W_]) + + **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WindowProfileAdminUsername +Specifies the name of the administrator account. + + + **Restriction:** Cannot end in "." + + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + + + **Minimum-length:** 1 character + + **Max-length:** 20 characters + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WindowProfileEnableCsiProxy +For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WindowProfileLicenseType +The license type to use for Windows VMs. +See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkloadIdentityEnabled +Whether to enable workload identity. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceManagedClusterSnapshot.md b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceManagedClusterSnapshot.md new file mode 100644 index 000000000000..f379037317d8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceManagedClusterSnapshot.md @@ -0,0 +1,218 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicemanagedclustersnapshot +schema: 2.0.0 +--- + +# New-AzContainerServiceManagedClusterSnapshot + +## SYNOPSIS +Creates or updates a managed cluster snapshot. + +## SYNTAX + +``` +New-AzContainerServiceManagedClusterSnapshot -ResourceGroupName -ResourceName + -Location [-SubscriptionId ] [-CreationDataSourceResourceId ] + [-SnapshotType ] [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Creates or updates a managed cluster snapshot. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -CreationDataSourceResourceId +This is the ARM ID of the source object to be used to create the target object. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The geo-location where the resource lives + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SnapshotType +The type of a snapshot. +The default is NodePool. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceSnapshot.md b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceSnapshot.md new file mode 100644 index 000000000000..69e49714753b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceSnapshot.md @@ -0,0 +1,217 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicesnapshot +schema: 2.0.0 +--- + +# New-AzContainerServiceSnapshot + +## SYNOPSIS +Creates or updates a snapshot. + +## SYNTAX + +``` +New-AzContainerServiceSnapshot -ResourceGroupName -ResourceName -Location + [-SubscriptionId ] [-CreationDataSourceResourceId ] [-SnapshotType ] + [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a snapshot. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -CreationDataSourceResourceId +This is the ARM ID of the source object to be used to create the target object. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The geo-location where the resource lives + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SnapshotType +The type of a snapshot. +The default is NodePool. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceTrustedAccessRoleBinding.md b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceTrustedAccessRoleBinding.md new file mode 100644 index 000000000000..beefb19c0c6a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/New-AzContainerServiceTrustedAccessRoleBinding.md @@ -0,0 +1,232 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicetrustedaccessrolebinding +schema: 2.0.0 +--- + +# New-AzContainerServiceTrustedAccessRoleBinding + +## SYNOPSIS +Create or update a trusted access role binding + +## SYNTAX + +``` +New-AzContainerServiceTrustedAccessRoleBinding -Name -ResourceGroupName + -ResourceName -Role -SourceResourceId [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create or update a trusted access role binding + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of trusted access role binding. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: TrustedAccessRoleBindingName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Role +A list of roles to bind, each item is a resource type qualified role name. +For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceResourceId +The ARM resource ID of source resource that trusted access is configured for. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/README.md b/swaggerci/containerservice.DefaultTag/docs/README.md new file mode 100644 index 000000000000..decc2c87f61c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.ContainerService` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.ContainerService` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceAgentPool.md b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceAgentPool.md new file mode 100644 index 000000000000..3571c8cae968 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceAgentPool.md @@ -0,0 +1,272 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceagentpool +schema: 2.0.0 +--- + +# Remove-AzContainerServiceAgentPool + +## SYNOPSIS +Deletes an agent pool in the specified managed cluster. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzContainerServiceAgentPool -Name -ResourceGroupName -ResourceName + [-SubscriptionId ] [-IgnorePodDisruptionBudget] [-IfMatch ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzContainerServiceAgentPool -InputObject [-IgnorePodDisruptionBudget] + [-IfMatch ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Deletes an agent pool in the specified managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The request should only proceed if an entity matches this string. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IgnorePodDisruptionBudget +ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the agent pool. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: AgentPoolName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceAgentPoolMachine.md b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceAgentPoolMachine.md new file mode 100644 index 000000000000..df005c1bc47d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceAgentPoolMachine.md @@ -0,0 +1,273 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceagentpoolmachine +schema: 2.0.0 +--- + +# Remove-AzContainerServiceAgentPoolMachine + +## SYNOPSIS +Deletes specific machines in an agent pool. + +## SYNTAX + +### DeleteExpanded (Default) +``` +Remove-AzContainerServiceAgentPoolMachine -AgentPoolName -ResourceGroupName + -ResourceName -MachineName [-SubscriptionId ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### Delete +``` +Remove-AzContainerServiceAgentPoolMachine -AgentPoolName -ResourceGroupName + -ResourceName -Machine [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzContainerServiceAgentPoolMachine -InputObject + -Machine [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +### DeleteViaIdentityExpanded +``` +Remove-AzContainerServiceAgentPoolMachine -InputObject -MachineName + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes specific machines in an agent pool. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AgentPoolName +The name of the agent pool. + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: DeleteViaIdentity, DeleteViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Machine +Specifies a list of machine names from the agent pool to be deleted. +To construct, see NOTES section for MACHINE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter +Parameter Sets: Delete, DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -MachineName +The agent pool machine names. + +```yaml +Type: System.String[] +Parameter Sets: DeleteExpanded, DeleteViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceLoadBalancer.md b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceLoadBalancer.md new file mode 100644 index 000000000000..300bd62bc839 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceLoadBalancer.md @@ -0,0 +1,241 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceloadbalancer +schema: 2.0.0 +--- + +# Remove-AzContainerServiceLoadBalancer + +## SYNOPSIS +Deletes a load balancer in the specified managed cluster. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzContainerServiceLoadBalancer -Name -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzContainerServiceLoadBalancer -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes a load balancer in the specified managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the load balancer. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: LoadBalancerName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceMaintenanceConfiguration.md b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceMaintenanceConfiguration.md new file mode 100644 index 000000000000..09782d2b808d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceMaintenanceConfiguration.md @@ -0,0 +1,211 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicemaintenanceconfiguration +schema: 2.0.0 +--- + +# Remove-AzContainerServiceMaintenanceConfiguration + +## SYNOPSIS +Deletes a maintenance configuration. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzContainerServiceMaintenanceConfiguration -ConfigName -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzContainerServiceMaintenanceConfiguration -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes a maintenance configuration. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -ConfigName +The name of the maintenance configuration. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..27135d8343a9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceManagedCluster.md @@ -0,0 +1,257 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicemanagedcluster +schema: 2.0.0 +--- + +# Remove-AzContainerServiceManagedCluster + +## SYNOPSIS +Deletes a managed cluster. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzContainerServiceManagedCluster -ResourceGroupName -ResourceName + [-SubscriptionId ] [-IgnorePodDisruptionBudget] [-IfMatch ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzContainerServiceManagedCluster -InputObject [-IgnorePodDisruptionBudget] + [-IfMatch ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Deletes a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The request should only proceed if an entity matches this string. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IgnorePodDisruptionBudget +ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceManagedClusterSnapshot.md b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceManagedClusterSnapshot.md new file mode 100644 index 000000000000..ee8bb74e06c6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceManagedClusterSnapshot.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicemanagedclustersnapshot +schema: 2.0.0 +--- + +# Remove-AzContainerServiceManagedClusterSnapshot + +## SYNOPSIS +Deletes a managed cluster snapshot. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzContainerServiceManagedClusterSnapshot -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzContainerServiceManagedClusterSnapshot -InputObject + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes a managed cluster snapshot. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServicePrivateEndpointConnection.md b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServicePrivateEndpointConnection.md new file mode 100644 index 000000000000..ae99c1003bf3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServicePrivateEndpointConnection.md @@ -0,0 +1,241 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceprivateendpointconnection +schema: 2.0.0 +--- + +# Remove-AzContainerServicePrivateEndpointConnection + +## SYNOPSIS +Deletes a private endpoint connection. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzContainerServicePrivateEndpointConnection -Name -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzContainerServicePrivateEndpointConnection -InputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes a private endpoint connection. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the private endpoint connection. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: PrivateEndpointConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceSnapshot.md b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceSnapshot.md new file mode 100644 index 000000000000..4e16892685a8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceSnapshot.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicesnapshot +schema: 2.0.0 +--- + +# Remove-AzContainerServiceSnapshot + +## SYNOPSIS +Deletes a snapshot. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzContainerServiceSnapshot -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzContainerServiceSnapshot -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes a snapshot. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceTrustedAccessRoleBinding.md b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceTrustedAccessRoleBinding.md new file mode 100644 index 000000000000..96a22f02d757 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Remove-AzContainerServiceTrustedAccessRoleBinding.md @@ -0,0 +1,241 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicetrustedaccessrolebinding +schema: 2.0.0 +--- + +# Remove-AzContainerServiceTrustedAccessRoleBinding + +## SYNOPSIS +Delete a trusted access role binding. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzContainerServiceTrustedAccessRoleBinding -Name -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzContainerServiceTrustedAccessRoleBinding -InputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a trusted access role binding. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of trusted access role binding. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: TrustedAccessRoleBindingName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Reset-AzContainerServiceManagedClusterAadProfile.md b/swaggerci/containerservice.DefaultTag/docs/Reset-AzContainerServiceManagedClusterAadProfile.md new file mode 100644 index 000000000000..d083a41cdbac --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Reset-AzContainerServiceManagedClusterAadProfile.md @@ -0,0 +1,372 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/reset-azcontainerservicemanagedclusteraadprofile +schema: 2.0.0 +--- + +# Reset-AzContainerServiceManagedClusterAadProfile + +## SYNOPSIS +**WARNING**: This API will be deprecated. +Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. + +## SYNTAX + +### ResetExpanded (Default) +``` +Reset-AzContainerServiceManagedClusterAadProfile -ResourceGroupName -ResourceName + [-SubscriptionId ] [-AdminGroupObjectID ] [-ClientAppId ] [-EnableAzureRbac] + [-Managed] [-ServerAppId ] [-ServerAppSecret ] [-TenantId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Reset +``` +Reset-AzContainerServiceManagedClusterAadProfile -ResourceGroupName -ResourceName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ResetViaIdentity +``` +Reset-AzContainerServiceManagedClusterAadProfile -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### ResetViaIdentityExpanded +``` +Reset-AzContainerServiceManagedClusterAadProfile -InputObject + [-AdminGroupObjectID ] [-ClientAppId ] [-EnableAzureRbac] [-Managed] + [-ServerAppId ] [-ServerAppSecret ] [-TenantId ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +**WARNING**: This API will be deprecated. +Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AdminGroupObjectID +The list of AAD group object IDs that will have admin role of the cluster. + +```yaml +Type: System.String[] +Parameter Sets: ResetExpanded, ResetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClientAppId +(DEPRECATED) The client AAD application ID. +Learn more at https://aka.ms/aks/aad-legacy. + +```yaml +Type: System.String +Parameter Sets: ResetExpanded, ResetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableAzureRbac +Whether to enable Azure RBAC for Kubernetes authorization. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: ResetExpanded, ResetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: ResetViaIdentity, ResetViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Managed +Whether to enable managed AAD. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: ResetExpanded, ResetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile +Parameter Sets: Reset, ResetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Reset, ResetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Reset, ResetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServerAppId +(DEPRECATED) The server AAD application ID. +Learn more at https://aka.ms/aks/aad-legacy. + +```yaml +Type: System.String +Parameter Sets: ResetExpanded, ResetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServerAppSecret +(DEPRECATED) The server AAD application secret. +Learn more at https://aka.ms/aks/aad-legacy. + +```yaml +Type: System.String +Parameter Sets: ResetExpanded, ResetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Reset, ResetExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TenantId +The AAD tenant ID to use for authentication. +If not specified, will use the tenant of the deployment subscription. + +```yaml +Type: System.String +Parameter Sets: ResetExpanded, ResetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.md b/swaggerci/containerservice.DefaultTag/docs/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.md new file mode 100644 index 000000000000..4f486550538b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.md @@ -0,0 +1,289 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/reset-azcontainerservicemanagedclusterserviceprincipalprofile +schema: 2.0.0 +--- + +# Reset-AzContainerServiceManagedClusterServicePrincipalProfile + +## SYNOPSIS +This action cannot be performed on a cluster that is not using a service principal + +## SYNTAX + +### ResetExpanded (Default) +``` +Reset-AzContainerServiceManagedClusterServicePrincipalProfile -ResourceGroupName + -ResourceName -ClientId [-SubscriptionId ] [-Secret ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Reset +``` +Reset-AzContainerServiceManagedClusterServicePrincipalProfile -ResourceGroupName + -ResourceName -Parameter [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ResetViaIdentity +``` +Reset-AzContainerServiceManagedClusterServicePrincipalProfile -InputObject + -Parameter [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ResetViaIdentityExpanded +``` +Reset-AzContainerServiceManagedClusterServicePrincipalProfile -InputObject + -ClientId [-Secret ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +This action cannot be performed on a cluster that is not using a service principal + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClientId +The ID for the service principal. + +```yaml +Type: System.String +Parameter Sets: ResetExpanded, ResetViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: ResetViaIdentity, ResetViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Information about a service principal identity for the cluster to use for manipulating Azure APIs. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile +Parameter Sets: Reset, ResetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Reset, ResetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Reset, ResetExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Secret +The secret password associated with the service principal in plain text. + +```yaml +Type: System.String +Parameter Sets: ResetExpanded, ResetViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Reset, ResetExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Start-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/docs/Start-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..853239b18b25 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Start-AzContainerServiceManagedCluster.md @@ -0,0 +1,226 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/start-azcontainerservicemanagedcluster +schema: 2.0.0 +--- + +# Start-AzContainerServiceManagedCluster + +## SYNOPSIS +See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + +## SYNTAX + +### Start (Default) +``` +Start-AzContainerServiceManagedCluster -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### StartViaIdentity +``` +Start-AzContainerServiceManagedCluster -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: StartViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Start +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Start +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Start +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Start-AzContainerServiceManagedClusterCommand.md b/swaggerci/containerservice.DefaultTag/docs/Start-AzContainerServiceManagedClusterCommand.md new file mode 100644 index 000000000000..ed69a316da5e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Start-AzContainerServiceManagedClusterCommand.md @@ -0,0 +1,293 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/start-azcontainerservicemanagedclustercommand +schema: 2.0.0 +--- + +# Start-AzContainerServiceManagedClusterCommand + +## SYNOPSIS +AKS will create a pod to run the command. +This is primarily useful for private clusters. +For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + +## SYNTAX + +### RunExpanded (Default) +``` +Start-AzContainerServiceManagedClusterCommand -ResourceGroupName -ResourceName + -Command [-SubscriptionId ] [-ClusterToken ] [-Context ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### Run +``` +Start-AzContainerServiceManagedClusterCommand -ResourceGroupName -ResourceName + -RequestPayload [-SubscriptionId ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### RunViaIdentity +``` +Start-AzContainerServiceManagedClusterCommand -InputObject + -RequestPayload [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### RunViaIdentityExpanded +``` +Start-AzContainerServiceManagedClusterCommand -InputObject -Command + [-ClusterToken ] [-Context ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +AKS will create a pod to run the command. +This is primarily useful for private clusters. +For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterToken +AuthToken issued for AKS AAD Server App. + +```yaml +Type: System.String +Parameter Sets: RunExpanded, RunViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Command +The command to run. + +```yaml +Type: System.String +Parameter Sets: RunExpanded, RunViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Context +A base64 encoded zip file containing the files required by the command. + +```yaml +Type: System.String +Parameter Sets: RunExpanded, RunViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: RunViaIdentity, RunViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestPayload +A run command request +To construct, see NOTES section for REQUESTPAYLOAD properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest +Parameter Sets: Run, RunViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Run, RunExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Run, RunExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Run, RunExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Stop-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/docs/Stop-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..1ab5c232bce2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Stop-AzContainerServiceManagedCluster.md @@ -0,0 +1,232 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/stop-azcontainerservicemanagedcluster +schema: 2.0.0 +--- + +# Stop-AzContainerServiceManagedCluster + +## SYNOPSIS +This can only be performed on Azure Virtual Machine Scale set backed clusters. +Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. +A cluster does not accrue charges while it is stopped. +See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + +## SYNTAX + +### Stop (Default) +``` +Stop-AzContainerServiceManagedCluster -ResourceGroupName -ResourceName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### StopViaIdentity +``` +Stop-AzContainerServiceManagedCluster -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +This can only be performed on Azure Virtual Machine Scale set backed clusters. +Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. +A cluster does not accrue charges while it is stopped. +See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: StopViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Stop +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Stop +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Stop +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceAgentPoolNodeImageVersion.md b/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceAgentPoolNodeImageVersion.md new file mode 100644 index 000000000000..d1f9e8e527e3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceAgentPoolNodeImageVersion.md @@ -0,0 +1,245 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerserviceagentpoolnodeimageversion +schema: 2.0.0 +--- + +# Update-AzContainerServiceAgentPoolNodeImageVersion + +## SYNOPSIS +Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. +AKS provides one new image per week with the latest updates. +For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + +## SYNTAX + +### Upgrade (Default) +``` +Update-AzContainerServiceAgentPoolNodeImageVersion -AgentPoolName -ResourceGroupName + -ResourceName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### UpgradeViaIdentity +``` +Update-AzContainerServiceAgentPoolNodeImageVersion -InputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. +AKS provides one new image per week with the latest updates. +For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AgentPoolName +The name of the agent pool. + +```yaml +Type: System.String +Parameter Sets: Upgrade +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: UpgradeViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Upgrade +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: Upgrade +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Upgrade +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceManagedClusterSnapshotTag.md b/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceManagedClusterSnapshotTag.md new file mode 100644 index 000000000000..3282b44043e0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceManagedClusterSnapshotTag.md @@ -0,0 +1,196 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerservicemanagedclustersnapshottag +schema: 2.0.0 +--- + +# Update-AzContainerServiceManagedClusterSnapshotTag + +## SYNOPSIS +Updates tags on a managed cluster snapshot. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzContainerServiceManagedClusterSnapshotTag -ResourceGroupName -ResourceName + [-SubscriptionId ] [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzContainerServiceManagedClusterSnapshotTag -InputObject [-Tag ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates tags on a managed cluster snapshot. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceManagedClusterTag.md b/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceManagedClusterTag.md new file mode 100644 index 000000000000..9a3591260b53 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceManagedClusterTag.md @@ -0,0 +1,241 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerservicemanagedclustertag +schema: 2.0.0 +--- + +# Update-AzContainerServiceManagedClusterTag + +## SYNOPSIS +Updates tags on a managed cluster. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzContainerServiceManagedClusterTag -ResourceGroupName -ResourceName + [-SubscriptionId ] [-IfMatch ] [-Tag ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzContainerServiceManagedClusterTag -InputObject [-IfMatch ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates tags on a managed cluster. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The request should only proceed if an entity matches this string. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceSnapshotTag.md b/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceSnapshotTag.md new file mode 100644 index 000000000000..0949cd1adb20 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/docs/Update-AzContainerServiceSnapshotTag.md @@ -0,0 +1,196 @@ +--- +external help file: +Module Name: Az.ContainerService +online version: https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerservicesnapshottag +schema: 2.0.0 +--- + +# Update-AzContainerServiceSnapshotTag + +## SYNOPSIS +Updates tags on a snapshot. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzContainerServiceSnapshotTag -ResourceGroupName -ResourceName + [-SubscriptionId ] [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzContainerServiceSnapshotTag -InputObject [-Tag ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates tags on a snapshot. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceName +The name of the managed cluster resource. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot + +## NOTES + +## RELATED LINKS + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceAgentPool.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceAgentPool.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceAgentPool.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceAgentPoolUpgradeProfile.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceAgentPoolUpgradeProfile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceAgentPoolUpgradeProfile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceLoadBalancer.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceLoadBalancer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceLoadBalancer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceMachine.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceMachine.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceMachine.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceMaintenanceConfiguration.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceMaintenanceConfiguration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceMaintenanceConfiguration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedCluster.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterAccessProfile.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterAccessProfile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterAccessProfile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterAdminCredentials.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterAdminCredentials.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterAdminCredentials.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterCommandResult.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterCommandResult.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterCommandResult.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterGuardrailVersion.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterGuardrailVersion.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterGuardrailVersion.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterKuberneteVersion.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterKuberneteVersion.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterKuberneteVersion.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterMeshRevisionProfile.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterMeshRevisionProfile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterMeshRevisionProfile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterOSOption.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterOSOption.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterOSOption.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterSafeguardVersion.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterSafeguardVersion.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterSafeguardVersion.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterSnapshot.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterSnapshot.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterSnapshot.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterUpgradeProfile.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterUpgradeProfile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterUpgradeProfile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterUserCredentials.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterUserCredentials.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceManagedClusterUserCredentials.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceOperationStatusResult.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceOperationStatusResult.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceOperationStatusResult.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServicePrivateEndpointConnection.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServicePrivateEndpointConnection.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServicePrivateEndpointConnection.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServicePrivateLinkResource.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServicePrivateLinkResource.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServicePrivateLinkResource.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceSnapshot.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceSnapshot.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceSnapshot.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceTrustedAccessRole.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceTrustedAccessRole.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceTrustedAccessRole.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceTrustedAccessRoleBinding.md b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceTrustedAccessRoleBinding.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Get-AzContainerServiceTrustedAccessRoleBinding.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Import-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/examples/Import-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Import-AzContainerServiceManagedCluster.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.md b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.md b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceResolvePrivateLinkServiceId.md b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceResolvePrivateLinkServiceId.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceResolvePrivateLinkServiceId.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceRotateManagedClusterCertificate.md b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceRotateManagedClusterCertificate.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceRotateManagedClusterCertificate.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.md b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceAgentPool.md b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceAgentPool.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceAgentPool.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceLoadBalancer.md b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceLoadBalancer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceLoadBalancer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceMaintenanceConfiguration.md b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceMaintenanceConfiguration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceMaintenanceConfiguration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceManagedCluster.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceManagedClusterSnapshot.md b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceManagedClusterSnapshot.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceManagedClusterSnapshot.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceSnapshot.md b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceSnapshot.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceSnapshot.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceTrustedAccessRoleBinding.md b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceTrustedAccessRoleBinding.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/New-AzContainerServiceTrustedAccessRoleBinding.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceAgentPool.md b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceAgentPool.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceAgentPool.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceAgentPoolMachine.md b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceAgentPoolMachine.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceAgentPoolMachine.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceLoadBalancer.md b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceLoadBalancer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceLoadBalancer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceMaintenanceConfiguration.md b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceMaintenanceConfiguration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceMaintenanceConfiguration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceManagedCluster.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceManagedClusterSnapshot.md b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceManagedClusterSnapshot.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceManagedClusterSnapshot.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServicePrivateEndpointConnection.md b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServicePrivateEndpointConnection.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServicePrivateEndpointConnection.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceSnapshot.md b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceSnapshot.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceSnapshot.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceTrustedAccessRoleBinding.md b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceTrustedAccessRoleBinding.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Remove-AzContainerServiceTrustedAccessRoleBinding.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Reset-AzContainerServiceManagedClusterAadProfile.md b/swaggerci/containerservice.DefaultTag/examples/Reset-AzContainerServiceManagedClusterAadProfile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Reset-AzContainerServiceManagedClusterAadProfile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.md b/swaggerci/containerservice.DefaultTag/examples/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Start-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/examples/Start-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Start-AzContainerServiceManagedCluster.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Start-AzContainerServiceManagedClusterCommand.md b/swaggerci/containerservice.DefaultTag/examples/Start-AzContainerServiceManagedClusterCommand.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Start-AzContainerServiceManagedClusterCommand.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Stop-AzContainerServiceManagedCluster.md b/swaggerci/containerservice.DefaultTag/examples/Stop-AzContainerServiceManagedCluster.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Stop-AzContainerServiceManagedCluster.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceAgentPoolNodeImageVersion.md b/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceAgentPoolNodeImageVersion.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceAgentPoolNodeImageVersion.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceManagedClusterSnapshotTag.md b/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceManagedClusterSnapshotTag.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceManagedClusterSnapshotTag.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceManagedClusterTag.md b/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceManagedClusterTag.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceManagedClusterTag.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceSnapshotTag.md b/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceSnapshotTag.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/examples/Update-AzContainerServiceSnapshotTag.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/containerservice.DefaultTag/export-surface.ps1 b/swaggerci/containerservice.DefaultTag/export-surface.ps1 new file mode 100644 index 000000000000..4eda54472506 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/export-surface.ps1 @@ -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. +# 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]$IncludeGeneralParameters, [switch]$UseExpandedFormat) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.ContainerService.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} +$null = Import-Module -Name $dll + +$moduleName = 'Az.ContainerService' +$exportsFolder = Join-Path $PSScriptRoot 'exports' +$resourcesFolder = Join-Path $PSScriptRoot 'resources' + +Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'" + +Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'" + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceAgentPool.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceAgentPool.ps1 new file mode 100644 index 000000000000..096c82c17569 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceAgentPool.ps1 @@ -0,0 +1,226 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the specified managed cluster agent pool. +.Description +Gets the specified managed cluster agent pool. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceagentpool +#> +function Get-AzContainerServiceAgentPool { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AgentPoolName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceAgentPool_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceAgentPool_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceAgentPool_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.ps1 new file mode 100644 index 000000000000..9a1f0f9552e9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. +.Description +See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceagentpoolavailableagentpoolversion +#> +function Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceAgentPoolUpgradeProfile.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceAgentPoolUpgradeProfile.ps1 new file mode 100644 index 000000000000..5c1852eafc37 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceAgentPoolUpgradeProfile.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the upgrade profile for an agent pool. +.Description +Gets the upgrade profile for an agent pool. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceagentpoolupgradeprofile +#> +function Get-AzContainerServiceAgentPoolUpgradeProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceAgentPoolUpgradeProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceAgentPoolUpgradeProfile_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceLoadBalancer.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceLoadBalancer.ps1 new file mode 100644 index 000000000000..3247a60a2edb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceLoadBalancer.ps1 @@ -0,0 +1,226 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the specified load balancer. +.Description +Gets the specified load balancer. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceloadbalancer +#> +function Get-AzContainerServiceLoadBalancer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('LoadBalancerName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the load balancer. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceLoadBalancer_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceLoadBalancer_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceLoadBalancer_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceMachine.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceMachine.ps1 new file mode 100644 index 000000000000..9bae2f1691b7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceMachine.ps1 @@ -0,0 +1,233 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get a specific machine in the specified agent pool. +.Description +Get a specific machine in the specified agent pool. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemachine +#> +function Get-AzContainerServiceMachine { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('MachineName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # host name of the machine + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceMachine_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceMachine_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceMachine_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceMaintenanceConfiguration.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceMaintenanceConfiguration.ps1 new file mode 100644 index 000000000000..c3c42d78e707 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceMaintenanceConfiguration.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the specified maintenance configuration of a managed cluster. +.Description +Gets the specified maintenance configuration of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemaintenanceconfiguration +#> +function Get-AzContainerServiceMaintenanceConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the maintenance configuration. + ${ConfigName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceMaintenanceConfiguration_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceMaintenanceConfiguration_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceMaintenanceConfiguration_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedCluster.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedCluster.ps1 new file mode 100644 index 000000000000..96b362440962 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedCluster.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a managed cluster. +.Description +Gets a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedcluster +#> +function Get-AzContainerServiceManagedCluster { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedCluster_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedCluster_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedCluster_List'; + List1 = 'Az.ContainerService.private\Get-AzContainerServiceManagedCluster_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterAccessProfile.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterAccessProfile.ps1 new file mode 100644 index 000000000000..757f896f2bb6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterAccessProfile.ps1 @@ -0,0 +1,223 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +**WARNING**: This API will be deprecated. +Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . +.Description +**WARNING**: This API will be deprecated. +Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusteraccessprofile +#> +function Get-AzContainerServiceManagedClusterAccessProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the role for managed cluster accessProfile resource. + ${RoleName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterAccessProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterAccessProfile_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterAdminCredentials.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterAdminCredentials.ps1 new file mode 100644 index 000000000000..d849a70ce104 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterAdminCredentials.ps1 @@ -0,0 +1,189 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the admin credentials of a managed cluster. +.Description +Lists the admin credentials of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusteradmincredentials +#> +function Get-AzContainerServiceManagedClusterAdminCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.String] + # server fqdn type for credentials to be returned + ${ServerFqdn}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterAdminCredentials_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterCommandResult.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterCommandResult.ps1 new file mode 100644 index 000000000000..c6f988b6ee82 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterCommandResult.ps1 @@ -0,0 +1,227 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the results of a command which has been run on the Managed Cluster. +.Description +Gets the results of a command which has been run on the Managed Cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustercommandresult +#> +function Get-AzContainerServiceManagedClusterCommandResult { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # Id of the command. + ${CommandId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterCommandResult_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterCommandResult_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterGuardrailVersion.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterGuardrailVersion.ps1 new file mode 100644 index 000000000000..5fda14ccd6c1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterGuardrailVersion.ps1 @@ -0,0 +1,217 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Contains Guardrails version along with its support info and whether it is a default version. +.Description +Contains Guardrails version along with its support info and whether it is a default version. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterguardrailversion +#> +function Get-AzContainerServiceManagedClusterGuardrailVersion { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # Safeguards version + ${Version}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterGuardrailVersion_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterGuardrailVersion_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterGuardrailVersion_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterKuberneteVersion.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterKuberneteVersion.ps1 new file mode 100644 index 000000000000..685d93f55957 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterKuberneteVersion.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version +.Description +Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterkuberneteversion +#> +function Get-AzContainerServiceManagedClusterKuberneteVersion { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterKuberneteVersion_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterMeshRevisionProfile.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterMeshRevisionProfile.ps1 new file mode 100644 index 000000000000..5e928081bc56 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterMeshRevisionProfile.ps1 @@ -0,0 +1,217 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades +.Description +Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustermeshrevisionprofile +#> +function Get-AzContainerServiceManagedClusterMeshRevisionProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The mode of the mesh. + ${Mode}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshRevisionProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshRevisionProfile_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshRevisionProfile_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.ps1 new file mode 100644 index 000000000000..98e31cb8aa97 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets available upgrades for a service mesh in a cluster. +.Description +Gets available upgrades for a service mesh in a cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustermeshupgradeprofile +#> +function Get-AzContainerServiceManagedClusterMeshUpgradeProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The mode of the mesh. + ${Mode}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshUpgradeProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshUpgradeProfile_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshUpgradeProfile_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.ps1 new file mode 100644 index 000000000000..9ef6bf340c8f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.ps1 @@ -0,0 +1,189 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the cluster monitoring user credentials of a managed cluster. +.Description +Lists the cluster monitoring user credentials of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustermonitoringusercredentials +#> +function Get-AzContainerServiceManagedClusterMonitoringUserCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.String] + # server fqdn type for credentials to be returned + ${ServerFqdn}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMonitoringUserCredentials_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterOSOption.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterOSOption.ps1 new file mode 100644 index 000000000000..0fb25823989f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterOSOption.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets supported OS options in the specified subscription. +.Description +Gets supported OS options in the specified subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterosoption +#> +function Get-AzContainerServiceManagedClusterOSOption { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.String] + # The resource type for which the OS options needs to be returned + ${ResourceType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterOSOption_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterOSOption_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.ps1 new file mode 100644 index 000000000000..6aa492f3e30d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. +The operation returns properties of each egress endpoint. +.Description +Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. +The operation returns properties of each egress endpoint. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusteroutboundnetworkdependencyendpoint +#> +function Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterSafeguardVersion.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterSafeguardVersion.ps1 new file mode 100644 index 000000000000..dbe1fa82eccc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterSafeguardVersion.ps1 @@ -0,0 +1,217 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Contains Safeguards version along with its support info and whether it is a default version. +.Description +Contains Safeguards version along with its support info and whether it is a default version. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustersafeguardversion +#> +function Get-AzContainerServiceManagedClusterSafeguardVersion { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # Safeguards version + ${Version}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSafeguardVersion_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSafeguardVersion_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSafeguardVersion_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterSnapshot.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterSnapshot.ps1 new file mode 100644 index 000000000000..1745099bd7d2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterSnapshot.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a managed cluster snapshot. +.Description +Gets a managed cluster snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustersnapshot +#> +function Get-AzContainerServiceManagedClusterSnapshot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSnapshot_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSnapshot_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSnapshot_List'; + List1 = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSnapshot_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterUpgradeProfile.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterUpgradeProfile.ps1 new file mode 100644 index 000000000000..b17e9e909981 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterUpgradeProfile.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the upgrade profile of a managed cluster. +.Description +Gets the upgrade profile of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterupgradeprofile +#> +function Get-AzContainerServiceManagedClusterUpgradeProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterUpgradeProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterUpgradeProfile_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterUserCredentials.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterUserCredentials.ps1 new file mode 100644 index 000000000000..af191ffdef18 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceManagedClusterUserCredentials.ps1 @@ -0,0 +1,197 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the user credentials of a managed cluster. +.Description +Lists the user credentials of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterusercredentials +#> +function Get-AzContainerServiceManagedClusterUserCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format] + # Only apply to AAD clusters, specifies the format of returned kubeconfig. + # Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. + ${Format}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.String] + # server fqdn type for credentials to be returned + ${ServerFqdn}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterUserCredentials_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceOperationStatusResult.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceOperationStatusResult.ps1 new file mode 100644 index 000000000000..55766c7b2bfe --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceOperationStatusResult.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the status of a specific operation in the specified managed cluster. +.Description +Get the status of a specific operation in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceoperationstatusresult +#> +function Get-AzContainerServiceOperationStatusResult { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The ID of an ongoing async operation. + ${OperationId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='Get1')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_Get'; + Get1 = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_Get1'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_GetViaIdentity'; + GetViaIdentity1 = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_GetViaIdentity1'; + List = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_List'; + } + if (('Get', 'Get1', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServicePrivateEndpointConnection.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServicePrivateEndpointConnection.ps1 new file mode 100644 index 000000000000..35e8277add98 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServicePrivateEndpointConnection.ps1 @@ -0,0 +1,226 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +.Description +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceprivateendpointconnection +#> +function Get-AzContainerServicePrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the private endpoint connection. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServicePrivateEndpointConnection_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServicePrivateEndpointConnection_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServicePrivateEndpointConnection_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServicePrivateLinkResource.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServicePrivateLinkResource.ps1 new file mode 100644 index 000000000000..3e52d07a997d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServicePrivateLinkResource.ps1 @@ -0,0 +1,183 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +.Description +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceprivatelinkresource +#> +function Get-AzContainerServicePrivateLinkResource { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServicePrivateLinkResource_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceSnapshot.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceSnapshot.ps1 new file mode 100644 index 000000000000..8b01a7649304 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceSnapshot.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a snapshot. +.Description +Gets a snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicesnapshot +#> +function Get-AzContainerServiceSnapshot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceSnapshot_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceSnapshot_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceSnapshot_List'; + List1 = 'Az.ContainerService.private\Get-AzContainerServiceSnapshot_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceTrustedAccessRole.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceTrustedAccessRole.ps1 new file mode 100644 index 000000000000..86215de3034f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceTrustedAccessRole.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List supported trusted access roles. +.Description +List supported trusted access roles. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicetrustedaccessrole +#> +function Get-AzContainerServiceTrustedAccessRole { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceTrustedAccessRole_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceTrustedAccessRoleBinding.ps1 b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceTrustedAccessRoleBinding.ps1 new file mode 100644 index 000000000000..6a18cff4e36a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Get-AzContainerServiceTrustedAccessRoleBinding.ps1 @@ -0,0 +1,226 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get a trusted access role binding. +.Description +Get a trusted access role binding. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicetrustedaccessrolebinding +#> +function Get-AzContainerServiceTrustedAccessRoleBinding { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TrustedAccessRoleBindingName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of trusted access role binding. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceTrustedAccessRoleBinding_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceTrustedAccessRoleBinding_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceTrustedAccessRoleBinding_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Import-AzContainerServiceManagedCluster.ps1 b/swaggerci/containerservice.DefaultTag/exports/Import-AzContainerServiceManagedCluster.ps1 new file mode 100644 index 000000000000..ac2cddb5a2b4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Import-AzContainerServiceManagedCluster.ps1 @@ -0,0 +1,255 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Rebalance nodes across specific load balancers. +.Description +Rebalance nodes across specific load balancers. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +PARAMETER : The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + [LoadBalancerName ]: The load balancer names list. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/import-azcontainerservicemanagedcluster +#> +function Import-AzContainerServiceManagedCluster { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='LoadExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Load', Mandatory)] + [Parameter(ParameterSetName='LoadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Load', Mandatory)] + [Parameter(ParameterSetName='LoadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Load')] + [Parameter(ParameterSetName='LoadExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='LoadViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LoadViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Load', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LoadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody] + # The names of the load balancers to rebalance. + # If set to empty, all load balancers will be rebalanced. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='LoadExpanded')] + [Parameter(ParameterSetName='LoadViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The load balancer names list. + ${LoadBalancerName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Load = 'Az.ContainerService.private\Import-AzContainerServiceManagedCluster_Load'; + LoadExpanded = 'Az.ContainerService.private\Import-AzContainerServiceManagedCluster_LoadExpanded'; + LoadViaIdentity = 'Az.ContainerService.private\Import-AzContainerServiceManagedCluster_LoadViaIdentity'; + LoadViaIdentityExpanded = 'Az.ContainerService.private\Import-AzContainerServiceManagedCluster_LoadViaIdentityExpanded'; + } + if (('Load', 'LoadExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.ps1 b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.ps1 new file mode 100644 index 000000000000..1b7541eec77a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.ps1 @@ -0,0 +1,243 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Aborts the currently running operation on the agent pool. +The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. +.Description +Aborts the currently running operation on the agent pool. +The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerserviceabortagentpoollatestoperation +#> +function Invoke-AzContainerServiceAbortAgentPoolLatestOperation { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Abort', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Abort')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='AbortViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Abort = 'Az.ContainerService.private\Invoke-AzContainerServiceAbortAgentPoolLatestOperation_Abort'; + AbortViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity'; + } + if (('Abort') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.ps1 b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.ps1 new file mode 100644 index 000000000000..10d681ccab06 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Aborts the currently running operation on the managed cluster. +The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. +.Description +Aborts the currently running operation on the managed cluster. +The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerserviceabortmanagedclusterlatestoperation +#> +function Invoke-AzContainerServiceAbortManagedClusterLatestOperation { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Abort', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Abort')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='AbortViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Abort = 'Az.ContainerService.private\Invoke-AzContainerServiceAbortManagedClusterLatestOperation_Abort'; + AbortViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity'; + } + if (('Abort') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceResolvePrivateLinkServiceId.ps1 b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceResolvePrivateLinkServiceId.ps1 new file mode 100644 index 000000000000..151f38399b5d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceResolvePrivateLinkServiceId.ps1 @@ -0,0 +1,274 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the private link service ID for the specified managed cluster. +.Description +Gets the private link service ID for the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +PARAMETER : A private link resource + [GroupId ]: The group ID of the resource. + [Id ]: The ID of the private link resource. + [Name ]: The name of the private link resource. + [RequiredMember ]: The RequiredMembers of the resource + [Type ]: The resource type. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerserviceresolveprivatelinkserviceid +#> +function Invoke-AzContainerServiceResolvePrivateLinkServiceId { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource])] +[CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Post', Mandatory)] + [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Post', Mandatory)] + [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Post')] + [Parameter(ParameterSetName='PostExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource] + # A private link resource + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The group ID of the resource. + ${GroupId}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ID of the private link resource. + ${Id}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The name of the private link resource. + ${Name}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The RequiredMembers of the resource + ${RequiredMember}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The resource type. + ${Type}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Post = 'Az.ContainerService.private\Invoke-AzContainerServiceResolvePrivateLinkServiceId_Post'; + PostExpanded = 'Az.ContainerService.private\Invoke-AzContainerServiceResolvePrivateLinkServiceId_PostExpanded'; + PostViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceResolvePrivateLinkServiceId_PostViaIdentity'; + PostViaIdentityExpanded = 'Az.ContainerService.private\Invoke-AzContainerServiceResolvePrivateLinkServiceId_PostViaIdentityExpanded'; + } + if (('Post', 'PostExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceRotateManagedClusterCertificate.ps1 b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceRotateManagedClusterCertificate.ps1 new file mode 100644 index 000000000000..3483c02ef69a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceRotateManagedClusterCertificate.ps1 @@ -0,0 +1,233 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. +.Description +See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerservicerotatemanagedclustercertificate +#> +function Invoke-AzContainerServiceRotateManagedClusterCertificate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Rotate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Rotate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Rotate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Rotate')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RotateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Rotate = 'Az.ContainerService.private\Invoke-AzContainerServiceRotateManagedClusterCertificate_Rotate'; + RotateViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity'; + } + if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.ps1 b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.ps1 new file mode 100644 index 000000000000..281049a0cce1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.ps1 @@ -0,0 +1,233 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Rotates the service account signing keys of a managed cluster. +.Description +Rotates the service account signing keys of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerservicerotatemanagedclusterserviceaccountsigningkey +#> +function Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Rotate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Rotate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Rotate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Rotate')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RotateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Rotate = 'Az.ContainerService.private\Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate'; + RotateViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity'; + } + if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceAgentPool.ps1 b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceAgentPool.ps1 new file mode 100644 index 000000000000..3e776f7947a5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceAgentPool.ps1 @@ -0,0 +1,820 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates an agent pool in the specified managed cluster. +.Description +Creates or updates an agent pool in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool +.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. + +LINUXOSCONFIGSYSCTL : Sysctl settings for Linux agent nodes. + [FsAioMaxNr ]: Sysctl setting fs.aio-max-nr. + [FsFileMax ]: Sysctl setting fs.file-max. + [FsInotifyMaxUserWatch ]: Sysctl setting fs.inotify.max_user_watches. + [FsNrOpen ]: Sysctl setting fs.nr_open. + [KernelThreadsMax ]: Sysctl setting kernel.threads-max. + [NetCoreNetdevMaxBacklog ]: Sysctl setting net.core.netdev_max_backlog. + [NetCoreOptmemMax ]: Sysctl setting net.core.optmem_max. + [NetCoreRmemDefault ]: Sysctl setting net.core.rmem_default. + [NetCoreRmemMax ]: Sysctl setting net.core.rmem_max. + [NetCoreSomaxconn ]: Sysctl setting net.core.somaxconn. + [NetCoreWmemDefault ]: Sysctl setting net.core.wmem_default. + [NetCoreWmemMax ]: Sysctl setting net.core.wmem_max. + [NetIpv4IPLocalPortRange ]: Sysctl setting net.ipv4.ip_local_port_range. + [NetIpv4NeighDefaultGcThresh1 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + [NetIpv4NeighDefaultGcThresh2 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + [NetIpv4NeighDefaultGcThresh3 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + [NetIpv4TcpFinTimeout ]: Sysctl setting net.ipv4.tcp_fin_timeout. + [NetIpv4TcpKeepaliveProbe ]: Sysctl setting net.ipv4.tcp_keepalive_probes. + [NetIpv4TcpKeepaliveTime ]: Sysctl setting net.ipv4.tcp_keepalive_time. + [NetIpv4TcpMaxSynBacklog ]: Sysctl setting net.ipv4.tcp_max_syn_backlog. + [NetIpv4TcpMaxTwBucket ]: Sysctl setting net.ipv4.tcp_max_tw_buckets. + [NetIpv4TcpTwReuse ]: Sysctl setting net.ipv4.tcp_tw_reuse. + [NetIpv4TcpkeepaliveIntvl ]: Sysctl setting net.ipv4.tcp_keepalive_intvl. + [NetNetfilterNfConntrackBucket ]: Sysctl setting net.netfilter.nf_conntrack_buckets. + [NetNetfilterNfConntrackMax ]: Sysctl setting net.netfilter.nf_conntrack_max. + [VMMaxMapCount ]: Sysctl setting vm.max_map_count. + [VMSwappiness ]: Sysctl setting vm.swappiness. + [VMVfsCachePressure ]: Sysctl setting vm.vfs_cache_pressure. + +NETWORKPROFILEALLOWEDHOSTPORT : The port ranges that are allowed to access. The specified ranges are allowed to overlap. + [PortEnd ]: The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. + [PortStart ]: The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. + [Protocol ]: The network protocol of the port. + +NETWORKPROFILENODEPUBLICIPTAG : IPTags of instance-level public IPs. + [Tag ]: The value of the IP tag associated with the public IP. Example: Internet. + [Type ]: The IP tag type. Example: RoutingPreference. + +SCALEAUTOSCALE : Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed. + [MaxCount ]: The maximum number of nodes of the specified sizes. + [MinCount ]: The minimum number of nodes of the specified sizes. + [Size ]: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when auto scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. + +SCALEMANUAL : Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed. + [Count ]: Number of nodes. + [Size ]: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. + +VIRTUALMACHINENODESSTATUS : The status of nodes in a VirtualMachines agent pool. + [Count ]: Number of nodes. + [Size ]: The VM size of the agents used to host this group of nodes. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerserviceagentpool +#> +function New-AzContainerServiceAgentPool { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('AgentPoolName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if no entity matches this string. + ${IfNoneMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. + # To use this feature, container images must also enable artifact streaming on ACR. + # If not specified, the default is false. + ${ArtifactStreamingProfileEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The list of Availability zones to use for nodes. + # This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + ${AvailabilityZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # AKS will associate the specified agent pool with the Capacity Reservation Group. + ${CapacityReservationGroupId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Number of agents (VMs) to host docker containers. + # Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. + # The default value is 1. + ${Count}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is the ARM ID of the source object to be used to create the target object. + ${CreationDataSourceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable auto-scaler + ${EnableAutoScaling}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node trust stores. + # Defaults to false. + ${EnableCustomCaTrust}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This is only supported on certain VM sizes and in certain Azure regions. + # For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + ${EnableEncryptionAtHost}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + ${EnableFips}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. + # A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + # For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + # The default is false. + ${EnableNodePublicIP}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable UltraSSD + ${EnableUltraSsd}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. + # The size of Public IPPrefix should be selected by the user. + # Each node in the agent pool is assigned with one IP from the IPPrefix. + # The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. + # Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). + # The default value is 31. + ${GatewayProfilePublicIPPrefixSize}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile] + # GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + ${GpuInstanceProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. + # GPU Driver Installation can only be set true when VM has an associated GPU resource. + # Setting this field to false prevents automatic GPU driver installation. + # In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + ${GpuProfileInstallGpuDriver}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + # For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + ${HostGroupId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + ${KubeletConfigAllowedUnsafeSysctl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum number of container log files that can be present for a container. + # The number must be ≥ 2. + ${KubeletConfigContainerLogMaxFile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum size (e.g. + # 10Mi) of container log file before it is rotated. + ${KubeletConfigContainerLogMaxSizeMb}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The default is true. + ${KubeletConfigCpuCfsQuota}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. + # For example: '300ms', '2h45m'. + # Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + ${KubeletConfigCpuCfsQuotaPeriod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is 'none'. + # See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. + # Allowed values are 'none' and 'static'. + ${KubeletConfigCpuManagerPolicy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true it will make the Kubelet fail to start if swap is enabled on the node. + ${KubeletConfigFailSwapOn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # To disable image garbage collection, set to 100. + # The default is 85% + ${KubeletConfigImageGcHighThreshold}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # This cannot be set higher than imageGcHighThreshold. + # The default is 80% + ${KubeletConfigImageGcLowThreshold}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum number of processes per pod. + ${KubeletConfigPodMaxPid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + # The default is 'none'. + # Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + ${KubeletConfigTopologyManagerPolicy}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType] + # Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + ${KubeletDiskType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The size in MB of a swap file that will be created on each node. + ${LinuxOSConfigSwapFileSizeMb}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig] + # Sysctl settings for Linux agent nodes. + # To construct, see NOTES section for LINUXOSCONFIGSYSCTL properties and create a hash table. + ${LinuxOSConfigSysctl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. + # The default is 'madvise'. + # For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + ${LinuxOSConfigTransparentHugePageDefrag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Valid values are 'always', 'madvise', and 'never'. + # The default is 'always'. + # For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + ${LinuxOSConfigTransparentHugePageEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum number of nodes for auto-scaling + ${MaxCount}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum number of pods that can run on a node. + ${MaxPod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # A base64-encoded string which will be written to /etc/motd after decoding. + # This allows customization of the message of the day for Linux nodes. + # It must not be specified for Windows nodes. + # It must be a static string (i.e., will be printed raw and not be executed as a script). + ${MessageOfTheDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The minimum number of nodes for auto-scaling + ${MinCount}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode] + # A cluster must have at least one 'System' Agent Pool at all times. + # For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + ${Mode}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]] + # The port ranges that are allowed to access. + # The specified ranges are allowed to overlap. + # To construct, see NOTES section for NETWORKPROFILEALLOWEDHOSTPORT properties and create a hash table. + ${NetworkProfileAllowedHostPort}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The IDs of the application security groups which agent pool will associate when created. + ${NetworkProfileApplicationSecurityGroup}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]] + # IPTags of instance-level public IPs. + # To construct, see NOTES section for NETWORKPROFILENODEPUBLICIPTAG properties and create a hash table. + ${NetworkProfileNodePublicIPTag}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # These taints will not be reconciled by AKS and can be removed with a kubectl call. + # This field can be modified after node pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + # node image upgrade) happens. + # These taints allow for required configuration to run before the node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + ${NodeInitializationTaint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels]))] + [System.Collections.Hashtable] + # The node labels to be persisted across all nodes in agent pool. + ${NodeLabel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + ${NodePublicIPPrefixId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The taints added to new nodes during node pool create and scale. + # For example, key=value:NoSchedule. + ${NodeTaint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. + # If you specify 0, it will apply the default osDisk size according to the vmSize specified. + ${OSDiskSizeGb}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType] + # The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. + # Otherwise, defaults to 'Managed'. + # May not be changed after creation. + # For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + ${OSDiskType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku] + # Specifies the OS SKU used by the agent pool. + # If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. + # And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + ${OSSku}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType] + # The operating system type. + # The default is Linux. + ${OSType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Both patch version and are supported. + # When is specified, the latest supported patch version is chosen automatically. + # Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. + # As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. + # The node pool version must have the same major version as the control plane. + # The node pool minor version must be within two minor versions of the control plane version. + # The node pool version cannot be greater than the control plane version. + # For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + ${OrchestratorVersion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode] + # The IP allocation mode for pods in the agent pool. + # Must be used with podSubnetId. + # The default is 'DynamicIndividual'. + ${PodIPAllocationMode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). + # This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + ${PodSubnetId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code] + # Tells whether the cluster is Running or Stopped + ${PowerStateCode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType] + # The type of Agent Pool. + ${PropertiesType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ID for Proximity Placement Group. + ${ProximityPlacementGroupId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]] + # Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. + # Currently, at most one AutoScaleProfile is allowed. + # To construct, see NOTES section for SCALEAUTOSCALE properties and create a hash table. + ${ScaleAutoscale}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode] + # This also effects the cluster autoscaler behavior. + # If not specified, it defaults to Delete. + ${ScaleDownMode}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]] + # Specifications on how to scale the VirtualMachines agent pool to a fixed size. + # Currently, at most one ManualScaleProfile is allowed. + # To construct, see NOTES section for SCALEMANUAL properties and create a hash table. + ${ScaleManual}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy] + # This cannot be specified unless the scaleSetPriority is 'Spot'. + # If not specified, the default is 'Delete'. + ${ScaleSetEvictionPolicy}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority] + # The Virtual Machine Scale Set priority. + # If not specified, the default is 'Regular'. + ${ScaleSetPriority}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. + # For more details, see aka.ms/aks/trustedlaunch. + # If not specified, the default is false. + ${SecurityProfileEnableSecureBoot}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. + # For more details, see aka.ms/aks/trustedlaunch. + # If not specified, the default is false. + ${SecurityProfileEnableVtpm}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess] + # SSH access method of an agent pool. + ${SecurityProfileSshAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Single] + # Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + # For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + ${SpotMaxPrice}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags]))] + [System.Collections.Hashtable] + # The tags to be persisted on the agent pool virtual machine scale set. + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. + # This eviction wait time honors waiting on pod disruption budgets. + # If this time is exceeded, the upgrade fails. + # If not specified, the default is 30 minutes. + ${UpgradeSettingDrainTimeoutInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # 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, the default is 1. + # For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + ${UpgradeSettingMaxSurge}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. + # If not specified, the default is 0 minutes. + ${UpgradeSettingNodeSoakDurationInMinute}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior] + # Defines the behavior for undrainable nodes during upgrade. + # The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + ${UpgradeSettingUndrainableNodeBehavior}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # VM size availability varies by region. + # If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. + # For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + ${VMSize}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[]] + # The status of nodes in a VirtualMachines agent pool. + # To construct, see NOTES section for VIRTUALMACHINENODESSTATUS properties and create a hash table. + ${VirtualMachineNodesStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # If this is not specified, a VNET and subnet will be generated and used. + # If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. + # This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + ${VnetSubnetId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The default value is false. + # Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + ${WindowProfileDisableOutboundNat}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime] + # Determines the type of workload a node can run. + ${WorkloadRuntime}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceAgentPool_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceLoadBalancer.ps1 b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceLoadBalancer.ps1 new file mode 100644 index 000000000000..8e840f89f7bf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceLoadBalancer.ps1 @@ -0,0 +1,291 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a load balancer in the specified managed cluster. +.Description +Creates or updates a load balancer in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer +.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. + +NODESELECTORMATCHEXPRESSION : matchExpressions is a list of label selector requirements. The requirements are ANDed. + [Key ]: key is the label key that the selector applies to. + [Operator ]: operator represents a key's relationship to a set of values. Valid operators are In and NotIn + [Value ]: values is an array of string values, the values array must be non-empty. + +SERVICELABELSELECTORMATCHEXPRESSION : matchExpressions is a list of label selector requirements. The requirements are ANDed. + [Key ]: key is the label key that the selector applies to. + [Operator ]: operator represents a key's relationship to a set of values. Valid operators are In and NotIn + [Value ]: values is an array of string values, the values array must be non-empty. + +SERVICENAMESPACESELECTORMATCHEXPRESSION : matchExpressions is a list of label selector requirements. The requirements are ANDed. + [Key ]: key is the label key that the selector applies to. + [Operator ]: operator represents a key's relationship to a set of values. Valid operators are In and NotIn + [Value ]: values is an array of string values, the values array must be non-empty. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerserviceloadbalancer +#> +function New-AzContainerServiceLoadBalancer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('LoadBalancerName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the load balancer. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to automatically place services on the load balancer. + # If not supplied, the default value is true. + # If set to false manually, both of the external and the internal load balancer will not be selected for services unless they explicitly target it. + ${AllowServicePlacement}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]] + # matchExpressions is a list of label selector requirements. + # The requirements are ANDed. + # To construct, see NOTES section for NODESELECTORMATCHEXPRESSION properties and create a hash table. + ${NodeSelectorMatchExpression}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # matchLabels is an array of {key=value} pairs. + # A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. + # The requirements are ANDed. + ${NodeSelectorMatchLabel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Required field. + # A string value that must specify the ID of an existing agent pool. + # All nodes in the given pool will always be added to this load balancer. + # This agent pool must have at least one node and minCount>=1 for autoscaling operations. + # An agent pool can only be the primary pool for a single load balancer. + ${PrimaryAgentPoolName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Name of the public load balancer. + # There will be an internal load balancer created if needed, and the name will be `-internal`. + # The internal lb shares the same configurations as the external one. + # The internal lbs are not needed to be included in LoadBalancer list. + # There must be a name of kubernetes in the list. + ${PropertiesName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]] + # matchExpressions is a list of label selector requirements. + # The requirements are ANDed. + # To construct, see NOTES section for SERVICELABELSELECTORMATCHEXPRESSION properties and create a hash table. + ${ServiceLabelSelectorMatchExpression}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # matchLabels is an array of {key=value} pairs. + # A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. + # The requirements are ANDed. + ${ServiceLabelSelectorMatchLabel}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]] + # matchExpressions is a list of label selector requirements. + # The requirements are ANDed. + # To construct, see NOTES section for SERVICENAMESPACESELECTORMATCHEXPRESSION properties and create a hash table. + ${ServiceNamespaceSelectorMatchExpression}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # matchLabels is an array of {key=value} pairs. + # A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. + # The requirements are ANDed. + ${ServiceNamespaceSelectorMatchLabel}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceLoadBalancer_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceMaintenanceConfiguration.ps1 b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceMaintenanceConfiguration.ps1 new file mode 100644 index 000000000000..6f83d27e29b8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceMaintenanceConfiguration.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a maintenance configuration in the specified managed cluster. +.Description +Creates or updates a maintenance configuration in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration +.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. + +MAINTENANCEWINDOWNOTALLOWEDDATE : Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. + End : The end date of the date span. + Start : The start date of the date span. + +NOTALLOWEDTIME : Time slots on which upgrade is not allowed. + [End ]: The end of a time span + [Start ]: The start of a time span + +TIMEINWEEK : If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + [Day ]: The day of the week. + [HourSlot ]: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicemaintenanceconfiguration +#> +function New-AzContainerServiceMaintenanceConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the maintenance configuration. + ${ConfigName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The date of the month. + ${AbsoluteMonthlyDayOfMonth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Specifies the number of months between each set of occurrences. + ${AbsoluteMonthlyIntervalMonth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Specifies the number of days between each set of occurrences. + ${DailyIntervalDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Length of maintenance window range from 4 to 24 hours. + ${MaintenanceWindowDurationHour}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[]] + # Date ranges on which upgrade is not allowed. + # 'utcOffset' applies to this field. + # For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. + # To construct, see NOTES section for MAINTENANCEWINDOWNOTALLOWEDDATE properties and create a hash table. + ${MaintenanceWindowNotAllowedDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.DateTime] + # The date the maintenance window activates. + # If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. + # If not specified, the maintenance window will be active right away. + ${MaintenanceWindowStartDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The start time of the maintenance window. + # Accepted values are from '00:00' to '23:59'. + # 'utcOffset' applies to this field. + # For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + ${MaintenanceWindowStartTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The UTC offset in format +/-HH:mm. + # For example, '+05:30' for IST and '-07:00' for PST. + # If not specified, the default is '+00:00'. + ${MaintenanceWindowUtcOffset}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[]] + # Time slots on which upgrade is not allowed. + # To construct, see NOTES section for NOTALLOWEDTIME properties and create a hash table. + ${NotAllowedTime}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay] + # Specifies on which day of the week the maintenance occurs. + ${RelativeMonthlyDayOfWeek}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Specifies the number of months between each set of occurrences. + ${RelativeMonthlyIntervalMonth}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type] + # Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + ${RelativeMonthlyWeekIndex}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[]] + # If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + # To construct, see NOTES section for TIMEINWEEK properties and create a hash table. + ${TimeInWeek}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay] + # Specifies on which day of the week the maintenance occurs. + ${WeeklyDayOfWeek}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Specifies the number of weeks between each set of occurrences. + ${WeeklyIntervalWeek}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceMaintenanceConfiguration_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceManagedCluster.ps1 b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceManagedCluster.ps1 new file mode 100644 index 000000000000..7898ad91d0c3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceManagedCluster.ps1 @@ -0,0 +1,1397 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a managed cluster. +.Description +Creates or updates a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster +.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. + +AGENTPOOLPROFILE : The agent pool properties. + Name : Windows agent pool names must be 6 characters or less. + [ArtifactStreamingProfileEnabled ]: Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, container images must also enable artifact streaming on ACR. If not specified, the default is false. + [AvailabilityZone ]: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + [CapacityReservationGroupId ]: AKS will associate the specified agent pool with the Capacity Reservation Group. + [Count ]: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + [CreationDataSourceResourceId ]: This is the ARM ID of the source object to be used to create the target object. + [EnableAutoScaling ]: Whether to enable auto-scaler + [EnableCustomCaTrust ]: When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node trust stores. Defaults to false. + [EnableEncryptionAtHost ]: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + [EnableFips ]: See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + [EnableNodePublicIP ]: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. + [EnableUltraSsd ]: Whether to enable UltraSSD + [GatewayProfilePublicIPPrefixSize ]: The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + [GpuInstanceProfile ]: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + [GpuProfileInstallGpuDriver ]: The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + [HostGroupId ]: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + [KubeletConfigAllowedUnsafeSysctl ]: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [KubeletConfigContainerLogMaxFile ]: The maximum number of container log files that can be present for a container. The number must be ≥ 2. + [KubeletConfigContainerLogMaxSizeMb ]: The maximum size (e.g. 10Mi) of container log file before it is rotated. + [KubeletConfigCpuCfsQuota ]: The default is true. + [KubeletConfigCpuCfsQuotaPeriod ]: The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + [KubeletConfigCpuManagerPolicy ]: The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'. + [KubeletConfigFailSwapOn ]: If set to true it will make the Kubelet fail to start if swap is enabled on the node. + [KubeletConfigImageGcHighThreshold ]: To disable image garbage collection, set to 100. The default is 85% + [KubeletConfigImageGcLowThreshold ]: This cannot be set higher than imageGcHighThreshold. The default is 80% + [KubeletConfigPodMaxPid ]: The maximum number of processes per pod. + [KubeletConfigTopologyManagerPolicy ]: For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + [KubeletDiskType ]: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + [LinuxOSConfigSwapFileSizeMb ]: The size in MB of a swap file that will be created on each node. + [LinuxOSConfigSysctl ]: Sysctl settings for Linux agent nodes. + [FsAioMaxNr ]: Sysctl setting fs.aio-max-nr. + [FsFileMax ]: Sysctl setting fs.file-max. + [FsInotifyMaxUserWatch ]: Sysctl setting fs.inotify.max_user_watches. + [FsNrOpen ]: Sysctl setting fs.nr_open. + [KernelThreadsMax ]: Sysctl setting kernel.threads-max. + [NetCoreNetdevMaxBacklog ]: Sysctl setting net.core.netdev_max_backlog. + [NetCoreOptmemMax ]: Sysctl setting net.core.optmem_max. + [NetCoreRmemDefault ]: Sysctl setting net.core.rmem_default. + [NetCoreRmemMax ]: Sysctl setting net.core.rmem_max. + [NetCoreSomaxconn ]: Sysctl setting net.core.somaxconn. + [NetCoreWmemDefault ]: Sysctl setting net.core.wmem_default. + [NetCoreWmemMax ]: Sysctl setting net.core.wmem_max. + [NetIpv4IPLocalPortRange ]: Sysctl setting net.ipv4.ip_local_port_range. + [NetIpv4NeighDefaultGcThresh1 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + [NetIpv4NeighDefaultGcThresh2 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + [NetIpv4NeighDefaultGcThresh3 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + [NetIpv4TcpFinTimeout ]: Sysctl setting net.ipv4.tcp_fin_timeout. + [NetIpv4TcpKeepaliveProbe ]: Sysctl setting net.ipv4.tcp_keepalive_probes. + [NetIpv4TcpKeepaliveTime ]: Sysctl setting net.ipv4.tcp_keepalive_time. + [NetIpv4TcpMaxSynBacklog ]: Sysctl setting net.ipv4.tcp_max_syn_backlog. + [NetIpv4TcpMaxTwBucket ]: Sysctl setting net.ipv4.tcp_max_tw_buckets. + [NetIpv4TcpTwReuse ]: Sysctl setting net.ipv4.tcp_tw_reuse. + [NetIpv4TcpkeepaliveIntvl ]: Sysctl setting net.ipv4.tcp_keepalive_intvl. + [NetNetfilterNfConntrackBucket ]: Sysctl setting net.netfilter.nf_conntrack_buckets. + [NetNetfilterNfConntrackMax ]: Sysctl setting net.netfilter.nf_conntrack_max. + [VMMaxMapCount ]: Sysctl setting vm.max_map_count. + [VMSwappiness ]: Sysctl setting vm.swappiness. + [VMVfsCachePressure ]: Sysctl setting vm.vfs_cache_pressure. + [LinuxOSConfigTransparentHugePageDefrag ]: Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + [LinuxOSConfigTransparentHugePageEnabled ]: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + [MaxCount ]: The maximum number of nodes for auto-scaling + [MaxPod ]: The maximum number of pods that can run on a node. + [MessageOfTheDay ]: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). + [MinCount ]: The minimum number of nodes for auto-scaling + [Mode ]: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + [NetworkProfileAllowedHostPort ]: The port ranges that are allowed to access. The specified ranges are allowed to overlap. + [PortEnd ]: The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. + [PortStart ]: The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. + [Protocol ]: The network protocol of the port. + [NetworkProfileApplicationSecurityGroup ]: The IDs of the application security groups which agent pool will associate when created. + [NetworkProfileNodePublicIPTag ]: IPTags of instance-level public IPs. + [Tag ]: The value of the IP tag associated with the public IP. Example: Internet. + [Type ]: The IP tag type. Example: RoutingPreference. + [NodeInitializationTaint ]: These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + [NodeLabel ]: The node labels to be persisted across all nodes in agent pool. + [(Any) ]: This indicates any property can be added to this object. + [NodePublicIPPrefixId ]: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + [NodeTaint ]: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + [OSDiskSizeGb ]: OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + [OSDiskType ]: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + [OSSku ]: Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + [OSType ]: The operating system type. The default is Linux. + [OrchestratorVersion ]: Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + [PodIPAllocationMode ]: The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + [PodSubnetId ]: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + [PowerStateCode ]: Tells whether the cluster is Running or Stopped + [ProximityPlacementGroupId ]: The ID for Proximity Placement Group. + [ScaleAutoscale ]: Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed. + [MaxCount ]: The maximum number of nodes of the specified sizes. + [MinCount ]: The minimum number of nodes of the specified sizes. + [Size ]: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when auto scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. + [ScaleDownMode ]: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + [ScaleManual ]: Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed. + [Count ]: Number of nodes. + [Size ]: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. + [ScaleSetEvictionPolicy ]: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + [ScaleSetPriority ]: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + [SecurityProfileEnableSecureBoot ]: Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + [SecurityProfileEnableVtpm ]: vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + [SecurityProfileSshAccess ]: SSH access method of an agent pool. + [SpotMaxPrice ]: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + [Tag ]: The tags to be persisted on the agent pool virtual machine scale set. + [(Any) ]: This indicates any property can be added to this object. + [Type ]: The type of Agent Pool. + [UpgradeSettingDrainTimeoutInMinute ]: The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. + [UpgradeSettingMaxSurge ]: 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + [UpgradeSettingNodeSoakDurationInMinute ]: The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes. + [UpgradeSettingUndrainableNodeBehavior ]: Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + [VMSize ]: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + [VirtualMachineNodesStatus ]: The status of nodes in a VirtualMachines agent pool. + [Count ]: Number of nodes. + [Size ]: The VM size of the agents used to host this group of nodes. + [VnetSubnetId ]: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + [WindowProfileDisableOutboundNat ]: The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + [WorkloadRuntime ]: Determines the type of workload a node can run. + +COMPONENTEGRESSGATEWAY : Istio egress gateways. + Enabled : Whether to enable the egress gateway. + +COMPONENTINGRESSGATEWAY : Istio ingress gateways. + Enabled : Whether to enable the ingress gateway. + Mode : Mode of an ingress gateway. + +NETWORKPROFILE : The network configuration profile. + [DnsServiceIP ]: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + [IPFamily ]: IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. + [IpvConfigScheduler ]: IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + [IpvConfigTcpFinTimeoutSecond ]: The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + [IpvConfigTcpTimeoutSecond ]: The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + [IpvConfigUdpTimeoutSecond ]: The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + [KubeProxyConfigEnabled ]: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default without these customizations). + [KubeProxyConfigMode ]: Specify which proxy mode to use ('IPTABLES' or 'IPVS') + [LoadBalancerProfileAllocatedOutboundPort ]: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. + [LoadBalancerProfileBackendPoolType ]: The type of the managed inbound Load Balancer BackendPool. + [LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode ]: The health probing behavior for External Traffic Policy Cluster services. + [LoadBalancerProfileEffectiveOutboundIP ]: The effective outbound IP resources of the cluster load balancer. + [Id ]: The fully qualified Azure resource id. + [LoadBalancerProfileEnableMultipleStandardLoadBalancer ]: Enable multiple standard load balancers per AKS cluster or not. + [LoadBalancerProfileIdleTimeoutInMinute ]: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + [LoadBalancerSku ]: The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. + [ManagedOutboundIPCount ]: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + [ManagedOutboundIPCountIpv6 ]: The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + [ManagedOutboundIPProfileCount ]: The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. + [MonitoringEnabled ]: Enable or disable the network monitoring plugin on the cluster + [NatGatewayProfileEffectiveOutboundIP ]: The effective outbound IP resources of the cluster NAT gateway. + [NatGatewayProfileIdleTimeoutInMinute ]: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + [NetworkDataplane ]: Network dataplane used in the Kubernetes cluster. + [NetworkMode ]: This cannot be specified if networkPlugin is anything other than 'azure'. + [NetworkPlugin ]: Network plugin used for building the Kubernetes network. + [NetworkPluginMode ]: Network plugin mode used for building the Kubernetes network. + [NetworkPolicy ]: Network policy used for building the Kubernetes network. + [ObservabilityEnabled ]: Indicates the enablement of Advanced Networking observability functionalities on clusters. + [OutboundIPPrefixPublicIpprefix ]: A list of public IP prefix resources. + [OutboundIPPublicIP ]: A list of public IP resources. + [OutboundType ]: This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + [PodCidr ]: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + [PodCidrs ]: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + [ServiceCidr ]: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + [ServiceCidrs ]: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. + [StaticEgressGatewayProfileEnabled ]: Indicates if Static Egress Gateway addon is enabled or not. + +PODIDENTITYPROFILEUSERASSIGNEDIDENTITY : The pod identities to use in the cluster. + Name : The name of the pod identity. + Namespace : The namespace of the pod identity. + [BindingSelector ]: The binding selector to use for the AzureIdentityBinding resource. + [Code ]: An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + [Detail ]: A list of additional details about the error. + [Code ]: An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + [Detail ]: A list of additional details about the error. + [Message ]: A message describing the error, intended to be suitable for display in a user interface. + [Target ]: The target of the particular error. For example, the name of the property in error. + [IdentityClientId ]: The client ID of the user assigned identity. + [IdentityObjectId ]: The object ID of the user assigned identity. + [IdentityResourceId ]: The resource ID of the user assigned identity. + [Message ]: A message describing the error, intended to be suitable for display in a user interface. + [Target ]: The target of the particular error. For example, the name of the property in error. + +PODIDENTITYPROFILEUSERASSIGNEDIDENTITYEXCEPTION : The pod identity exceptions to allow. + Name : The name of the pod identity exception. + Namespace : The namespace of the pod identity exception. + PodLabel : The pod labels to match. + [(Any) ]: This indicates any property can be added to this object. + +PRIVATELINKRESOURCE : Private link resources associated with the cluster. + [GroupId ]: The group ID of the resource. + [Id ]: The ID of the private link resource. + [Name ]: The name of the private link resource. + [RequiredMember ]: The RequiredMembers of the resource + [Type ]: The resource type. + +SSHPUBLICKEY : The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + KeyData : Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicemanagedcluster +#> +function New-AzContainerServiceManagedCluster { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if no entity matches this string. + ${IfNoneMatch}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The geo-location where the resource lives + ${Location}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The list of AAD group object IDs that will have admin role of the cluster. + ${AadProfileAdminGroupObjectID}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The client AAD application ID. + # Learn more at https://aka.ms/aks/aad-legacy. + ${AadProfileClientAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Azure RBAC for Kubernetes authorization. + ${AadProfileEnableAzureRbac}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable managed AAD. + ${AadProfileManaged}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The server AAD application ID. + # Learn more at https://aka.ms/aks/aad-legacy. + ${AadProfileServerAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The server AAD application secret. + # Learn more at https://aka.ms/aks/aad-legacy. + ${AadProfileServerAppSecret}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The AAD tenant ID to use for authentication. + # If not specified, will use the tenant of the deployment subscription. + ${AadProfileTenantId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles]))] + [System.Collections.Hashtable] + # The profile of managed cluster add-on. + ${AddonProfile}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[]] + # The agent pool properties. + # To construct, see NOTES section for AGENTPOOLPROFILE properties and create a hash table. + ${AgentPoolProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if AI toolchain operator enabled or not. + ${AiToolchainOperatorProfileEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # IP ranges are specified in CIDR format, e.g. + # 137.117.106.88/29. + # This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. + # For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + ${ApiServerAccessProfileAuthorizedIPRange}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to disable run command for the cluster or not. + ${ApiServerAccessProfileDisableRunCommand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + ${ApiServerAccessProfileEnablePrivateCluster}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to create additional public FQDN for private cluster or not. + ${ApiServerAccessProfileEnablePrivateClusterPublicFqdn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable apiserver vnet integration for the cluster or not. + ${ApiServerAccessProfileEnableVnetIntegration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is System. + # For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + # Allowed values are 'system' and 'none'. + ${ApiServerAccessProfilePrivateDnsZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # It is required when: 1. + # creating a new cluster with BYO Vnet; 2. + # updating an existing cluster to enable apiserver vnet integration. + ${ApiServerAccessProfileSubnetId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if Application Monitoring Auto Instrumentation is enabled or not. + ${AutoInstrumentationEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Valid values are 'true' and 'false' + ${AutoScalerProfileBalanceSimilarNodeGroup}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. + # If the daemonset pod cannot be evicted another node will be chosen for scaling. + # If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + ${AutoScalerProfileDaemonsetEvictionForEmptyNode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. + # If the daemonset pod cannot be evicted another node will be chosen for scaling. + # If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + ${AutoScalerProfileDaemonsetEvictionForOccupiedNode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander] + # Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + ${AutoScalerProfileExpander}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + ${AutoScalerProfileIgnoreDaemonsetsUtilization}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is 10. + ${AutoScalerProfileMaxEmptyBulkDelete}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is 600. + ${AutoScalerProfileMaxGracefulTerminationSec}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '15m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileMaxNodeProvisionTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is 45. + # The maximum is 100 and the minimum is 0. + ${AutoScalerProfileMaxTotalUnreadyPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. + # The default is '0s'. + # Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + ${AutoScalerProfileNewPodScaleUpDelay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This must be an integer. + # The default is 3. + ${AutoScalerProfileOkTotalUnreadyCount}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '10m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownDelayAfterAdd}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is the scan-interval. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownDelayAfterDelete}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '3m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownDelayAfterFailure}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '10m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownUnneededTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '20m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownUnreadyTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '0.5'. + ${AutoScalerProfileScaleDownUtilizationThreshold}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '10'. + # Values must be an integer number of seconds. + ${AutoScalerProfileScanInterval}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is true. + ${AutoScalerProfileSkipNodesWithLocalStorage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is true. + ${AutoScalerProfileSkipNodesWithSystemPod}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel] + # The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + ${AutoUpgradeProfileNodeOSUpgradeChannel}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel] + # For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + ${AutoUpgradeProfileUpgradeChannel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Azure Key Vault key management service. + # The default is false. + ${AzureKeyVaultKmEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Identifier of Azure Key Vault key. + # See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. + # When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. + # When Azure Key Vault key management service is disabled, leave the field empty. + ${AzureKeyVaultKmKeyId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes] + # Network access of key vault. + # The possible values are `Public` and `Private`. + # `Public` means the key vault allows public access from all networks. + # `Private` means the key vault disables public access and enables private link. + # The default value is `Public`. + ${AzureKeyVaultKmKeyVaultNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Resource ID of key vault. + # When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. + # When keyVaultNetworkAccess is `Public`, leave the field empty. + ${AzureKeyVaultKmKeyVaultResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable AzureBlob CSI Driver. + # The default value is false. + ${BlobCsiDriverEnabled}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource] + # The source where the artifacts are downloaded from. + ${BootstrapProfileArtifactSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The resource Id of Azure Container Registry. + # The registry must have private network access, premium SKU and zone redundancy. + ${BootstrapProfileContainerRegistryId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]] + # Istio egress gateways. + # To construct, see NOTES section for COMPONENTEGRESSGATEWAY properties and create a hash table. + ${ComponentEgressGateway}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]] + # Istio ingress gateways. + # To construct, see NOTES section for COMPONENTINGRESSGATEWAY properties and create a hash table. + ${ComponentIngressGateway}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether custom metrics collection has to be disabled or not. + # If not specified the default is false. + # No custom metrics will be emitted if this field is false but the container insights enabled field is false + ${ContainerInsightDisableCustomMetric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether prometheus metrics scraping is disabled or not. + # If not specified the default is false. + # No prometheus metrics will be emitted if this field is false but the container insights enabled field is false + ${ContainerInsightDisablePrometheusMetricsScraping}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + ${ContainerInsightEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + ${ContainerInsightLogAnalyticsWorkspaceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int64] + # The syslog host port. + # If not specified, the default port is 28330. + ${ContainerInsightSyslogPort}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. + # Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. + # If not specified, the default is false. + # For more information see aka.ms/aks/docs/cost-analysis. + ${CostAnalysisEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is the ARM ID of the source object to be used to create the target object. + ${CreationDataSourceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. + # When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. + # When Microsoft Defender is disabled, leave the field empty. + ${DefenderLogAnalyticsWorkspaceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true, getting static credentials will be disabled for this cluster. + # This must only be used on Managed Clusters that are AAD enabled. + # For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + ${DisableLocalAccount}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable AzureDisk CSI Driver. + # The default value is true. + ${DiskCsiDriverEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The version of AzureDisk CSI Driver. + # The default value is v1. + ${DiskCsiDriverVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + ${DiskEncryptionSetId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This cannot be updated once the Managed Cluster has been created. + ${DnsPrefix}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The default value is false. + # It can be enabled/disabled on creation and updating of the managed cluster. + # See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM Resource. + ${EnableNamespaceResource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). + # PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. + # Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + ${EnablePodSecurityPolicy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Kubernetes Role-Based Access Control. + ${EnableRbac}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The name of the extended location. + ${ExtendedLocationName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes] + # The type of the extended location. + ${ExtendedLocationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable AzureFile CSI Driver. + # The default value is true. + ${FileCsiDriverEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This cannot be updated once the Managed Cluster has been created. + ${FqdnSubdomain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Specifies the DNS server for Windows gMSA. + # + # + # Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + ${GmsaProfileDnsServer}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies whether to enable Windows gMSA in the managed cluster. + ${GmsaProfileEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Specifies the root domain name for Windows gMSA. + # + # + # Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + ${GmsaProfileRootDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The HTTP proxy server endpoint to use. + ${HttpProxyConfigHttpProxy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The HTTPS proxy server endpoint to use. + ${HttpProxyConfigHttpsProxy}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The endpoints that should not go through proxy. + ${HttpProxyConfigNoProxy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Alternative CA cert to use for connecting to proxy servers. + ${HttpProxyConfigTrustedCa}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources]))] + [System.Collections.Hashtable] + # The delegated identity resources assigned to this managed cluster. + # This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. + # Internal use only. + ${IdentityDelegatedResource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile]))] + [System.Collections.Hashtable] + # Identities associated with the cluster. + ${IdentityProfile}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType] + # For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Image Cleaner on AKS cluster. + ${ImageCleanerEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Image Cleaner scanning interval in hours. + ${ImageCleanerIntervalHour}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable image integrity. + # The default value is false. + ${ImageIntegrityEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The list of revisions of the Istio control plane. + # When an upgrade is not in progress, this holds one value. + # When canary upgrade is in progress, this can only hold two consecutive values. + # For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + ${IstioRevision}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable KEDA. + ${KedaEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is primarily used to expose different UI experiences in the portal for different kinds + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + ${KubeStateMetricAnnotationsAllowList}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + ${KubeStateMetricLabelsAllowlist}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. + # All upgrades must be performed sequentially by major version number. + # For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. + # See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. + ${KubernetesVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The administrator username to use for Linux VMs. + ${LinuxProfileAdminUsername}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable the Prometheus collector + ${MetricEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile] + # The network configuration profile. + # To construct, see NOTES section for NETWORKPROFILE properties and create a hash table. + ${NetworkProfile}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode] + # Once the mode it set to Auto, it cannot be changed back to Manual. + ${NodeProvisioningProfileMode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The name of the resource group containing agent pool nodes. + ${NodeResourceGroup}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel] + # The restriction level applied to the cluster's node resource group + ${NodeResourceGroupProfileRestrictionLevel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Node Restriction + ${NodeRestrictionEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether the OIDC issuer is enabled. + ${OidcIssuerProfileEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + ${OpenTelemetryLogEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int64] + # The Open Telemetry host port for Open Telemetry logs and traces. + # If not specified, the default port is 28331. + ${OpenTelemetryLogPort}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + ${OpenTelemetryMetricEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int64] + # The Open Telemetry host port for Open Telemetry metrics. + # If not specified, the default port is 28333. + ${OpenTelemetryMetricPort}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to force upgrade the cluster. + # Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. + # Enable this option only with caution. + ${OverrideSettingForceUpgrade}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.DateTime] + # Until when the overrides are effective. + # Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. + # This field is not set by default. + # It must be set for the overrides to take effect. + ${OverrideSettingUntil}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Certificate chain object name in Azure Key Vault. + ${PluginCertChainObjectName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Intermediate certificate object name in Azure Key Vault. + ${PluginCertObjectName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Intermediate certificate private key object name in Azure Key Vault. + ${PluginKeyObjectName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The resource ID of the Key Vault. + ${PluginKeyVaultId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Root certificate object name in Azure Key Vault. + ${PluginRootCertObjectName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + # See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information. + ${PodIdentityProfileAllowNetworkPluginKubenet}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether the pod identity addon is enabled. + ${PodIdentityProfileEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[]] + # The pod identities to use in the cluster. + # To construct, see NOTES section for PODIDENTITYPROFILEUSERASSIGNEDIDENTITY properties and create a hash table. + ${PodIdentityProfileUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[]] + # The pod identity exceptions to allow. + # To construct, see NOTES section for PODIDENTITYPROFILEUSERASSIGNEDIDENTITYEXCEPTION properties and create a hash table. + ${PodIdentityProfileUserAssignedIdentityException}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[]] + # Private link resources associated with the cluster. + # To construct, see NOTES section for PRIVATELINKRESOURCE properties and create a hash table. + ${PrivateLinkResource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess] + # Allow or deny public network access for AKS + ${PublicNetworkAccess}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # List of namespaces excluded from Safeguards checks + ${SafeguardProfileExcludedNamespace}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level] + # The Safeguards level to be used. + # By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces + ${SafeguardProfileLevel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The version of constraints to use + ${SafeguardProfileVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Defender threat detection + ${SecurityMonitoringEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([System.Byte[]]))] + [System.Byte[][]] + # A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. + # For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + ${SecurityProfileCustomCaTrustCertificate}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode] + # Mode of the service mesh. + ${ServiceMeshProfileMode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ID for the service principal. + ${ServicePrincipalProfileClientId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The secret password associated with the service principal in plain text. + ${ServicePrincipalProfileSecret}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName] + # The name of a managed cluster SKU. + ${SkuName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier] + # If not specified, the default is 'Free'. + # See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details. + ${SkuTier}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Snapshot Controller. + # The default value is true. + ${SnapshotControllerEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]] + # The list of SSH public keys used to authenticate with Linux-based VMs. + # A maximum of 1 key may be specified. + # To construct, see NOTES section for SSHPUBLICKEY properties and create a hash table. + ${SshPublicKey}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan] + # The support plan for the Managed Cluster. + # If unspecified, the default is 'KubernetesOfficial'. + ${SupportPlan}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling] + # Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + ${VerticalPodAutoscalerAddonAutoscaling}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable VPA add-on in cluster. + # Default value is false. + ${VerticalPodAutoscalerEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # Resource IDs of the DNS zones to be associated with the Web App Routing add-on. + # Used only when Web App Routing is enabled. + # Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. + ${WebAppRoutingDnsZoneResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Web App Routing. + ${WebAppRoutingEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Specifies the password of the administrator account. + # + # + # **Minimum-length:** 8 characters + # + # **Max-length:** 123 characters + # + # **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + # Has lower characters + # Has upper characters + # Has a digit + # Has a special character (Regex match [\W_]) + # + # **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ${WindowProfileAdminPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Specifies the name of the administrator account. + # + # + # **Restriction:** Cannot end in "." + # + # **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + # + # + # **Minimum-length:** 1 character + # + # **Max-length:** 20 characters + ${WindowProfileAdminUsername}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + ${WindowProfileEnableCsiProxy}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType] + # The license type to use for Windows VMs. + # See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. + ${WindowProfileLicenseType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable workload identity. + ${WorkloadIdentityEnabled}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceManagedCluster_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceManagedClusterSnapshot.ps1 b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceManagedClusterSnapshot.ps1 new file mode 100644 index 000000000000..b33ce5c36be4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceManagedClusterSnapshot.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a managed cluster snapshot. +.Description +Creates or updates a managed cluster snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicemanagedclustersnapshot +#> +function New-AzContainerServiceManagedClusterSnapshot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The geo-location where the resource lives + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is the ARM ID of the source object to be used to create the target object. + ${CreationDataSourceResourceId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType] + # The type of a snapshot. + # The default is NodePool. + ${SnapshotType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceManagedClusterSnapshot_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceSnapshot.ps1 b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceSnapshot.ps1 new file mode 100644 index 000000000000..708e118991ee --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceSnapshot.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a snapshot. +.Description +Creates or updates a snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicesnapshot +#> +function New-AzContainerServiceSnapshot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The geo-location where the resource lives + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is the ARM ID of the source object to be used to create the target object. + ${CreationDataSourceResourceId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType] + # The type of a snapshot. + # The default is NodePool. + ${SnapshotType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceSnapshot_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceTrustedAccessRoleBinding.ps1 b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceTrustedAccessRoleBinding.ps1 new file mode 100644 index 000000000000..934232528133 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/New-AzContainerServiceTrustedAccessRoleBinding.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create or update a trusted access role binding +.Description +Create or update a trusted access role binding +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicetrustedaccessrolebinding +#> +function New-AzContainerServiceTrustedAccessRoleBinding { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('TrustedAccessRoleBindingName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of trusted access role binding. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # A list of roles to bind, each item is a resource type qualified role name. + # For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + ${Role}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ARM resource ID of source resource that trusted access is configured for. + ${SourceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceTrustedAccessRoleBinding_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/containerservice.DefaultTag/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..751a431ea669 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,14679 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. +.Description +See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceagentpoolavailableagentpoolversion +#> +function Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the upgrade profile for an agent pool. +.Description +Gets the upgrade profile for an agent pool. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceagentpoolupgradeprofile +#> +function Get-AzContainerServiceAgentPoolUpgradeProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceAgentPoolUpgradeProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceAgentPoolUpgradeProfile_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the specified managed cluster agent pool. +.Description +Gets the specified managed cluster agent pool. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceagentpool +#> +function Get-AzContainerServiceAgentPool { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('AgentPoolName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceAgentPool_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceAgentPool_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceAgentPool_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the specified load balancer. +.Description +Gets the specified load balancer. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceloadbalancer +#> +function Get-AzContainerServiceLoadBalancer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('LoadBalancerName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the load balancer. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceLoadBalancer_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceLoadBalancer_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceLoadBalancer_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get a specific machine in the specified agent pool. +.Description +Get a specific machine in the specified agent pool. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemachine +#> +function Get-AzContainerServiceMachine { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('MachineName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # host name of the machine + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceMachine_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceMachine_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceMachine_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the specified maintenance configuration of a managed cluster. +.Description +Gets the specified maintenance configuration of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemaintenanceconfiguration +#> +function Get-AzContainerServiceMaintenanceConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the maintenance configuration. + ${ConfigName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceMaintenanceConfiguration_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceMaintenanceConfiguration_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceMaintenanceConfiguration_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +**WARNING**: This API will be deprecated. +Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . +.Description +**WARNING**: This API will be deprecated. +Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusteraccessprofile +#> +function Get-AzContainerServiceManagedClusterAccessProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the role for managed cluster accessProfile resource. + ${RoleName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterAccessProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterAccessProfile_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists the admin credentials of a managed cluster. +.Description +Lists the admin credentials of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusteradmincredentials +#> +function Get-AzContainerServiceManagedClusterAdminCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.String] + # server fqdn type for credentials to be returned + ${ServerFqdn}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterAdminCredentials_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the results of a command which has been run on the Managed Cluster. +.Description +Gets the results of a command which has been run on the Managed Cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustercommandresult +#> +function Get-AzContainerServiceManagedClusterCommandResult { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # Id of the command. + ${CommandId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterCommandResult_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterCommandResult_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Contains Guardrails version along with its support info and whether it is a default version. +.Description +Contains Guardrails version along with its support info and whether it is a default version. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterguardrailversion +#> +function Get-AzContainerServiceManagedClusterGuardrailVersion { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # Safeguards version + ${Version}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterGuardrailVersion_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterGuardrailVersion_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterGuardrailVersion_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version +.Description +Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterkuberneteversion +#> +function Get-AzContainerServiceManagedClusterKuberneteVersion { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterKuberneteVersion_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades +.Description +Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustermeshrevisionprofile +#> +function Get-AzContainerServiceManagedClusterMeshRevisionProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The mode of the mesh. + ${Mode}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshRevisionProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshRevisionProfile_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshRevisionProfile_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets available upgrades for a service mesh in a cluster. +.Description +Gets available upgrades for a service mesh in a cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustermeshupgradeprofile +#> +function Get-AzContainerServiceManagedClusterMeshUpgradeProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The mode of the mesh. + ${Mode}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshUpgradeProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshUpgradeProfile_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMeshUpgradeProfile_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists the cluster monitoring user credentials of a managed cluster. +.Description +Lists the cluster monitoring user credentials of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustermonitoringusercredentials +#> +function Get-AzContainerServiceManagedClusterMonitoringUserCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.String] + # server fqdn type for credentials to be returned + ${ServerFqdn}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterMonitoringUserCredentials_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets supported OS options in the specified subscription. +.Description +Gets supported OS options in the specified subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterosoption +#> +function Get-AzContainerServiceManagedClusterOSOption { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.String] + # The resource type for which the OS options needs to be returned + ${ResourceType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterOSOption_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterOSOption_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. +The operation returns properties of each egress endpoint. +.Description +Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. +The operation returns properties of each egress endpoint. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusteroutboundnetworkdependencyendpoint +#> +function Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Contains Safeguards version along with its support info and whether it is a default version. +.Description +Contains Safeguards version along with its support info and whether it is a default version. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustersafeguardversion +#> +function Get-AzContainerServiceManagedClusterSafeguardVersion { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # Safeguards version + ${Version}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSafeguardVersion_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSafeguardVersion_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSafeguardVersion_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets a managed cluster snapshot. +.Description +Gets a managed cluster snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclustersnapshot +#> +function Get-AzContainerServiceManagedClusterSnapshot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSnapshot_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSnapshot_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSnapshot_List'; + List1 = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterSnapshot_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the upgrade profile of a managed cluster. +.Description +Gets the upgrade profile of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterupgradeprofile +#> +function Get-AzContainerServiceManagedClusterUpgradeProfile { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterUpgradeProfile_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterUpgradeProfile_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists the user credentials of a managed cluster. +.Description +Lists the user credentials of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedclusterusercredentials +#> +function Get-AzContainerServiceManagedClusterUserCredentials { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format] + # Only apply to AAD clusters, specifies the format of returned kubeconfig. + # Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. + ${Format}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.String] + # server fqdn type for credentials to be returned + ${ServerFqdn}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedClusterUserCredentials_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets a managed cluster. +.Description +Gets a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicemanagedcluster +#> +function Get-AzContainerServiceManagedCluster { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceManagedCluster_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceManagedCluster_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceManagedCluster_List'; + List1 = 'Az.ContainerService.private\Get-AzContainerServiceManagedCluster_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the status of a specific operation in the specified managed cluster. +.Description +Get the status of a specific operation in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceoperationstatusresult +#> +function Get-AzContainerServiceOperationStatusResult { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The ID of an ongoing async operation. + ${OperationId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='Get1', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='Get1')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='GetViaIdentity1', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_Get'; + Get1 = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_Get1'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_GetViaIdentity'; + GetViaIdentity1 = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_GetViaIdentity1'; + List = 'Az.ContainerService.private\Get-AzContainerServiceOperationStatusResult_List'; + } + if (('Get', 'Get1', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +.Description +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceprivateendpointconnection +#> +function Get-AzContainerServicePrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the private endpoint connection. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServicePrivateEndpointConnection_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServicePrivateEndpointConnection_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServicePrivateEndpointConnection_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +.Description +To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceprivatelinkresource +#> +function Get-AzContainerServicePrivateLinkResource { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServicePrivateLinkResource_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets a snapshot. +.Description +Gets a snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicesnapshot +#> +function Get-AzContainerServiceSnapshot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Parameter(ParameterSetName='List1')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceSnapshot_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceSnapshot_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceSnapshot_List'; + List1 = 'Az.ContainerService.private\Get-AzContainerServiceSnapshot_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get a trusted access role binding. +.Description +Get a trusted access role binding. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicetrustedaccessrolebinding +#> +function Get-AzContainerServiceTrustedAccessRoleBinding { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TrustedAccessRoleBindingName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of trusted access role binding. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.ContainerService.private\Get-AzContainerServiceTrustedAccessRoleBinding_Get'; + GetViaIdentity = 'Az.ContainerService.private\Get-AzContainerServiceTrustedAccessRoleBinding_GetViaIdentity'; + List = 'Az.ContainerService.private\Get-AzContainerServiceTrustedAccessRoleBinding_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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List supported trusted access roles. +.Description +List supported trusted access roles. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerservicetrustedaccessrole +#> +function Get-AzContainerServiceTrustedAccessRole { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the Azure region. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceTrustedAccessRole_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Rebalance nodes across specific load balancers. +.Description +Rebalance nodes across specific load balancers. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +PARAMETER : The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + [LoadBalancerName ]: The load balancer names list. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/import-azcontainerservicemanagedcluster +#> +function Import-AzContainerServiceManagedCluster { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='LoadExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Load', Mandatory)] + [Parameter(ParameterSetName='LoadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Load', Mandatory)] + [Parameter(ParameterSetName='LoadExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Load')] + [Parameter(ParameterSetName='LoadExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='LoadViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LoadViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Load', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LoadViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody] + # The names of the load balancers to rebalance. + # If set to empty, all load balancers will be rebalanced. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='LoadExpanded')] + [Parameter(ParameterSetName='LoadViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The load balancer names list. + ${LoadBalancerName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Load = 'Az.ContainerService.private\Import-AzContainerServiceManagedCluster_Load'; + LoadExpanded = 'Az.ContainerService.private\Import-AzContainerServiceManagedCluster_LoadExpanded'; + LoadViaIdentity = 'Az.ContainerService.private\Import-AzContainerServiceManagedCluster_LoadViaIdentity'; + LoadViaIdentityExpanded = 'Az.ContainerService.private\Import-AzContainerServiceManagedCluster_LoadViaIdentityExpanded'; + } + if (('Load', 'LoadExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Aborts the currently running operation on the agent pool. +The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. +.Description +Aborts the currently running operation on the agent pool. +The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerserviceabortagentpoollatestoperation +#> +function Invoke-AzContainerServiceAbortAgentPoolLatestOperation { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Abort', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Abort')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='AbortViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Abort = 'Az.ContainerService.private\Invoke-AzContainerServiceAbortAgentPoolLatestOperation_Abort'; + AbortViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity'; + } + if (('Abort') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Aborts the currently running operation on the managed cluster. +The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. +.Description +Aborts the currently running operation on the managed cluster. +The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. +If the operation completes before cancellation can take place, an error is returned. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerserviceabortmanagedclusterlatestoperation +#> +function Invoke-AzContainerServiceAbortManagedClusterLatestOperation { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Abort', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Abort')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='AbortViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Abort = 'Az.ContainerService.private\Invoke-AzContainerServiceAbortManagedClusterLatestOperation_Abort'; + AbortViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity'; + } + if (('Abort') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the private link service ID for the specified managed cluster. +.Description +Gets the private link service ID for the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +PARAMETER : A private link resource + [GroupId ]: The group ID of the resource. + [Id ]: The ID of the private link resource. + [Name ]: The name of the private link resource. + [RequiredMember ]: The RequiredMembers of the resource + [Type ]: The resource type. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerserviceresolveprivatelinkserviceid +#> +function Invoke-AzContainerServiceResolvePrivateLinkServiceId { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource])] +[CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Post', Mandatory)] + [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Post', Mandatory)] + [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Post')] + [Parameter(ParameterSetName='PostExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource] + # A private link resource + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The group ID of the resource. + ${GroupId}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ID of the private link resource. + ${Id}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The name of the private link resource. + ${Name}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The RequiredMembers of the resource + ${RequiredMember}, + + [Parameter(ParameterSetName='PostExpanded')] + [Parameter(ParameterSetName='PostViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The resource type. + ${Type}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Post = 'Az.ContainerService.private\Invoke-AzContainerServiceResolvePrivateLinkServiceId_Post'; + PostExpanded = 'Az.ContainerService.private\Invoke-AzContainerServiceResolvePrivateLinkServiceId_PostExpanded'; + PostViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceResolvePrivateLinkServiceId_PostViaIdentity'; + PostViaIdentityExpanded = 'Az.ContainerService.private\Invoke-AzContainerServiceResolvePrivateLinkServiceId_PostViaIdentityExpanded'; + } + if (('Post', 'PostExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. +.Description +See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerservicerotatemanagedclustercertificate +#> +function Invoke-AzContainerServiceRotateManagedClusterCertificate { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Rotate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Rotate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Rotate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Rotate')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RotateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Rotate = 'Az.ContainerService.private\Invoke-AzContainerServiceRotateManagedClusterCertificate_Rotate'; + RotateViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity'; + } + if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Rotates the service account signing keys of a managed cluster. +.Description +Rotates the service account signing keys of a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/invoke-azcontainerservicerotatemanagedclusterserviceaccountsigningkey +#> +function Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Rotate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Rotate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Rotate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Rotate')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RotateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Rotate = 'Az.ContainerService.private\Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate'; + RotateViaIdentity = 'Az.ContainerService.private\Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity'; + } + if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates an agent pool in the specified managed cluster. +.Description +Creates or updates an agent pool in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool +.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. + +LINUXOSCONFIGSYSCTL : Sysctl settings for Linux agent nodes. + [FsAioMaxNr ]: Sysctl setting fs.aio-max-nr. + [FsFileMax ]: Sysctl setting fs.file-max. + [FsInotifyMaxUserWatch ]: Sysctl setting fs.inotify.max_user_watches. + [FsNrOpen ]: Sysctl setting fs.nr_open. + [KernelThreadsMax ]: Sysctl setting kernel.threads-max. + [NetCoreNetdevMaxBacklog ]: Sysctl setting net.core.netdev_max_backlog. + [NetCoreOptmemMax ]: Sysctl setting net.core.optmem_max. + [NetCoreRmemDefault ]: Sysctl setting net.core.rmem_default. + [NetCoreRmemMax ]: Sysctl setting net.core.rmem_max. + [NetCoreSomaxconn ]: Sysctl setting net.core.somaxconn. + [NetCoreWmemDefault ]: Sysctl setting net.core.wmem_default. + [NetCoreWmemMax ]: Sysctl setting net.core.wmem_max. + [NetIpv4IPLocalPortRange ]: Sysctl setting net.ipv4.ip_local_port_range. + [NetIpv4NeighDefaultGcThresh1 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + [NetIpv4NeighDefaultGcThresh2 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + [NetIpv4NeighDefaultGcThresh3 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + [NetIpv4TcpFinTimeout ]: Sysctl setting net.ipv4.tcp_fin_timeout. + [NetIpv4TcpKeepaliveProbe ]: Sysctl setting net.ipv4.tcp_keepalive_probes. + [NetIpv4TcpKeepaliveTime ]: Sysctl setting net.ipv4.tcp_keepalive_time. + [NetIpv4TcpMaxSynBacklog ]: Sysctl setting net.ipv4.tcp_max_syn_backlog. + [NetIpv4TcpMaxTwBucket ]: Sysctl setting net.ipv4.tcp_max_tw_buckets. + [NetIpv4TcpTwReuse ]: Sysctl setting net.ipv4.tcp_tw_reuse. + [NetIpv4TcpkeepaliveIntvl ]: Sysctl setting net.ipv4.tcp_keepalive_intvl. + [NetNetfilterNfConntrackBucket ]: Sysctl setting net.netfilter.nf_conntrack_buckets. + [NetNetfilterNfConntrackMax ]: Sysctl setting net.netfilter.nf_conntrack_max. + [VMMaxMapCount ]: Sysctl setting vm.max_map_count. + [VMSwappiness ]: Sysctl setting vm.swappiness. + [VMVfsCachePressure ]: Sysctl setting vm.vfs_cache_pressure. + +NETWORKPROFILEALLOWEDHOSTPORT : The port ranges that are allowed to access. The specified ranges are allowed to overlap. + [PortEnd ]: The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. + [PortStart ]: The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. + [Protocol ]: The network protocol of the port. + +NETWORKPROFILENODEPUBLICIPTAG : IPTags of instance-level public IPs. + [Tag ]: The value of the IP tag associated with the public IP. Example: Internet. + [Type ]: The IP tag type. Example: RoutingPreference. + +SCALEAUTOSCALE : Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed. + [MaxCount ]: The maximum number of nodes of the specified sizes. + [MinCount ]: The minimum number of nodes of the specified sizes. + [Size ]: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when auto scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. + +SCALEMANUAL : Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed. + [Count ]: Number of nodes. + [Size ]: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. + +VIRTUALMACHINENODESSTATUS : The status of nodes in a VirtualMachines agent pool. + [Count ]: Number of nodes. + [Size ]: The VM size of the agents used to host this group of nodes. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerserviceagentpool +#> +function New-AzContainerServiceAgentPool { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('AgentPoolName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if no entity matches this string. + ${IfNoneMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. + # To use this feature, container images must also enable artifact streaming on ACR. + # If not specified, the default is false. + ${ArtifactStreamingProfileEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The list of Availability zones to use for nodes. + # This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + ${AvailabilityZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # AKS will associate the specified agent pool with the Capacity Reservation Group. + ${CapacityReservationGroupId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Number of agents (VMs) to host docker containers. + # Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. + # The default value is 1. + ${Count}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is the ARM ID of the source object to be used to create the target object. + ${CreationDataSourceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable auto-scaler + ${EnableAutoScaling}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node trust stores. + # Defaults to false. + ${EnableCustomCaTrust}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This is only supported on certain VM sizes and in certain Azure regions. + # For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + ${EnableEncryptionAtHost}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + ${EnableFips}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. + # A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + # For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + # The default is false. + ${EnableNodePublicIP}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable UltraSSD + ${EnableUltraSsd}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. + # The size of Public IPPrefix should be selected by the user. + # Each node in the agent pool is assigned with one IP from the IPPrefix. + # The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. + # Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). + # The default value is 31. + ${GatewayProfilePublicIPPrefixSize}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile] + # GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + ${GpuInstanceProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. + # GPU Driver Installation can only be set true when VM has an associated GPU resource. + # Setting this field to false prevents automatic GPU driver installation. + # In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + ${GpuProfileInstallGpuDriver}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + # For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + ${HostGroupId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + ${KubeletConfigAllowedUnsafeSysctl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum number of container log files that can be present for a container. + # The number must be ≥ 2. + ${KubeletConfigContainerLogMaxFile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum size (e.g. + # 10Mi) of container log file before it is rotated. + ${KubeletConfigContainerLogMaxSizeMb}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The default is true. + ${KubeletConfigCpuCfsQuota}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. + # For example: '300ms', '2h45m'. + # Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + ${KubeletConfigCpuCfsQuotaPeriod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is 'none'. + # See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. + # Allowed values are 'none' and 'static'. + ${KubeletConfigCpuManagerPolicy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true it will make the Kubelet fail to start if swap is enabled on the node. + ${KubeletConfigFailSwapOn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # To disable image garbage collection, set to 100. + # The default is 85% + ${KubeletConfigImageGcHighThreshold}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # This cannot be set higher than imageGcHighThreshold. + # The default is 80% + ${KubeletConfigImageGcLowThreshold}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum number of processes per pod. + ${KubeletConfigPodMaxPid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + # The default is 'none'. + # Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + ${KubeletConfigTopologyManagerPolicy}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType] + # Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + ${KubeletDiskType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The size in MB of a swap file that will be created on each node. + ${LinuxOSConfigSwapFileSizeMb}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig] + # Sysctl settings for Linux agent nodes. + # To construct, see NOTES section for LINUXOSCONFIGSYSCTL properties and create a hash table. + ${LinuxOSConfigSysctl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. + # The default is 'madvise'. + # For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + ${LinuxOSConfigTransparentHugePageDefrag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Valid values are 'always', 'madvise', and 'never'. + # The default is 'always'. + # For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + ${LinuxOSConfigTransparentHugePageEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum number of nodes for auto-scaling + ${MaxCount}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The maximum number of pods that can run on a node. + ${MaxPod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # A base64-encoded string which will be written to /etc/motd after decoding. + # This allows customization of the message of the day for Linux nodes. + # It must not be specified for Windows nodes. + # It must be a static string (i.e., will be printed raw and not be executed as a script). + ${MessageOfTheDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The minimum number of nodes for auto-scaling + ${MinCount}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode] + # A cluster must have at least one 'System' Agent Pool at all times. + # For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + ${Mode}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]] + # The port ranges that are allowed to access. + # The specified ranges are allowed to overlap. + # To construct, see NOTES section for NETWORKPROFILEALLOWEDHOSTPORT properties and create a hash table. + ${NetworkProfileAllowedHostPort}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The IDs of the application security groups which agent pool will associate when created. + ${NetworkProfileApplicationSecurityGroup}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]] + # IPTags of instance-level public IPs. + # To construct, see NOTES section for NETWORKPROFILENODEPUBLICIPTAG properties and create a hash table. + ${NetworkProfileNodePublicIPTag}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # These taints will not be reconciled by AKS and can be removed with a kubectl call. + # This field can be modified after node pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + # node image upgrade) happens. + # These taints allow for required configuration to run before the node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + ${NodeInitializationTaint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels]))] + [System.Collections.Hashtable] + # The node labels to be persisted across all nodes in agent pool. + ${NodeLabel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + ${NodePublicIPPrefixId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The taints added to new nodes during node pool create and scale. + # For example, key=value:NoSchedule. + ${NodeTaint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. + # If you specify 0, it will apply the default osDisk size according to the vmSize specified. + ${OSDiskSizeGb}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType] + # The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. + # Otherwise, defaults to 'Managed'. + # May not be changed after creation. + # For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + ${OSDiskType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku] + # Specifies the OS SKU used by the agent pool. + # If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. + # And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + ${OSSku}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType] + # The operating system type. + # The default is Linux. + ${OSType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Both patch version and are supported. + # When is specified, the latest supported patch version is chosen automatically. + # Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. + # As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. + # The node pool version must have the same major version as the control plane. + # The node pool minor version must be within two minor versions of the control plane version. + # The node pool version cannot be greater than the control plane version. + # For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + ${OrchestratorVersion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode] + # The IP allocation mode for pods in the agent pool. + # Must be used with podSubnetId. + # The default is 'DynamicIndividual'. + ${PodIPAllocationMode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). + # This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + ${PodSubnetId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code] + # Tells whether the cluster is Running or Stopped + ${PowerStateCode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType] + # The type of Agent Pool. + ${PropertiesType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ID for Proximity Placement Group. + ${ProximityPlacementGroupId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]] + # Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. + # Currently, at most one AutoScaleProfile is allowed. + # To construct, see NOTES section for SCALEAUTOSCALE properties and create a hash table. + ${ScaleAutoscale}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode] + # This also effects the cluster autoscaler behavior. + # If not specified, it defaults to Delete. + ${ScaleDownMode}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]] + # Specifications on how to scale the VirtualMachines agent pool to a fixed size. + # Currently, at most one ManualScaleProfile is allowed. + # To construct, see NOTES section for SCALEMANUAL properties and create a hash table. + ${ScaleManual}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy] + # This cannot be specified unless the scaleSetPriority is 'Spot'. + # If not specified, the default is 'Delete'. + ${ScaleSetEvictionPolicy}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority] + # The Virtual Machine Scale Set priority. + # If not specified, the default is 'Regular'. + ${ScaleSetPriority}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. + # For more details, see aka.ms/aks/trustedlaunch. + # If not specified, the default is false. + ${SecurityProfileEnableSecureBoot}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. + # For more details, see aka.ms/aks/trustedlaunch. + # If not specified, the default is false. + ${SecurityProfileEnableVtpm}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess] + # SSH access method of an agent pool. + ${SecurityProfileSshAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Single] + # Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + # For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + ${SpotMaxPrice}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags]))] + [System.Collections.Hashtable] + # The tags to be persisted on the agent pool virtual machine scale set. + ${Tag}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. + # This eviction wait time honors waiting on pod disruption budgets. + # If this time is exceeded, the upgrade fails. + # If not specified, the default is 30 minutes. + ${UpgradeSettingDrainTimeoutInMinute}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # 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, the default is 1. + # For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + ${UpgradeSettingMaxSurge}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. + # If not specified, the default is 0 minutes. + ${UpgradeSettingNodeSoakDurationInMinute}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior] + # Defines the behavior for undrainable nodes during upgrade. + # The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + ${UpgradeSettingUndrainableNodeBehavior}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # VM size availability varies by region. + # If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. + # For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + ${VMSize}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[]] + # The status of nodes in a VirtualMachines agent pool. + # To construct, see NOTES section for VIRTUALMACHINENODESSTATUS properties and create a hash table. + ${VirtualMachineNodesStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # If this is not specified, a VNET and subnet will be generated and used. + # If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. + # This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + ${VnetSubnetId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The default value is false. + # Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + ${WindowProfileDisableOutboundNat}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime] + # Determines the type of workload a node can run. + ${WorkloadRuntime}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceAgentPool_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates a load balancer in the specified managed cluster. +.Description +Creates or updates a load balancer in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer +.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. + +NODESELECTORMATCHEXPRESSION : matchExpressions is a list of label selector requirements. The requirements are ANDed. + [Key ]: key is the label key that the selector applies to. + [Operator ]: operator represents a key's relationship to a set of values. Valid operators are In and NotIn + [Value ]: values is an array of string values, the values array must be non-empty. + +SERVICELABELSELECTORMATCHEXPRESSION : matchExpressions is a list of label selector requirements. The requirements are ANDed. + [Key ]: key is the label key that the selector applies to. + [Operator ]: operator represents a key's relationship to a set of values. Valid operators are In and NotIn + [Value ]: values is an array of string values, the values array must be non-empty. + +SERVICENAMESPACESELECTORMATCHEXPRESSION : matchExpressions is a list of label selector requirements. The requirements are ANDed. + [Key ]: key is the label key that the selector applies to. + [Operator ]: operator represents a key's relationship to a set of values. Valid operators are In and NotIn + [Value ]: values is an array of string values, the values array must be non-empty. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerserviceloadbalancer +#> +function New-AzContainerServiceLoadBalancer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('LoadBalancerName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the load balancer. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to automatically place services on the load balancer. + # If not supplied, the default value is true. + # If set to false manually, both of the external and the internal load balancer will not be selected for services unless they explicitly target it. + ${AllowServicePlacement}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]] + # matchExpressions is a list of label selector requirements. + # The requirements are ANDed. + # To construct, see NOTES section for NODESELECTORMATCHEXPRESSION properties and create a hash table. + ${NodeSelectorMatchExpression}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # matchLabels is an array of {key=value} pairs. + # A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. + # The requirements are ANDed. + ${NodeSelectorMatchLabel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Required field. + # A string value that must specify the ID of an existing agent pool. + # All nodes in the given pool will always be added to this load balancer. + # This agent pool must have at least one node and minCount>=1 for autoscaling operations. + # An agent pool can only be the primary pool for a single load balancer. + ${PrimaryAgentPoolName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Name of the public load balancer. + # There will be an internal load balancer created if needed, and the name will be `-internal`. + # The internal lb shares the same configurations as the external one. + # The internal lbs are not needed to be included in LoadBalancer list. + # There must be a name of kubernetes in the list. + ${PropertiesName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]] + # matchExpressions is a list of label selector requirements. + # The requirements are ANDed. + # To construct, see NOTES section for SERVICELABELSELECTORMATCHEXPRESSION properties and create a hash table. + ${ServiceLabelSelectorMatchExpression}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # matchLabels is an array of {key=value} pairs. + # A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. + # The requirements are ANDed. + ${ServiceLabelSelectorMatchLabel}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]] + # matchExpressions is a list of label selector requirements. + # The requirements are ANDed. + # To construct, see NOTES section for SERVICENAMESPACESELECTORMATCHEXPRESSION properties and create a hash table. + ${ServiceNamespaceSelectorMatchExpression}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # matchLabels is an array of {key=value} pairs. + # A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. + # The requirements are ANDed. + ${ServiceNamespaceSelectorMatchLabel}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceLoadBalancer_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates a maintenance configuration in the specified managed cluster. +.Description +Creates or updates a maintenance configuration in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration +.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. + +MAINTENANCEWINDOWNOTALLOWEDDATE : Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. + End : The end date of the date span. + Start : The start date of the date span. + +NOTALLOWEDTIME : Time slots on which upgrade is not allowed. + [End ]: The end of a time span + [Start ]: The start of a time span + +TIMEINWEEK : If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + [Day ]: The day of the week. + [HourSlot ]: Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicemaintenanceconfiguration +#> +function New-AzContainerServiceMaintenanceConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the maintenance configuration. + ${ConfigName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # The date of the month. + ${AbsoluteMonthlyDayOfMonth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Specifies the number of months between each set of occurrences. + ${AbsoluteMonthlyIntervalMonth}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Specifies the number of days between each set of occurrences. + ${DailyIntervalDay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Length of maintenance window range from 4 to 24 hours. + ${MaintenanceWindowDurationHour}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[]] + # Date ranges on which upgrade is not allowed. + # 'utcOffset' applies to this field. + # For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time. + # To construct, see NOTES section for MAINTENANCEWINDOWNOTALLOWEDDATE properties and create a hash table. + ${MaintenanceWindowNotAllowedDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.DateTime] + # The date the maintenance window activates. + # If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. + # If not specified, the maintenance window will be active right away. + ${MaintenanceWindowStartDate}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The start time of the maintenance window. + # Accepted values are from '00:00' to '23:59'. + # 'utcOffset' applies to this field. + # For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + ${MaintenanceWindowStartTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The UTC offset in format +/-HH:mm. + # For example, '+05:30' for IST and '-07:00' for PST. + # If not specified, the default is '+00:00'. + ${MaintenanceWindowUtcOffset}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[]] + # Time slots on which upgrade is not allowed. + # To construct, see NOTES section for NOTALLOWEDTIME properties and create a hash table. + ${NotAllowedTime}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay] + # Specifies on which day of the week the maintenance occurs. + ${RelativeMonthlyDayOfWeek}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Specifies the number of months between each set of occurrences. + ${RelativeMonthlyIntervalMonth}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type] + # Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + ${RelativeMonthlyWeekIndex}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[]] + # If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + # To construct, see NOTES section for TIMEINWEEK properties and create a hash table. + ${TimeInWeek}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay] + # Specifies on which day of the week the maintenance occurs. + ${WeeklyDayOfWeek}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Specifies the number of weeks between each set of occurrences. + ${WeeklyIntervalWeek}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceMaintenanceConfiguration_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates a managed cluster snapshot. +.Description +Creates or updates a managed cluster snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicemanagedclustersnapshot +#> +function New-AzContainerServiceManagedClusterSnapshot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The geo-location where the resource lives + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is the ARM ID of the source object to be used to create the target object. + ${CreationDataSourceResourceId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType] + # The type of a snapshot. + # The default is NodePool. + ${SnapshotType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceManagedClusterSnapshot_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates a managed cluster. +.Description +Creates or updates a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster +.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. + +AGENTPOOLPROFILE : The agent pool properties. + Name : Windows agent pool names must be 6 characters or less. + [ArtifactStreamingProfileEnabled ]: Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, container images must also enable artifact streaming on ACR. If not specified, the default is false. + [AvailabilityZone ]: The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + [CapacityReservationGroupId ]: AKS will associate the specified agent pool with the Capacity Reservation Group. + [Count ]: Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + [CreationDataSourceResourceId ]: This is the ARM ID of the source object to be used to create the target object. + [EnableAutoScaling ]: Whether to enable auto-scaler + [EnableCustomCaTrust ]: When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node trust stores. Defaults to false. + [EnableEncryptionAtHost ]: This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + [EnableFips ]: See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + [EnableNodePublicIP ]: Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. + [EnableUltraSsd ]: Whether to enable UltraSSD + [GatewayProfilePublicIPPrefixSize ]: The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + [GpuInstanceProfile ]: GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + [GpuProfileInstallGpuDriver ]: The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + [HostGroupId ]: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + [KubeletConfigAllowedUnsafeSysctl ]: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [KubeletConfigContainerLogMaxFile ]: The maximum number of container log files that can be present for a container. The number must be ≥ 2. + [KubeletConfigContainerLogMaxSizeMb ]: The maximum size (e.g. 10Mi) of container log file before it is rotated. + [KubeletConfigCpuCfsQuota ]: The default is true. + [KubeletConfigCpuCfsQuotaPeriod ]: The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + [KubeletConfigCpuManagerPolicy ]: The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'. + [KubeletConfigFailSwapOn ]: If set to true it will make the Kubelet fail to start if swap is enabled on the node. + [KubeletConfigImageGcHighThreshold ]: To disable image garbage collection, set to 100. The default is 85% + [KubeletConfigImageGcLowThreshold ]: This cannot be set higher than imageGcHighThreshold. The default is 80% + [KubeletConfigPodMaxPid ]: The maximum number of processes per pod. + [KubeletConfigTopologyManagerPolicy ]: For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + [KubeletDiskType ]: Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + [LinuxOSConfigSwapFileSizeMb ]: The size in MB of a swap file that will be created on each node. + [LinuxOSConfigSysctl ]: Sysctl settings for Linux agent nodes. + [FsAioMaxNr ]: Sysctl setting fs.aio-max-nr. + [FsFileMax ]: Sysctl setting fs.file-max. + [FsInotifyMaxUserWatch ]: Sysctl setting fs.inotify.max_user_watches. + [FsNrOpen ]: Sysctl setting fs.nr_open. + [KernelThreadsMax ]: Sysctl setting kernel.threads-max. + [NetCoreNetdevMaxBacklog ]: Sysctl setting net.core.netdev_max_backlog. + [NetCoreOptmemMax ]: Sysctl setting net.core.optmem_max. + [NetCoreRmemDefault ]: Sysctl setting net.core.rmem_default. + [NetCoreRmemMax ]: Sysctl setting net.core.rmem_max. + [NetCoreSomaxconn ]: Sysctl setting net.core.somaxconn. + [NetCoreWmemDefault ]: Sysctl setting net.core.wmem_default. + [NetCoreWmemMax ]: Sysctl setting net.core.wmem_max. + [NetIpv4IPLocalPortRange ]: Sysctl setting net.ipv4.ip_local_port_range. + [NetIpv4NeighDefaultGcThresh1 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + [NetIpv4NeighDefaultGcThresh2 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + [NetIpv4NeighDefaultGcThresh3 ]: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + [NetIpv4TcpFinTimeout ]: Sysctl setting net.ipv4.tcp_fin_timeout. + [NetIpv4TcpKeepaliveProbe ]: Sysctl setting net.ipv4.tcp_keepalive_probes. + [NetIpv4TcpKeepaliveTime ]: Sysctl setting net.ipv4.tcp_keepalive_time. + [NetIpv4TcpMaxSynBacklog ]: Sysctl setting net.ipv4.tcp_max_syn_backlog. + [NetIpv4TcpMaxTwBucket ]: Sysctl setting net.ipv4.tcp_max_tw_buckets. + [NetIpv4TcpTwReuse ]: Sysctl setting net.ipv4.tcp_tw_reuse. + [NetIpv4TcpkeepaliveIntvl ]: Sysctl setting net.ipv4.tcp_keepalive_intvl. + [NetNetfilterNfConntrackBucket ]: Sysctl setting net.netfilter.nf_conntrack_buckets. + [NetNetfilterNfConntrackMax ]: Sysctl setting net.netfilter.nf_conntrack_max. + [VMMaxMapCount ]: Sysctl setting vm.max_map_count. + [VMSwappiness ]: Sysctl setting vm.swappiness. + [VMVfsCachePressure ]: Sysctl setting vm.vfs_cache_pressure. + [LinuxOSConfigTransparentHugePageDefrag ]: Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + [LinuxOSConfigTransparentHugePageEnabled ]: Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + [MaxCount ]: The maximum number of nodes for auto-scaling + [MaxPod ]: The maximum number of pods that can run on a node. + [MessageOfTheDay ]: A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). + [MinCount ]: The minimum number of nodes for auto-scaling + [Mode ]: A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + [NetworkProfileAllowedHostPort ]: The port ranges that are allowed to access. The specified ranges are allowed to overlap. + [PortEnd ]: The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. + [PortStart ]: The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. + [Protocol ]: The network protocol of the port. + [NetworkProfileApplicationSecurityGroup ]: The IDs of the application security groups which agent pool will associate when created. + [NetworkProfileNodePublicIPTag ]: IPTags of instance-level public IPs. + [Tag ]: The value of the IP tag associated with the public IP. Example: Internet. + [Type ]: The IP tag type. Example: RoutingPreference. + [NodeInitializationTaint ]: These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + [NodeLabel ]: The node labels to be persisted across all nodes in agent pool. + [(Any) ]: This indicates any property can be added to this object. + [NodePublicIPPrefixId ]: This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + [NodeTaint ]: The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + [OSDiskSizeGb ]: OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + [OSDiskType ]: The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + [OSSku ]: Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + [OSType ]: The operating system type. The default is Linux. + [OrchestratorVersion ]: Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + [PodIPAllocationMode ]: The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + [PodSubnetId ]: If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + [PowerStateCode ]: Tells whether the cluster is Running or Stopped + [ProximityPlacementGroupId ]: The ID for Proximity Placement Group. + [ScaleAutoscale ]: Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed. + [MaxCount ]: The maximum number of nodes of the specified sizes. + [MinCount ]: The minimum number of nodes of the specified sizes. + [Size ]: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when auto scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. + [ScaleDownMode ]: This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + [ScaleManual ]: Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed. + [Count ]: Number of nodes. + [Size ]: The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size. + [ScaleSetEvictionPolicy ]: This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + [ScaleSetPriority ]: The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + [SecurityProfileEnableSecureBoot ]: Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + [SecurityProfileEnableVtpm ]: vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + [SecurityProfileSshAccess ]: SSH access method of an agent pool. + [SpotMaxPrice ]: Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + [Tag ]: The tags to be persisted on the agent pool virtual machine scale set. + [(Any) ]: This indicates any property can be added to this object. + [Type ]: The type of Agent Pool. + [UpgradeSettingDrainTimeoutInMinute ]: The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes. + [UpgradeSettingMaxSurge ]: 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + [UpgradeSettingNodeSoakDurationInMinute ]: The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes. + [UpgradeSettingUndrainableNodeBehavior ]: Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + [VMSize ]: VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + [VirtualMachineNodesStatus ]: The status of nodes in a VirtualMachines agent pool. + [Count ]: Number of nodes. + [Size ]: The VM size of the agents used to host this group of nodes. + [VnetSubnetId ]: If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + [WindowProfileDisableOutboundNat ]: The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled. + [WorkloadRuntime ]: Determines the type of workload a node can run. + +COMPONENTEGRESSGATEWAY : Istio egress gateways. + Enabled : Whether to enable the egress gateway. + +COMPONENTINGRESSGATEWAY : Istio ingress gateways. + Enabled : Whether to enable the ingress gateway. + Mode : Mode of an ingress gateway. + +NETWORKPROFILE : The network configuration profile. + [DnsServiceIP ]: An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + [IPFamily ]: IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. + [IpvConfigScheduler ]: IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + [IpvConfigTcpFinTimeoutSecond ]: The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + [IpvConfigTcpTimeoutSecond ]: The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + [IpvConfigUdpTimeoutSecond ]: The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + [KubeProxyConfigEnabled ]: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default without these customizations). + [KubeProxyConfigMode ]: Specify which proxy mode to use ('IPTABLES' or 'IPVS') + [LoadBalancerProfileAllocatedOutboundPort ]: The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. + [LoadBalancerProfileBackendPoolType ]: The type of the managed inbound Load Balancer BackendPool. + [LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode ]: The health probing behavior for External Traffic Policy Cluster services. + [LoadBalancerProfileEffectiveOutboundIP ]: The effective outbound IP resources of the cluster load balancer. + [Id ]: The fully qualified Azure resource id. + [LoadBalancerProfileEnableMultipleStandardLoadBalancer ]: Enable multiple standard load balancers per AKS cluster or not. + [LoadBalancerProfileIdleTimeoutInMinute ]: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + [LoadBalancerSku ]: The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. + [ManagedOutboundIPCount ]: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + [ManagedOutboundIPCountIpv6 ]: The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + [ManagedOutboundIPProfileCount ]: The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. + [MonitoringEnabled ]: Enable or disable the network monitoring plugin on the cluster + [NatGatewayProfileEffectiveOutboundIP ]: The effective outbound IP resources of the cluster NAT gateway. + [NatGatewayProfileIdleTimeoutInMinute ]: Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + [NetworkDataplane ]: Network dataplane used in the Kubernetes cluster. + [NetworkMode ]: This cannot be specified if networkPlugin is anything other than 'azure'. + [NetworkPlugin ]: Network plugin used for building the Kubernetes network. + [NetworkPluginMode ]: Network plugin mode used for building the Kubernetes network. + [NetworkPolicy ]: Network policy used for building the Kubernetes network. + [ObservabilityEnabled ]: Indicates the enablement of Advanced Networking observability functionalities on clusters. + [OutboundIPPrefixPublicIpprefix ]: A list of public IP prefix resources. + [OutboundIPPublicIP ]: A list of public IP resources. + [OutboundType ]: This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + [PodCidr ]: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + [PodCidrs ]: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + [ServiceCidr ]: A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + [ServiceCidrs ]: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. + [StaticEgressGatewayProfileEnabled ]: Indicates if Static Egress Gateway addon is enabled or not. + +PODIDENTITYPROFILEUSERASSIGNEDIDENTITY : The pod identities to use in the cluster. + Name : The name of the pod identity. + Namespace : The namespace of the pod identity. + [BindingSelector ]: The binding selector to use for the AzureIdentityBinding resource. + [Code ]: An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + [Detail ]: A list of additional details about the error. + [Code ]: An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + [Detail ]: A list of additional details about the error. + [Message ]: A message describing the error, intended to be suitable for display in a user interface. + [Target ]: The target of the particular error. For example, the name of the property in error. + [IdentityClientId ]: The client ID of the user assigned identity. + [IdentityObjectId ]: The object ID of the user assigned identity. + [IdentityResourceId ]: The resource ID of the user assigned identity. + [Message ]: A message describing the error, intended to be suitable for display in a user interface. + [Target ]: The target of the particular error. For example, the name of the property in error. + +PODIDENTITYPROFILEUSERASSIGNEDIDENTITYEXCEPTION : The pod identity exceptions to allow. + Name : The name of the pod identity exception. + Namespace : The namespace of the pod identity exception. + PodLabel : The pod labels to match. + [(Any) ]: This indicates any property can be added to this object. + +PRIVATELINKRESOURCE : Private link resources associated with the cluster. + [GroupId ]: The group ID of the resource. + [Id ]: The ID of the private link resource. + [Name ]: The name of the private link resource. + [RequiredMember ]: The RequiredMembers of the resource + [Type ]: The resource type. + +SSHPUBLICKEY : The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + KeyData : Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicemanagedcluster +#> +function New-AzContainerServiceManagedCluster { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if no entity matches this string. + ${IfNoneMatch}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The geo-location where the resource lives + ${Location}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The list of AAD group object IDs that will have admin role of the cluster. + ${AadProfileAdminGroupObjectID}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The client AAD application ID. + # Learn more at https://aka.ms/aks/aad-legacy. + ${AadProfileClientAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Azure RBAC for Kubernetes authorization. + ${AadProfileEnableAzureRbac}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable managed AAD. + ${AadProfileManaged}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The server AAD application ID. + # Learn more at https://aka.ms/aks/aad-legacy. + ${AadProfileServerAppId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The server AAD application secret. + # Learn more at https://aka.ms/aks/aad-legacy. + ${AadProfileServerAppSecret}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The AAD tenant ID to use for authentication. + # If not specified, will use the tenant of the deployment subscription. + ${AadProfileTenantId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles]))] + [System.Collections.Hashtable] + # The profile of managed cluster add-on. + ${AddonProfile}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[]] + # The agent pool properties. + # To construct, see NOTES section for AGENTPOOLPROFILE properties and create a hash table. + ${AgentPoolProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if AI toolchain operator enabled or not. + ${AiToolchainOperatorProfileEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # IP ranges are specified in CIDR format, e.g. + # 137.117.106.88/29. + # This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. + # For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + ${ApiServerAccessProfileAuthorizedIPRange}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to disable run command for the cluster or not. + ${ApiServerAccessProfileDisableRunCommand}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + ${ApiServerAccessProfileEnablePrivateCluster}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to create additional public FQDN for private cluster or not. + ${ApiServerAccessProfileEnablePrivateClusterPublicFqdn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable apiserver vnet integration for the cluster or not. + ${ApiServerAccessProfileEnableVnetIntegration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is System. + # For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + # Allowed values are 'system' and 'none'. + ${ApiServerAccessProfilePrivateDnsZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # It is required when: 1. + # creating a new cluster with BYO Vnet; 2. + # updating an existing cluster to enable apiserver vnet integration. + ${ApiServerAccessProfileSubnetId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if Application Monitoring Auto Instrumentation is enabled or not. + ${AutoInstrumentationEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Valid values are 'true' and 'false' + ${AutoScalerProfileBalanceSimilarNodeGroup}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. + # If the daemonset pod cannot be evicted another node will be chosen for scaling. + # If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + ${AutoScalerProfileDaemonsetEvictionForEmptyNode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. + # If the daemonset pod cannot be evicted another node will be chosen for scaling. + # If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted. + ${AutoScalerProfileDaemonsetEvictionForOccupiedNode}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander] + # Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + ${AutoScalerProfileExpander}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + ${AutoScalerProfileIgnoreDaemonsetsUtilization}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is 10. + ${AutoScalerProfileMaxEmptyBulkDelete}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is 600. + ${AutoScalerProfileMaxGracefulTerminationSec}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '15m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileMaxNodeProvisionTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is 45. + # The maximum is 100 and the minimum is 0. + ${AutoScalerProfileMaxTotalUnreadyPercentage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. + # The default is '0s'. + # Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + ${AutoScalerProfileNewPodScaleUpDelay}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This must be an integer. + # The default is 3. + ${AutoScalerProfileOkTotalUnreadyCount}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '10m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownDelayAfterAdd}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is the scan-interval. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownDelayAfterDelete}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '3m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownDelayAfterFailure}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '10m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownUnneededTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '20m'. + # Values must be an integer followed by an 'm'. + # No unit of time other than minutes (m) is supported. + ${AutoScalerProfileScaleDownUnreadyTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '0.5'. + ${AutoScalerProfileScaleDownUtilizationThreshold}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is '10'. + # Values must be an integer number of seconds. + ${AutoScalerProfileScanInterval}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is true. + ${AutoScalerProfileSkipNodesWithLocalStorage}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The default is true. + ${AutoScalerProfileSkipNodesWithSystemPod}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel] + # The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + ${AutoUpgradeProfileNodeOSUpgradeChannel}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel] + # For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + ${AutoUpgradeProfileUpgradeChannel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Azure Key Vault key management service. + # The default is false. + ${AzureKeyVaultKmEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Identifier of Azure Key Vault key. + # See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. + # When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. + # When Azure Key Vault key management service is disabled, leave the field empty. + ${AzureKeyVaultKmKeyId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes] + # Network access of key vault. + # The possible values are `Public` and `Private`. + # `Public` means the key vault allows public access from all networks. + # `Private` means the key vault disables public access and enables private link. + # The default value is `Public`. + ${AzureKeyVaultKmKeyVaultNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Resource ID of key vault. + # When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. + # When keyVaultNetworkAccess is `Public`, leave the field empty. + ${AzureKeyVaultKmKeyVaultResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable AzureBlob CSI Driver. + # The default value is false. + ${BlobCsiDriverEnabled}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource] + # The source where the artifacts are downloaded from. + ${BootstrapProfileArtifactSource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The resource Id of Azure Container Registry. + # The registry must have private network access, premium SKU and zone redundancy. + ${BootstrapProfileContainerRegistryId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]] + # Istio egress gateways. + # To construct, see NOTES section for COMPONENTEGRESSGATEWAY properties and create a hash table. + ${ComponentEgressGateway}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]] + # Istio ingress gateways. + # To construct, see NOTES section for COMPONENTINGRESSGATEWAY properties and create a hash table. + ${ComponentIngressGateway}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether custom metrics collection has to be disabled or not. + # If not specified the default is false. + # No custom metrics will be emitted if this field is false but the container insights enabled field is false + ${ContainerInsightDisableCustomMetric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether prometheus metrics scraping is disabled or not. + # If not specified the default is false. + # No prometheus metrics will be emitted if this field is false but the container insights enabled field is false + ${ContainerInsightDisablePrometheusMetricsScraping}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + ${ContainerInsightEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + ${ContainerInsightLogAnalyticsWorkspaceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int64] + # The syslog host port. + # If not specified, the default port is 28330. + ${ContainerInsightSyslogPort}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. + # Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. + # If not specified, the default is false. + # For more information see aka.ms/aks/docs/cost-analysis. + ${CostAnalysisEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is the ARM ID of the source object to be used to create the target object. + ${CreationDataSourceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. + # When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. + # When Microsoft Defender is disabled, leave the field empty. + ${DefenderLogAnalyticsWorkspaceResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # If set to true, getting static credentials will be disabled for this cluster. + # This must only be used on Managed Clusters that are AAD enabled. + # For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + ${DisableLocalAccount}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable AzureDisk CSI Driver. + # The default value is true. + ${DiskCsiDriverEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The version of AzureDisk CSI Driver. + # The default value is v1. + ${DiskCsiDriverVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + ${DiskEncryptionSetId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This cannot be updated once the Managed Cluster has been created. + ${DnsPrefix}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The default value is false. + # It can be enabled/disabled on creation and updating of the managed cluster. + # See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM Resource. + ${EnableNamespaceResource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). + # PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. + # Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + ${EnablePodSecurityPolicy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Kubernetes Role-Based Access Control. + ${EnableRbac}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The name of the extended location. + ${ExtendedLocationName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes] + # The type of the extended location. + ${ExtendedLocationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable AzureFile CSI Driver. + # The default value is true. + ${FileCsiDriverEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This cannot be updated once the Managed Cluster has been created. + ${FqdnSubdomain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Specifies the DNS server for Windows gMSA. + # + # + # Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + ${GmsaProfileDnsServer}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Specifies whether to enable Windows gMSA in the managed cluster. + ${GmsaProfileEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Specifies the root domain name for Windows gMSA. + # + # + # Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + ${GmsaProfileRootDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The HTTP proxy server endpoint to use. + ${HttpProxyConfigHttpProxy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The HTTPS proxy server endpoint to use. + ${HttpProxyConfigHttpsProxy}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The endpoints that should not go through proxy. + ${HttpProxyConfigNoProxy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Alternative CA cert to use for connecting to proxy servers. + ${HttpProxyConfigTrustedCa}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources]))] + [System.Collections.Hashtable] + # The delegated identity resources assigned to this managed cluster. + # This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. + # Internal use only. + ${IdentityDelegatedResource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile]))] + [System.Collections.Hashtable] + # Identities associated with the cluster. + ${IdentityProfile}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType] + # For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities]))] + [System.Collections.Hashtable] + # The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Image Cleaner on AKS cluster. + ${ImageCleanerEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int32] + # Image Cleaner scanning interval in hours. + ${ImageCleanerIntervalHour}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable image integrity. + # The default value is false. + ${ImageIntegrityEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The list of revisions of the Istio control plane. + # When an upgrade is not in progress, this holds one value. + # When canary upgrade is in progress, this can only hold two consecutive values. + # For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + ${IstioRevision}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable KEDA. + ${KedaEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is primarily used to expose different UI experiences in the portal for different kinds + ${Kind}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + ${KubeStateMetricAnnotationsAllowList}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + ${KubeStateMetricLabelsAllowlist}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. + # All upgrades must be performed sequentially by major version number. + # For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. + # See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. + ${KubernetesVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The administrator username to use for Linux VMs. + ${LinuxProfileAdminUsername}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable the Prometheus collector + ${MetricEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile] + # The network configuration profile. + # To construct, see NOTES section for NETWORKPROFILE properties and create a hash table. + ${NetworkProfile}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode] + # Once the mode it set to Auto, it cannot be changed back to Manual. + ${NodeProvisioningProfileMode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The name of the resource group containing agent pool nodes. + ${NodeResourceGroup}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel] + # The restriction level applied to the cluster's node resource group + ${NodeResourceGroupProfileRestrictionLevel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Node Restriction + ${NodeRestrictionEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether the OIDC issuer is enabled. + ${OidcIssuerProfileEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + ${OpenTelemetryLogEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int64] + # The Open Telemetry host port for Open Telemetry logs and traces. + # If not specified, the default port is 28331. + ${OpenTelemetryLogPort}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + ${OpenTelemetryMetricEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Int64] + # The Open Telemetry host port for Open Telemetry metrics. + # If not specified, the default port is 28333. + ${OpenTelemetryMetricPort}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to force upgrade the cluster. + # Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. + # Enable this option only with caution. + ${OverrideSettingForceUpgrade}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.DateTime] + # Until when the overrides are effective. + # Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. + # This field is not set by default. + # It must be set for the overrides to take effect. + ${OverrideSettingUntil}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Certificate chain object name in Azure Key Vault. + ${PluginCertChainObjectName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Intermediate certificate object name in Azure Key Vault. + ${PluginCertObjectName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Intermediate certificate private key object name in Azure Key Vault. + ${PluginKeyObjectName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The resource ID of the Key Vault. + ${PluginKeyVaultId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Root certificate object name in Azure Key Vault. + ${PluginRootCertObjectName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + # See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information. + ${PodIdentityProfileAllowNetworkPluginKubenet}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether the pod identity addon is enabled. + ${PodIdentityProfileEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[]] + # The pod identities to use in the cluster. + # To construct, see NOTES section for PODIDENTITYPROFILEUSERASSIGNEDIDENTITY properties and create a hash table. + ${PodIdentityProfileUserAssignedIdentity}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[]] + # The pod identity exceptions to allow. + # To construct, see NOTES section for PODIDENTITYPROFILEUSERASSIGNEDIDENTITYEXCEPTION properties and create a hash table. + ${PodIdentityProfileUserAssignedIdentityException}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[]] + # Private link resources associated with the cluster. + # To construct, see NOTES section for PRIVATELINKRESOURCE properties and create a hash table. + ${PrivateLinkResource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess] + # Allow or deny public network access for AKS + ${PublicNetworkAccess}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # List of namespaces excluded from Safeguards checks + ${SafeguardProfileExcludedNamespace}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level] + # The Safeguards level to be used. + # By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces + ${SafeguardProfileLevel}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The version of constraints to use + ${SafeguardProfileVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Defender threat detection + ${SecurityMonitoringEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([System.Byte[]]))] + [System.Byte[][]] + # A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. + # For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + ${SecurityProfileCustomCaTrustCertificate}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode] + # Mode of the service mesh. + ${ServiceMeshProfileMode}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ID for the service principal. + ${ServicePrincipalProfileClientId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The secret password associated with the service principal in plain text. + ${ServicePrincipalProfileSecret}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName] + # The name of a managed cluster SKU. + ${SkuName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier] + # If not specified, the default is 'Free'. + # See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details. + ${SkuTier}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Snapshot Controller. + # The default value is true. + ${SnapshotControllerEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]] + # The list of SSH public keys used to authenticate with Linux-based VMs. + # A maximum of 1 key may be specified. + # To construct, see NOTES section for SSHPUBLICKEY properties and create a hash table. + ${SshPublicKey}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan] + # The support plan for the Managed Cluster. + # If unspecified, the default is 'KubernetesOfficial'. + ${SupportPlan}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling] + # Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + ${VerticalPodAutoscalerAddonAutoscaling}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable VPA add-on in cluster. + # Default value is false. + ${VerticalPodAutoscalerEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # Resource IDs of the DNS zones to be associated with the Web App Routing add-on. + # Used only when Web App Routing is enabled. + # Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. + ${WebAppRoutingDnsZoneResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Web App Routing. + ${WebAppRoutingEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Specifies the password of the administrator account. + # + # + # **Minimum-length:** 8 characters + # + # **Max-length:** 123 characters + # + # **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + # Has lower characters + # Has upper characters + # Has a digit + # Has a special character (Regex match [\W_]) + # + # **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ${WindowProfileAdminPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # Specifies the name of the administrator account. + # + # + # **Restriction:** Cannot end in "." + # + # **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + # + # + # **Minimum-length:** 1 character + # + # **Max-length:** 20 characters + ${WindowProfileAdminUsername}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + ${WindowProfileEnableCsiProxy}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType] + # The license type to use for Windows VMs. + # See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. + ${WindowProfileLicenseType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable workload identity. + ${WorkloadIdentityEnabled}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceManagedCluster_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates a snapshot. +.Description +Creates or updates a snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicesnapshot +#> +function New-AzContainerServiceSnapshot { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The geo-location where the resource lives + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # This is the ARM ID of the source object to be used to create the target object. + ${CreationDataSourceResourceId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType])] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType] + # The type of a snapshot. + # The default is NodePool. + ${SnapshotType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceSnapshot_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create or update a trusted access role binding +.Description +Create or update a trusted access role binding +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/new-azcontainerservicetrustedaccessrolebinding +#> +function New-AzContainerServiceTrustedAccessRoleBinding { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('TrustedAccessRoleBindingName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of trusted access role binding. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # A list of roles to bind, each item is a resource type qualified role name. + # For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + ${Role}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ARM resource ID of source resource that trusted access is configured for. + ${SourceResourceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.ContainerService.private\New-AzContainerServiceTrustedAccessRoleBinding_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes specific machines in an agent pool. +.Description +Deletes specific machines in an agent pool. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +MACHINE : Specifies a list of machine names from the agent pool to be deleted. + MachineName : The agent pool machine names. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceagentpoolmachine +#> +function Remove-AzContainerServiceAgentPoolMachine { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='DeleteExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='DeleteExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Delete', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter] + # Specifies a list of machine names from the agent pool to be deleted. + # To construct, see NOTES section for MACHINE properties and create a hash table. + ${Machine}, + + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The agent pool machine names. + ${MachineName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPoolMachine_Delete'; + DeleteExpanded = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPoolMachine_DeleteExpanded'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPoolMachine_DeleteViaIdentity'; + DeleteViaIdentityExpanded = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded'; + } + if (('Delete', 'DeleteExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes an agent pool in the specified managed cluster. +.Description +Deletes an agent pool in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceagentpool +#> +function Remove-AzContainerServiceAgentPool { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('AgentPoolName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.Management.Automation.SwitchParameter] + # ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + ${IgnorePodDisruptionBudget}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPool_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPool_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes a load balancer in the specified managed cluster. +.Description +Deletes a load balancer in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceloadbalancer +#> +function Remove-AzContainerServiceLoadBalancer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('LoadBalancerName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the load balancer. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceLoadBalancer_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceLoadBalancer_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes a maintenance configuration. +.Description +Deletes a maintenance configuration. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicemaintenanceconfiguration +#> +function Remove-AzContainerServiceMaintenanceConfiguration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the maintenance configuration. + ${ConfigName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceMaintenanceConfiguration_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceMaintenanceConfiguration_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes a managed cluster snapshot. +.Description +Deletes a managed cluster snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicemanagedclustersnapshot +#> +function Remove-AzContainerServiceManagedClusterSnapshot { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceManagedClusterSnapshot_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceManagedClusterSnapshot_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes a managed cluster. +.Description +Deletes a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicemanagedcluster +#> +function Remove-AzContainerServiceManagedCluster { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.Management.Automation.SwitchParameter] + # ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + ${IgnorePodDisruptionBudget}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceManagedCluster_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceManagedCluster_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes a private endpoint connection. +.Description +Deletes a private endpoint connection. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceprivateendpointconnection +#> +function Remove-AzContainerServicePrivateEndpointConnection { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the private endpoint connection. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServicePrivateEndpointConnection_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServicePrivateEndpointConnection_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes a snapshot. +.Description +Deletes a snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicesnapshot +#> +function Remove-AzContainerServiceSnapshot { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceSnapshot_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceSnapshot_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Delete a trusted access role binding. +.Description +Delete a trusted access role binding. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicetrustedaccessrolebinding +#> +function Remove-AzContainerServiceTrustedAccessRoleBinding { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('TrustedAccessRoleBindingName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of trusted access role binding. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceTrustedAccessRoleBinding_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +**WARNING**: This API will be deprecated. +Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. +.Description +**WARNING**: This API will be deprecated. +Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +PARAMETER : For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + [AdminGroupObjectID ]: The list of AAD group object IDs that will have admin role of the cluster. + [ClientAppId ]: (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + [EnableAzureRbac ]: Whether to enable Azure RBAC for Kubernetes authorization. + [Managed ]: Whether to enable managed AAD. + [ServerAppId ]: (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + [ServerAppSecret ]: (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + [TenantId ]: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/reset-azcontainerservicemanagedclusteraadprofile +#> +function Reset-AzContainerServiceManagedClusterAadProfile { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='ResetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Reset', Mandatory)] + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Reset', Mandatory)] + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Reset')] + [Parameter(ParameterSetName='ResetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ResetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ResetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Reset', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ResetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile] + # For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The list of AAD group object IDs that will have admin role of the cluster. + ${AdminGroupObjectID}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The client AAD application ID. + # Learn more at https://aka.ms/aks/aad-legacy. + ${ClientAppId}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Azure RBAC for Kubernetes authorization. + ${EnableAzureRbac}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable managed AAD. + ${Managed}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The server AAD application ID. + # Learn more at https://aka.ms/aks/aad-legacy. + ${ServerAppId}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The server AAD application secret. + # Learn more at https://aka.ms/aks/aad-legacy. + ${ServerAppSecret}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The AAD tenant ID to use for authentication. + # If not specified, will use the tenant of the deployment subscription. + ${TenantId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Reset = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterAadProfile_Reset'; + ResetExpanded = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterAadProfile_ResetExpanded'; + ResetViaIdentity = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterAadProfile_ResetViaIdentity'; + ResetViaIdentityExpanded = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded'; + } + if (('Reset', 'ResetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This action cannot be performed on a cluster that is not using a service principal +.Description +This action cannot be performed on a cluster that is not using a service principal +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +PARAMETER : Information about a service principal identity for the cluster to use for manipulating Azure APIs. + ClientId : The ID for the service principal. + [Secret ]: The secret password associated with the service principal in plain text. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/reset-azcontainerservicemanagedclusterserviceprincipalprofile +#> +function Reset-AzContainerServiceManagedClusterServicePrincipalProfile { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='ResetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Reset', Mandatory)] + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Reset', Mandatory)] + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Reset')] + [Parameter(ParameterSetName='ResetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ResetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ResetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Reset', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ResetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile] + # Information about a service principal identity for the cluster to use for manipulating Azure APIs. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Parameter(ParameterSetName='ResetViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ID for the service principal. + ${ClientId}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The secret password associated with the service principal in plain text. + ${Secret}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Reset = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterServicePrincipalProfile_Reset'; + ResetExpanded = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded'; + ResetViaIdentity = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity'; + ResetViaIdentityExpanded = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded'; + } + if (('Reset', 'ResetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +AKS will create a pod to run the command. +This is primarily useful for private clusters. +For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). +.Description +AKS will create a pod to run the command. +This is primarily useful for private clusters. +For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +REQUESTPAYLOAD : A run command request + Command : The command to run. + [ClusterToken ]: AuthToken issued for AKS AAD Server App. + [Context ]: A base64 encoded zip file containing the files required by the command. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/start-azcontainerservicemanagedclustercommand +#> +function Start-AzContainerServiceManagedClusterCommand { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult])] +[CmdletBinding(DefaultParameterSetName='RunExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Run', Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Run', Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Run')] + [Parameter(ParameterSetName='RunExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RunViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Run', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RunViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest] + # A run command request + # To construct, see NOTES section for REQUESTPAYLOAD properties and create a hash table. + ${RequestPayload}, + + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The command to run. + ${Command}, + + [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # AuthToken issued for AKS AAD Server App. + ${ClusterToken}, + + [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # A base64 encoded zip file containing the files required by the command. + ${Context}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Run = 'Az.ContainerService.private\Start-AzContainerServiceManagedClusterCommand_Run'; + RunExpanded = 'Az.ContainerService.private\Start-AzContainerServiceManagedClusterCommand_RunExpanded'; + RunViaIdentity = 'Az.ContainerService.private\Start-AzContainerServiceManagedClusterCommand_RunViaIdentity'; + RunViaIdentityExpanded = 'Az.ContainerService.private\Start-AzContainerServiceManagedClusterCommand_RunViaIdentityExpanded'; + } + if (('Run', 'RunExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. +.Description +See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/start-azcontainerservicemanagedcluster +#> +function Start-AzContainerServiceManagedCluster { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Start', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Start', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Start', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Start')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='StartViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Start = 'Az.ContainerService.private\Start-AzContainerServiceManagedCluster_Start'; + StartViaIdentity = 'Az.ContainerService.private\Start-AzContainerServiceManagedCluster_StartViaIdentity'; + } + if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This can only be performed on Azure Virtual Machine Scale set backed clusters. +Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. +A cluster does not accrue charges while it is stopped. +See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. +.Description +This can only be performed on Azure Virtual Machine Scale set backed clusters. +Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. +A cluster does not accrue charges while it is stopped. +See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/stop-azcontainerservicemanagedcluster +#> +function Stop-AzContainerServiceManagedCluster { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Stop', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Stop', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Stop', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Stop')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='StopViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Stop = 'Az.ContainerService.private\Stop-AzContainerServiceManagedCluster_Stop'; + StopViaIdentity = 'Az.ContainerService.private\Stop-AzContainerServiceManagedCluster_StopViaIdentity'; + } + if (('Stop') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. +AKS provides one new image per week with the latest updates. +For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade +.Description +Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. +AKS provides one new image per week with the latest updates. +For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerserviceagentpoolnodeimageversion +#> +function Update-AzContainerServiceAgentPoolNodeImageVersion { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Upgrade', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Upgrade', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Upgrade', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Upgrade', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Upgrade')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpgradeViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Upgrade = 'Az.ContainerService.private\Update-AzContainerServiceAgentPoolNodeImageVersion_Upgrade'; + UpgradeViaIdentity = 'Az.ContainerService.private\Update-AzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity'; + } + if (('Upgrade') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Updates tags on a managed cluster snapshot. +.Description +Updates tags on a managed cluster snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerservicemanagedclustersnapshottag +#> +function Update-AzContainerServiceManagedClusterSnapshotTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.ContainerService.private\Update-AzContainerServiceManagedClusterSnapshotTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ContainerService.private\Update-AzContainerServiceManagedClusterSnapshotTag_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Updates tags on a managed cluster. +.Description +Updates tags on a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerservicemanagedclustertag +#> +function Update-AzContainerServiceManagedClusterTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.ContainerService.private\Update-AzContainerServiceManagedClusterTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ContainerService.private\Update-AzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Updates tags on a snapshot. +.Description +Updates tags on a snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerservicesnapshottag +#> +function Update-AzContainerServiceSnapshotTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.ContainerService.private\Update-AzContainerServiceSnapshotTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ContainerService.private\Update-AzContainerServiceSnapshotTag_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/README.md b/swaggerci/containerservice.DefaultTag/exports/README.md new file mode 100644 index 000000000000..3a457342aaeb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/README.md @@ -0,0 +1,20 @@ +# Exports +This directory contains the cmdlets *exported by* `Az.ContainerService`. No other cmdlets in this repository are directly exported. What that means is the `Az.ContainerService` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`../bin/Az.ContainerService.private.dll`) and from the `../custom/Az.ContainerService.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](../internal/README.md) in the `../internal` folder. + +## Purpose +We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles. + +## Structure +The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile. + +## Usage +When `./Az.ContainerService.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message. \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceAgentPool.ps1 b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceAgentPool.ps1 new file mode 100644 index 000000000000..1541349bdf9b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceAgentPool.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes an agent pool in the specified managed cluster. +.Description +Deletes an agent pool in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceagentpool +#> +function Remove-AzContainerServiceAgentPool { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('AgentPoolName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.Management.Automation.SwitchParameter] + # ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + ${IgnorePodDisruptionBudget}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPool_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPool_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceAgentPoolMachine.ps1 b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceAgentPoolMachine.ps1 new file mode 100644 index 000000000000..0f0436fead3d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceAgentPoolMachine.ps1 @@ -0,0 +1,261 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes specific machines in an agent pool. +.Description +Deletes specific machines in an agent pool. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +MACHINE : Specifies a list of machine names from the agent pool to be deleted. + MachineName : The agent pool machine names. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceagentpoolmachine +#> +function Remove-AzContainerServiceAgentPoolMachine { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='DeleteExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='DeleteExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Delete', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter] + # Specifies a list of machine names from the agent pool to be deleted. + # To construct, see NOTES section for MACHINE properties and create a hash table. + ${Machine}, + + [Parameter(ParameterSetName='DeleteExpanded', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The agent pool machine names. + ${MachineName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPoolMachine_Delete'; + DeleteExpanded = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPoolMachine_DeleteExpanded'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPoolMachine_DeleteViaIdentity'; + DeleteViaIdentityExpanded = 'Az.ContainerService.private\Remove-AzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded'; + } + if (('Delete', 'DeleteExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceLoadBalancer.ps1 b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceLoadBalancer.ps1 new file mode 100644 index 000000000000..05c494932b58 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceLoadBalancer.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes a load balancer in the specified managed cluster. +.Description +Deletes a load balancer in the specified managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceloadbalancer +#> +function Remove-AzContainerServiceLoadBalancer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('LoadBalancerName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the load balancer. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceLoadBalancer_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceLoadBalancer_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceMaintenanceConfiguration.ps1 b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceMaintenanceConfiguration.ps1 new file mode 100644 index 000000000000..f786ad774208 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceMaintenanceConfiguration.ps1 @@ -0,0 +1,227 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes a maintenance configuration. +.Description +Deletes a maintenance configuration. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicemaintenanceconfiguration +#> +function Remove-AzContainerServiceMaintenanceConfiguration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the maintenance configuration. + ${ConfigName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceMaintenanceConfiguration_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceMaintenanceConfiguration_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceManagedCluster.ps1 b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceManagedCluster.ps1 new file mode 100644 index 000000000000..557d00a285b4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceManagedCluster.ps1 @@ -0,0 +1,245 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes a managed cluster. +.Description +Deletes a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicemanagedcluster +#> +function Remove-AzContainerServiceManagedCluster { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Query')] + [System.Management.Automation.SwitchParameter] + # ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + ${IgnorePodDisruptionBudget}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceManagedCluster_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceManagedCluster_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceManagedClusterSnapshot.ps1 b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceManagedClusterSnapshot.ps1 new file mode 100644 index 000000000000..9b465897908b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceManagedClusterSnapshot.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes a managed cluster snapshot. +.Description +Deletes a managed cluster snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicemanagedclustersnapshot +#> +function Remove-AzContainerServiceManagedClusterSnapshot { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceManagedClusterSnapshot_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceManagedClusterSnapshot_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServicePrivateEndpointConnection.ps1 b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServicePrivateEndpointConnection.ps1 new file mode 100644 index 000000000000..683654ee946a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServicePrivateEndpointConnection.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes a private endpoint connection. +.Description +Deletes a private endpoint connection. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerserviceprivateendpointconnection +#> +function Remove-AzContainerServicePrivateEndpointConnection { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the private endpoint connection. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServicePrivateEndpointConnection_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServicePrivateEndpointConnection_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceSnapshot.ps1 b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceSnapshot.ps1 new file mode 100644 index 000000000000..c40dcfc3026f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceSnapshot.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes a snapshot. +.Description +Deletes a snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicesnapshot +#> +function Remove-AzContainerServiceSnapshot { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceSnapshot_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceSnapshot_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceTrustedAccessRoleBinding.ps1 b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceTrustedAccessRoleBinding.ps1 new file mode 100644 index 000000000000..a6952fd53cfa --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Remove-AzContainerServiceTrustedAccessRoleBinding.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Delete a trusted access role binding. +.Description +Delete a trusted access role binding. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/remove-azcontainerservicetrustedaccessrolebinding +#> +function Remove-AzContainerServiceTrustedAccessRoleBinding { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('TrustedAccessRoleBindingName')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of trusted access role binding. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.ContainerService.private\Remove-AzContainerServiceTrustedAccessRoleBinding_Delete'; + DeleteViaIdentity = 'Az.ContainerService.private\Remove-AzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Reset-AzContainerServiceManagedClusterAadProfile.ps1 b/swaggerci/containerservice.DefaultTag/exports/Reset-AzContainerServiceManagedClusterAadProfile.ps1 new file mode 100644 index 000000000000..e00cf0bc6517 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Reset-AzContainerServiceManagedClusterAadProfile.ps1 @@ -0,0 +1,314 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +**WARNING**: This API will be deprecated. +Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. +.Description +**WARNING**: This API will be deprecated. +Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +PARAMETER : For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + [AdminGroupObjectID ]: The list of AAD group object IDs that will have admin role of the cluster. + [ClientAppId ]: (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + [EnableAzureRbac ]: Whether to enable Azure RBAC for Kubernetes authorization. + [Managed ]: Whether to enable managed AAD. + [ServerAppId ]: (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + [ServerAppSecret ]: (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + [TenantId ]: The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/reset-azcontainerservicemanagedclusteraadprofile +#> +function Reset-AzContainerServiceManagedClusterAadProfile { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='ResetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Reset', Mandatory)] + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Reset', Mandatory)] + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Reset')] + [Parameter(ParameterSetName='ResetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ResetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ResetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Reset', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ResetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile] + # For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String[]] + # The list of AAD group object IDs that will have admin role of the cluster. + ${AdminGroupObjectID}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The client AAD application ID. + # Learn more at https://aka.ms/aks/aad-legacy. + ${ClientAppId}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable Azure RBAC for Kubernetes authorization. + ${EnableAzureRbac}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Whether to enable managed AAD. + ${Managed}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The server AAD application ID. + # Learn more at https://aka.ms/aks/aad-legacy. + ${ServerAppId}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # (DEPRECATED) The server AAD application secret. + # Learn more at https://aka.ms/aks/aad-legacy. + ${ServerAppSecret}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The AAD tenant ID to use for authentication. + # If not specified, will use the tenant of the deployment subscription. + ${TenantId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Reset = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterAadProfile_Reset'; + ResetExpanded = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterAadProfile_ResetExpanded'; + ResetViaIdentity = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterAadProfile_ResetViaIdentity'; + ResetViaIdentityExpanded = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded'; + } + if (('Reset', 'ResetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.ps1 b/swaggerci/containerservice.DefaultTag/exports/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.ps1 new file mode 100644 index 000000000000..3a78e763cc25 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.ps1 @@ -0,0 +1,267 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This action cannot be performed on a cluster that is not using a service principal +.Description +This action cannot be performed on a cluster that is not using a service principal +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +PARAMETER : Information about a service principal identity for the cluster to use for manipulating Azure APIs. + ClientId : The ID for the service principal. + [Secret ]: The secret password associated with the service principal in plain text. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/reset-azcontainerservicemanagedclusterserviceprincipalprofile +#> +function Reset-AzContainerServiceManagedClusterServicePrincipalProfile { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='ResetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Reset', Mandatory)] + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Reset', Mandatory)] + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Reset')] + [Parameter(ParameterSetName='ResetExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ResetViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ResetViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Reset', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ResetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile] + # Information about a service principal identity for the cluster to use for manipulating Azure APIs. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ResetExpanded', Mandatory)] + [Parameter(ParameterSetName='ResetViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The ID for the service principal. + ${ClientId}, + + [Parameter(ParameterSetName='ResetExpanded')] + [Parameter(ParameterSetName='ResetViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The secret password associated with the service principal in plain text. + ${Secret}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Reset = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterServicePrincipalProfile_Reset'; + ResetExpanded = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded'; + ResetViaIdentity = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity'; + ResetViaIdentityExpanded = 'Az.ContainerService.private\Reset-AzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded'; + } + if (('Reset', 'ResetExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Start-AzContainerServiceManagedCluster.ps1 b/swaggerci/containerservice.DefaultTag/exports/Start-AzContainerServiceManagedCluster.ps1 new file mode 100644 index 000000000000..ed2b4e1fe3ee --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Start-AzContainerServiceManagedCluster.ps1 @@ -0,0 +1,233 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. +.Description +See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/start-azcontainerservicemanagedcluster +#> +function Start-AzContainerServiceManagedCluster { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Start', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Start', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Start', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Start')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='StartViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Start = 'Az.ContainerService.private\Start-AzContainerServiceManagedCluster_Start'; + StartViaIdentity = 'Az.ContainerService.private\Start-AzContainerServiceManagedCluster_StartViaIdentity'; + } + if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Start-AzContainerServiceManagedClusterCommand.ps1 b/swaggerci/containerservice.DefaultTag/exports/Start-AzContainerServiceManagedClusterCommand.ps1 new file mode 100644 index 000000000000..94a02919e16e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Start-AzContainerServiceManagedClusterCommand.ps1 @@ -0,0 +1,273 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +AKS will create a pod to run the command. +This is primarily useful for private clusters. +For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). +.Description +AKS will create a pod to run the command. +This is primarily useful for private clusters. +For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version + +REQUESTPAYLOAD : A run command request + Command : The command to run. + [ClusterToken ]: AuthToken issued for AKS AAD Server App. + [Context ]: A base64 encoded zip file containing the files required by the command. +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/start-azcontainerservicemanagedclustercommand +#> +function Start-AzContainerServiceManagedClusterCommand { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult])] +[CmdletBinding(DefaultParameterSetName='RunExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Run', Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Run', Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Run')] + [Parameter(ParameterSetName='RunExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RunViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Run', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RunViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest] + # A run command request + # To construct, see NOTES section for REQUESTPAYLOAD properties and create a hash table. + ${RequestPayload}, + + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # The command to run. + ${Command}, + + [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # AuthToken issued for AKS AAD Server App. + ${ClusterToken}, + + [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [System.String] + # A base64 encoded zip file containing the files required by the command. + ${Context}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Run = 'Az.ContainerService.private\Start-AzContainerServiceManagedClusterCommand_Run'; + RunExpanded = 'Az.ContainerService.private\Start-AzContainerServiceManagedClusterCommand_RunExpanded'; + RunViaIdentity = 'Az.ContainerService.private\Start-AzContainerServiceManagedClusterCommand_RunViaIdentity'; + RunViaIdentityExpanded = 'Az.ContainerService.private\Start-AzContainerServiceManagedClusterCommand_RunViaIdentityExpanded'; + } + if (('Run', 'RunExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Stop-AzContainerServiceManagedCluster.ps1 b/swaggerci/containerservice.DefaultTag/exports/Stop-AzContainerServiceManagedCluster.ps1 new file mode 100644 index 000000000000..1745ad009b80 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Stop-AzContainerServiceManagedCluster.ps1 @@ -0,0 +1,239 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This can only be performed on Azure Virtual Machine Scale set backed clusters. +Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. +A cluster does not accrue charges while it is stopped. +See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. +.Description +This can only be performed on Azure Virtual Machine Scale set backed clusters. +Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. +A cluster does not accrue charges while it is stopped. +See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/stop-azcontainerservicemanagedcluster +#> +function Stop-AzContainerServiceManagedCluster { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Stop', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Stop', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Stop', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Stop')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='StopViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Stop = 'Az.ContainerService.private\Stop-AzContainerServiceManagedCluster_Stop'; + StopViaIdentity = 'Az.ContainerService.private\Stop-AzContainerServiceManagedCluster_StopViaIdentity'; + } + if (('Stop') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceAgentPoolNodeImageVersion.ps1 b/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceAgentPoolNodeImageVersion.ps1 new file mode 100644 index 000000000000..d8edcd03ada5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceAgentPoolNodeImageVersion.ps1 @@ -0,0 +1,243 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. +AKS provides one new image per week with the latest updates. +For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade +.Description +Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. +AKS provides one new image per week with the latest updates. +For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerserviceagentpoolnodeimageversion +#> +function Update-AzContainerServiceAgentPoolNodeImageVersion { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Upgrade', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Upgrade', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the agent pool. + ${AgentPoolName}, + + [Parameter(ParameterSetName='Upgrade', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Upgrade', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='Upgrade')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpgradeViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Upgrade = 'Az.ContainerService.private\Update-AzContainerServiceAgentPoolNodeImageVersion_Upgrade'; + UpgradeViaIdentity = 'Az.ContainerService.private\Update-AzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity'; + } + if (('Upgrade') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceManagedClusterSnapshotTag.ps1 b/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceManagedClusterSnapshotTag.ps1 new file mode 100644 index 000000000000..790da6b75949 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceManagedClusterSnapshotTag.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates tags on a managed cluster snapshot. +.Description +Updates tags on a managed cluster snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerservicemanagedclustersnapshottag +#> +function Update-AzContainerServiceManagedClusterSnapshotTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.ContainerService.private\Update-AzContainerServiceManagedClusterSnapshotTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ContainerService.private\Update-AzContainerServiceManagedClusterSnapshotTag_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceManagedClusterTag.ps1 b/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceManagedClusterTag.ps1 new file mode 100644 index 000000000000..913d8aa260ac --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceManagedClusterTag.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates tags on a managed cluster. +.Description +Updates tags on a managed cluster. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerservicemanagedclustertag +#> +function Update-AzContainerServiceManagedClusterTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Header')] + [System.String] + # The request should only proceed if an entity matches this string. + ${IfMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.ContainerService.private\Update-AzContainerServiceManagedClusterTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ContainerService.private\Update-AzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceSnapshotTag.ps1 b/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceSnapshotTag.ps1 new file mode 100644 index 000000000000..cf6f60695129 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/exports/Update-AzContainerServiceSnapshotTag.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates tags on a snapshot. +.Description +Updates tags on a snapshot. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot +.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 + [AgentPoolName ]: The name of the agent pool. + [CommandId ]: Id of the command. + [ConfigName ]: The name of the maintenance configuration. + [Id ]: Resource identity path + [LoadBalancerName ]: The name of the load balancer. + [Location ]: The name of the Azure region. + [MachineName ]: host name of the machine + [Mode ]: The mode of the mesh. + [OperationId ]: The ID of an ongoing async operation. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ResourceName ]: The name of the managed cluster resource. + [RoleName ]: The name of the role for managed cluster accessProfile resource. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrustedAccessRoleBindingName ]: The name of trusted access role binding. + [Version ]: Safeguards version +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/update-azcontainerservicesnapshottag +#> +function Update-AzContainerServiceSnapshotTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [System.String] + # The name of the managed cluster resource. + ${ResourceName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + # The value must be an UUID. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.ContainerService.private\Update-AzContainerServiceSnapshotTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.ContainerService.private\Update-AzContainerServiceSnapshotTag_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/generate-help.ps1 b/swaggerci/containerservice.DefaultTag/generate-help.ps1 new file mode 100644 index 000000000000..facefccb3144 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generate-help.ps1 @@ -0,0 +1,66 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# 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) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(-not (Test-Path $exportsFolder)) { + Write-Error "Exports folder '$exportsFolder' was not found." +} + +$directories = Get-ChildItem -Directory -Path $exportsFolder +$hasProfiles = ($directories | Measure-Object).Count -gt 0 +if(-not $hasProfiles) { + $directories = Get-Item -Path $exportsFolder +} + +$docsFolder = Join-Path $PSScriptRoot 'docs' +if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue +$examplesFolder = Join-Path $PSScriptRoot 'examples' + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.ContainerService.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.ContainerService.private.dll') +$instance = [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName + +foreach($directory in $directories) +{ + if($hasProfiles) { + Select-AzProfile -Name $directory.Name + } + # Reload module per profile + Import-Module -Name $modulePath -Force + + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName + $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full } + $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo + + $docsPath = Join-Path $docsFolder $directory.Name + $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue + $examplesPath = Join-Path $examplesFolder $directory.Name + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath -AddComplexInterfaceInfo:$addComplexInterfaceInfo + Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generate-portal-ux.ps1 b/swaggerci/containerservice.DefaultTag/generate-portal-ux.ps1 new file mode 100644 index 000000000000..ef75d83669fa --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generate-portal-ux.ps1 @@ -0,0 +1,367 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# +# This Script will create a folder dedicated to Azure-specific content and includes metadata files essential for enhancing the user experience (UX) within the Azure portal. +# These files are utilized by the Azure portal to effectively present the usage of cmdlets related to specific resources on portal pages. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$moduleName = 'Az.ContainerService' +$rootModuleName = '' +if ($rootModuleName -eq "") +{ + $rootModuleName = $moduleName +} +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot "./$moduleName.psd1") +$modulePath = $modulePsd1.FullName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot "./bin/$moduleName.private.dll") +$instance = [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName +$parameterSetsInfo = Get-Module -Name "$moduleName.private" + +$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet") + +function Test-FunctionSupported() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + If ($buildinfunctions.Contains($FunctionName)) { + return $false + } + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity")) { + return $false + } + If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) { + return $false + } + + $parameterSetInfo = $parameterSetsInfo.ExportedCmdlets[$FunctionName] + foreach ($parameterInfo in $parameterSetInfo.Parameters.Values) + { + $category = (Get-ParameterAttribute -ParameterInfo $parameterInfo -AttributeName "CategoryAttribute").Categories + $invalideCategory = @('Query', 'Body') + if ($invalideCategory -contains $category) + { + return $false + } + } + + $customFiles = Get-ChildItem -Path custom -Filter "$cmdletName.*" + if ($customFiles.Length -ne 0) + { + return $false + } + + return $true +} + +function Get-MappedCmdletFromFunctionName() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + + return $cmdletName +} + +function Get-ParameterAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo, + [Parameter()] + [String] + $AttributeName + ) + return $ParameterInfo.Attributes | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $CmdletInfo, + [Parameter()] + [String] + $AttributeName + ) + + return $CmdletInfo.ImplementingType.GetTypeInfo().GetCustomAttributes([System.object], $true) | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletDescription() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [String] + $CmdletName + ) + $helpInfo = Get-Help $CmdletName -Full + + $description = $helpInfo.Description.Text + if ($null -eq $description) + { + return "" + } + return $description +} + +# Test whether the parameter is from swagger http path +function Test-ParameterFromSwagger() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo + ) + $category = (Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "CategoryAttribute").Categories + $doNotExport = Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "DoNotExportAttribute" + if ($null -ne $doNotExport) + { + return $false + } + + $valideCategory = @('Path') + if ($valideCategory -contains $category) + { + return $true + } + return $false +} + +function New-ExampleForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $category = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "CategoryAttribute").Categories + $sourceName = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "InfoAttribute").SerializedName + $name = $parameter.Name + $result += [ordered]@{ + name = "-$Name" + value = "[$category.$sourceName]" + } + } + + return $result +} + +function New-ParameterArrayInParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $isMandatory = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "ParameterAttribute").Mandatory + $parameterName = $parameter.Name + $parameterType = $parameter.ParameterType.ToString().Split('.')[1] + if ($parameter.SwitchParameter) + { + $parameterSignature = "-$parameterName" + } + else + { + $parameterSignature = "-$parameterName <$parameterType>" + } + if ($parameterName -eq "SubscriptionId") + { + $isMandatory = $false + } + if (-not $isMandatory) + { + $parameterSignature = "[$parameterSignature]" + } + $result += $parameterSignature + } + + return $result +} + +function New-MetadataForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $httpAttribute = Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "HttpPathAttribute" + $httpPath = $httpAttribute.Path + $apiVersion = $httpAttribute.ApiVersion + $provider = [System.Text.RegularExpressions.Regex]::New("/providers/([\w+\.]+)/").Match($httpPath).Groups[1].Value + $resourcePath = "/" + $httpPath.Split("$provider/")[1] + $resourceType = [System.Text.RegularExpressions.Regex]::New("/([\w]+)/\{\w+\}").Matches($resourcePath) | ForEach-Object {$_.groups[1].Value} | Join-String -Separator "/" + $cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name + $description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description + [object[]]$example = New-ExampleForParameterSet $ParameterSetInfo + [string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo + + return @{ + Path = $httpPath + Provider = $provider + ResourceType = $resourceType + ApiVersion = $apiVersion + CmdletName = $cmdletName + Description = $description + Example = $example + Signature = @{ + parameters = $signature + } + } +} + +function Merge-WithExistCmdletMetadata() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Collections.Specialized.OrderedDictionary] + $ExistedCmdletInfo, + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $ExistedCmdletInfo.help.parameterSets += $ParameterSetMetadata.Signature + $ExistedCmdletInfo.examples += [ordered]@{ + description = $ParameterSetMetadata.Description + parameters = $ParameterSetMetadata.Example + } + + return $ExistedCmdletInfo +} + +function New-MetadataForCmdlet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $cmdletName = $ParameterSetMetadata.CmdletName + $description = Get-CmdletDescription $cmdletName + $result = [ordered]@{ + name = $cmdletName + description = $description + path = $ParameterSetMetadata.Path + help = [ordered]@{ + learnMore = [ordered]@{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName/$cmdletName".ToLower() + } + parameterSets = @() + } + examples = @() + } + $result = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $result -ParameterSetMetadata $ParameterSetMetadata + return $result +} + +$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) } +$resourceTypes = @{} +foreach ($parameterSetName in $parameterSets) +{ + $cmdletInfo = $parameterSetsInfo.ExportedCommands[$parameterSetName] + $parameterSetMetadata = New-MetadataForParameterSet -ParameterSetInfo $cmdletInfo + $cmdletName = $parameterSetMetadata.CmdletName + if (-not ($moduleInfo.ExportedCommands.ContainsKey($cmdletName))) + { + continue + } + if ($resourceTypes.ContainsKey($parameterSetMetadata.ResourceType)) + { + $ExistedCmdletInfo = $resourceTypes[$parameterSetMetadata.ResourceType].commands | Where-Object { $_.name -eq $cmdletName } + if ($ExistedCmdletInfo) + { + $ExistedCmdletInfo = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $ExistedCmdletInfo -ParameterSetMetadata $parameterSetMetadata + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType].commands += $cmdletInfo + } + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType] = [ordered]@{ + resourceType = $parameterSetMetadata.ResourceType + apiVersion = $parameterSetMetadata.ApiVersion + learnMore = @{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName".ToLower() + } + commands = @($cmdletInfo) + provider = $parameterSetMetadata.Provider + } + } +} + +$UXFolder = 'UX' +if (Test-Path $UXFolder) +{ + Remove-Item -Path $UXFolder -Recurse +} +$null = New-Item -ItemType Directory -Path $UXFolder + +foreach ($resourceType in $resourceTypes.Keys) +{ + $resourceTypeFileName = $resourceType -replace "/", "-" + if ($resourceTypeFileName -eq "") + { + continue + } + $resourceTypeInfo = $resourceTypes[$resourceType] + $provider = $resourceTypeInfo.provider + $providerFolder = "$UXFolder/$provider" + if (-not (Test-Path $providerFolder)) + { + $null = New-Item -ItemType Directory -Path $providerFolder + } + $resourceTypeInfo.Remove("provider") + $resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json" +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/Module.cs b/swaggerci/containerservice.DefaultTag/generated/Module.cs new file mode 100644 index 000000000000..9ef19714f9da --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/Module.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>; + using GetParameterDelegate = global::System.Func; + using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using ArgumentCompleterDelegate = global::System.Func; + using GetTelemetryIdDelegate = global::System.Func; + using TelemetryDelegate = global::System.Action; + using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; + using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; + using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using SanitizerDelegate = global::System.Action; + using GetTelemetryInfoDelegate = global::System.Func>; + + /// A class that contains the module-common code and data. + public partial class Module + { + /// The currently selected profile. + public string Profile = global::System.String.Empty; + + public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + + /// the ISendAsync pipeline instance + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline _pipeline; + + /// the ISendAsync pipeline instance (when proxy is enabled) + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline _pipelineWithProxy; + + public bool _useProxy = false; + + public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); + + /// Gets completion data for azure specific fields + public ArgumentCompleterDelegate ArgumentCompleter { get; set; } + + /// The instance of the Client API + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient ClientAPI { get; set; } + + /// A delegate that gets called for each signalled event + public EventListenerDelegate EventListener { get; set; } + + /// The delegate to call to get parameter data from a common module. + public GetParameterDelegate GetParameterValue { get; set; } + + /// The delegate to get the telemetry Id. + public GetTelemetryIdDelegate GetTelemetryId { get; set; } + + /// The delegate to get the telemetry info. + public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } + + /// Backing field for property. + private static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module _instance; + + /// the singleton of this module class + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module()); + + /// The Name of this module + public string Name => @"Az.ContainerService"; + + /// The delegate to call when this module is loaded (supporting a commmon module). + public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } + + /// The delegate to call before each new request (supporting a commmon module). + public NewRequestPipelineDelegate OnNewRequest { get; set; } + + /// The name of the currently selected Azure profile + public global::System.String ProfileName { get; set; } + + /// The ResourceID for this module (azure arm). + public string ResourceId => @"Az.ContainerService"; + + /// The delegate to call in WriteObject to sanitize the output object. + public SanitizerDelegate SanitizeOutput { get; set; } + + /// The delegate for creating a telemetry. + public TelemetryDelegate Telemetry { get; set; } + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline pipeline); + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline pipeline); + + partial void CustomInit(); + + /// Creates an instance of the HttpPipeline for each call. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the cmdlet's parameterset name. + /// a dict for extensible parameters + /// An instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline for the remote call. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline pipeline = null; + BeforeCreatePipeline(invocationInfo, ref pipeline); + pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone(); + AfterCreatePipeline(invocationInfo, ref pipeline); + pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync); + OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } ); + return pipeline; + } + + /// Gets parameters from a common module. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// The name of the parameter to get the value for. + /// + /// The parameter value from the common module. (Note: this should be type converted on the way back) + /// + public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName ); + + /// Initialization steps performed after the module is loaded. + public void Init() + { + 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(); + } + + /// Creates the module instance. + private Module() + { + // constructor + ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient(); + _handler.Proxy = _webProxy; + _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient())); + _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler))); + } + + /// The HTTP Proxy to use. + /// The HTTP Proxy Credentials + /// True if the proxy should use default credentials + public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials) + { + _useProxy = proxy != null; + if (proxy == null) + { + return; + } + // set the proxy configuration + _webProxy.Address = proxy; + _webProxy.BypassProxyOnLocal = false; + if (proxyUseDefaultCredentials) + { + _webProxy.Credentials = null; + _webProxy.UseDefaultCredentials = true; + } + else + { + _webProxy.UseDefaultCredentials = false; + _webProxy.Credentials = proxyCredential ?.GetNetworkCredential(); + } + } + + /// Called to dispatch events to the common module listener + /// The ID of the event + /// The cancellation token for the event + /// A delegate to get the detailed event data + /// The callback for the event dispatcher + /// The from the cmdlet + /// the cmdlet's parameterset name. + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the exception that is being thrown (if available) + /// + /// A that will be complete when handling of the event is completed. + /// + public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception) + { + using( NoSynchronizationContext ) + { + await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/ContainerServiceClient.cs b/swaggerci/containerservice.DefaultTag/generated/api/ContainerServiceClient.cs new file mode 100644 index 000000000000..36e1c0d0dc8c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/ContainerServiceClient.cs @@ -0,0 +1,16299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Low-level API implementation for the ContainerServiceClient service. + /// The Container Service Client. + /// + public partial class ContainerServiceClient + { + + /// + /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually + /// to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, an error + /// is returned. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsAbortLatestOperation(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedclusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "/abort" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsAbortLatestOperation_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually + /// to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, an error + /// is returned. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsAbortLatestOperationViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedclusters/(?[^/]+)/agentPools/(?[^/]+)/abort$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedclusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "/abort" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsAbortLatestOperation_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsAbortLatestOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsAbortLatestOperation_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + } + } + + /// Creates or updates an agent pool in the specified managed 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 managed cluster resource. + /// The name of the agent pool. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The agent pool to create or update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// 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 resourceName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates an agent pool in the specified managed cluster. + /// + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The agent pool to create or update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// 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.ContainerService.Models.Api20240402Preview.IAgentPool body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The agent pool to create or 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 AgentPoolsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes an agent pool in the specified managed 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 managed cluster resource. + /// The name of the agent pool. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering + /// Pod Disruption Budget + /// The request should only proceed if an entity matches this string. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// 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 resourceName, string agentPoolName, bool? ignorePodDisruptionBudget, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == ignorePodDisruptionBudget ? global::System.String.Empty : "ignore-pod-disruption-budget=" + global::System.Uri.EscapeDataString(ignorePodDisruptionBudget.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specific machines in an 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 managed cluster resource. + /// The name of the agent pool. + /// A list of machines from the agent pool to be deleted. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsDeleteMachines(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "/deleteMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsDeleteMachines_Call(request,onDefault,eventListener,sender); + } + } + + /// Deletes specific machines in an agent pool. + /// + /// A list of machines from the agent pool to be deleted. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsDeleteMachinesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/agentPools/(?[^/]+)/deleteMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "/deleteMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsDeleteMachines_Call(request,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsDeleteMachines_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// A list of machines from the agent pool to be deleted. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsDeleteMachines_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes an agent pool in the specified managed cluster. + /// + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering + /// Pod Disruption Budget + /// The request should only proceed if an entity matches this string. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsDeleteViaIdentity(global::System.String viaIdentity, bool? ignorePodDisruptionBudget, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == ignorePodDisruptionBudget ? global::System.String.Empty : "ignore-pod-disruption-budget=" + global::System.Uri.EscapeDataString(ignorePodDisruptionBudget.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// 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 onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering + /// Pod Disruption Budget + /// The request should only proceed if an entity matches this string. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, bool? ignorePodDisruptionBudget, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + } + } + + /// Gets the specified managed 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 managed cluster resource. + /// The name of the agent pool. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// 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 resourceName, string agentPoolName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details + /// about the version lifecycle. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsGetAvailableAgentPoolVersions(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/availableAgentPoolVersions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsGetAvailableAgentPoolVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details + /// about the version lifecycle. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsGetAvailableAgentPoolVersionsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/availableAgentPoolVersions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/availableAgentPoolVersions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsGetAvailableAgentPoolVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsGetAvailableAgentPoolVersions_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersions.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 AgentPoolsGetAvailableAgentPoolVersions_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets the upgrade profile for an 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 managed cluster resource. + /// The name of the agent pool. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsGetUpgradeProfile(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "/upgradeProfiles/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsGetUpgradeProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the upgrade profile for an agent pool. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsGetUpgradeProfileViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/agentPools/(?[^/]+)/upgradeProfiles/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "/upgradeProfiles/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsGetUpgradeProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsGetUpgradeProfile_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsGetUpgradeProfile_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + } + } + + /// Gets the specified managed cluster agent pool. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + } + } + + /// Gets a list of agent pools in the specified managed 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 managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsList(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of agent pools in the specified managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/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.ContainerService/managedClusters/{resourceName}/agentPools'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/agentPools" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 AgentPoolsList_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// + /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides + /// one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the agent pool. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsUpgradeNodeImageVersion(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "/upgradeNodeImageVersion" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsUpgradeNodeImageVersion_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides + /// one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsUpgradeNodeImageVersionViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/agentPools/(?[^/]+)/upgradeNodeImageVersion$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "/upgradeNodeImageVersion" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsUpgradeNodeImageVersion_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsUpgradeNodeImageVersion_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsUpgradeNodeImageVersion_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + } + } + + /// Creates or updates a load balancer in the specified managed 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 managed cluster resource. + /// The name of the load balancer. + /// The load balancer to create or update. + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoadBalancersCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string loadBalancerName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/loadBalancers/" + + global::System.Uri.EscapeDataString(loadBalancerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoadBalancersCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates a load balancer in the specified managed cluster. + /// + /// The load balancer to create or update. + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoadBalancersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/loadBalancers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}'"); + } + + // 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 loadBalancerName = _match.Groups["loadBalancerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/loadBalancers/" + + loadBalancerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoadBalancersCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoadBalancersCreateOrUpdate_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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the load balancer. + /// The load balancer to create or 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 LoadBalancersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string loadBalancerName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(loadBalancerName),loadBalancerName); + await eventListener.AssertMinimumLength(nameof(loadBalancerName),loadBalancerName,1); + await eventListener.AssertMaximumLength(nameof(loadBalancerName),loadBalancerName,12); + await eventListener.AssertRegEx(nameof(loadBalancerName),loadBalancerName,@"^[a-z][a-z0-9]{0,11}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a load balancer in the specified managed 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 managed cluster resource. + /// The name of the load balancer. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoadBalancersDelete(string subscriptionId, string resourceGroupName, string resourceName, string loadBalancerName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/loadBalancers/" + + global::System.Uri.EscapeDataString(loadBalancerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoadBalancersDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a load balancer in the specified managed cluster. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoadBalancersDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/loadBalancers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}'"); + } + + // 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 loadBalancerName = _match.Groups["loadBalancerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/loadBalancers/" + + loadBalancerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoadBalancersDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoadBalancersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the load balancer. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoadBalancersDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string loadBalancerName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(loadBalancerName),loadBalancerName); + await eventListener.AssertMinimumLength(nameof(loadBalancerName),loadBalancerName,1); + await eventListener.AssertMaximumLength(nameof(loadBalancerName),loadBalancerName,12); + await eventListener.AssertRegEx(nameof(loadBalancerName),loadBalancerName,@"^[a-z][a-z0-9]{0,11}$"); + } + } + + /// Gets the specified load balancer. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the load balancer. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoadBalancersGet(string subscriptionId, string resourceGroupName, string resourceName, string loadBalancerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/loadBalancers/" + + global::System.Uri.EscapeDataString(loadBalancerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoadBalancersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified load balancer. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoadBalancersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/loadBalancers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}'"); + } + + // 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 loadBalancerName = _match.Groups["loadBalancerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/loadBalancers/" + + loadBalancerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoadBalancersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoadBalancersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the load balancer. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoadBalancersGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string loadBalancerName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(loadBalancerName),loadBalancerName); + await eventListener.AssertMinimumLength(nameof(loadBalancerName),loadBalancerName,1); + await eventListener.AssertMaximumLength(nameof(loadBalancerName),loadBalancerName,12); + await eventListener.AssertRegEx(nameof(loadBalancerName),loadBalancerName,@"^[a-z][a-z0-9]{0,11}$"); + } + } + + /// Gets a list of load balancers in the specified managed 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 managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoadBalancersListByManagedCluster(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/loadBalancers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoadBalancersListByManagedCluster_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of load balancers in the specified managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LoadBalancersListByManagedClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/loadBalancers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/loadBalancers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LoadBalancersListByManagedCluster_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LoadBalancersListByManagedCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 LoadBalancersListByManagedCluster_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Get a specific machine in the specified 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 managed cluster resource. + /// The name of the agent pool. + /// host name of the 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MachinesGet(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MachinesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get a specific machine in the specified agent pool. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MachinesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/agentPools/(?[^/]+)/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + var machineName = _match.Groups["machineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "/machines/" + + machineName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MachinesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MachinesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Machine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// host name of the 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 MachinesGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + await eventListener.AssertNotNull(nameof(machineName),machineName); + await eventListener.AssertRegEx(nameof(machineName),machineName,@"^[a-zA-Z0-9][-_a-zA-Z0-9]{0,39}$"); + } + } + + /// Gets a list of machines in the specified 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 managed cluster resource. + /// The name of the agent pool. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MachinesList(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "/machines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MachinesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of machines in the specified agent pool. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MachinesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/agentPools/(?[^/]+)/machines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "/machines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MachinesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MachinesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MachinesList_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + } + } + + /// + /// Creates or updates a maintenance configuration in the specified managed 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 managed cluster resource. + /// The name of the maintenance configuration. + /// The maintenance configuration to create or update. + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MaintenanceConfigurationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string configName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/maintenanceConfigurations/" + + global::System.Uri.EscapeDataString(configName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MaintenanceConfigurationsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Creates or updates a maintenance configuration in the specified managed cluster. + /// + /// + /// The maintenance configuration to create or update. + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MaintenanceConfigurationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/maintenanceConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'"); + } + + // 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 configName = _match.Groups["configName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/maintenanceConfigurations/" + + configName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MaintenanceConfigurationsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MaintenanceConfigurationsCreateOrUpdate_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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the maintenance configuration. + /// The maintenance configuration to create or 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 MaintenanceConfigurationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string configName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(configName),configName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a maintenance 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 managed cluster resource. + /// The name of the maintenance configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MaintenanceConfigurationsDelete(string subscriptionId, string resourceGroupName, string resourceName, string configName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/maintenanceConfigurations/" + + global::System.Uri.EscapeDataString(configName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MaintenanceConfigurationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a maintenance configuration. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MaintenanceConfigurationsDeleteViaIdentity(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/maintenanceConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'"); + } + + // 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 configName = _match.Groups["configName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/maintenanceConfigurations/" + + configName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MaintenanceConfigurationsDelete_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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MaintenanceConfigurationsDelete_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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the maintenance 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 MaintenanceConfigurationsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string configName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(configName),configName); + } + } + + /// Gets the specified maintenance configuration of a managed 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 managed cluster resource. + /// The name of the maintenance configuration. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MaintenanceConfigurationsGet(string subscriptionId, string resourceGroupName, string resourceName, string configName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/maintenanceConfigurations/" + + global::System.Uri.EscapeDataString(configName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MaintenanceConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified maintenance configuration of a managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MaintenanceConfigurationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/maintenanceConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'"); + } + + // 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 configName = _match.Groups["configName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/maintenanceConfigurations/" + + configName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MaintenanceConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MaintenanceConfigurationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the maintenance 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 MaintenanceConfigurationsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string configName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(configName),configName); + } + } + + /// Gets a list of maintenance configurations in the specified managed 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 managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MaintenanceConfigurationsListByManagedCluster(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/maintenanceConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MaintenanceConfigurationsListByManagedCluster_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of maintenance configurations in the specified managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MaintenanceConfigurationsListByManagedClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/maintenanceConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/maintenanceConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MaintenanceConfigurationsListByManagedCluster_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MaintenanceConfigurationsListByManagedCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 MaintenanceConfigurationsListByManagedCluster_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Creates or updates a managed cluster snapshot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The managed cluster snapshot to create or update. + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedclustersnapshots/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates a managed cluster snapshot. + /// + /// The managed cluster snapshot to create or update. + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedclustersnapshots/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{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.ContainerService/managedclustersnapshots/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClusterSnapshotsCreateOrUpdate_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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The managed cluster snapshot to create or 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 ManagedClusterSnapshotsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a managed cluster snapshot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsDelete(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedclustersnapshots/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a managed cluster snapshot. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsDeleteViaIdentity(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedclustersnapshots/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{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.ContainerService/managedclustersnapshots/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsDelete_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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClusterSnapshotsDelete_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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClusterSnapshotsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets a managed cluster snapshot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsGet(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedclustersnapshots/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a managed cluster snapshot. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedclustersnapshots/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{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.ContainerService/managedclustersnapshots/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClusterSnapshotsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClusterSnapshotsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets a list of managed cluster snapshots in the specified 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/managedclustersnapshots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists managed cluster snapshots in the specified subscription and 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsListByResourceGroup(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedclustersnapshots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Lists managed cluster snapshots in the specified subscription and 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedclustersnapshots$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots'"); + } + + // 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.ContainerService/managedclustersnapshots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClusterSnapshotsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 ManagedClusterSnapshotsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + } + } + + /// Gets a list of managed cluster snapshots in 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedclustersnapshots$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots'"); + } + + // 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.ContainerService/managedclustersnapshots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClusterSnapshotsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 ManagedClusterSnapshotsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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}$"); + } + } + + /// Updates tags on a managed cluster snapshot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// Parameters supplied to the Update managed cluster snapshot Tags 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsUpdateTags(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedclustersnapshots/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsUpdateTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates tags on a managed cluster snapshot. + /// + /// Parameters supplied to the Update managed cluster snapshot Tags 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClusterSnapshotsUpdateTagsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedclustersnapshots/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{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.ContainerService/managedclustersnapshots/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClusterSnapshotsUpdateTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClusterSnapshotsUpdateTags_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// Parameters supplied to the Update managed cluster snapshot Tags operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClusterSnapshotsUpdateTags_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state + /// and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take + /// place, an error is returned. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersAbortLatestOperation(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedclusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/abort" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersAbortLatestOperation_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state + /// and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take + /// place, an error is returned. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersAbortLatestOperationViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedclusters/(?[^/]+)/abort$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort'"); + } + + // 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.ContainerService/managedclusters/" + + resourceName + + "/abort" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersAbortLatestOperation_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersAbortLatestOperation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClustersAbortLatestOperation_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Creates or updates a managed 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 managed cluster resource. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The managed cluster to create or update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates or updates a managed cluster. + /// + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The managed cluster to create or update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{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.ContainerService/managedClusters/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The managed cluster to create or 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 ManagedClustersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[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); + } + } + + /// Deletes a managed 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 managed cluster resource. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering + /// Pod Disruption Budget + /// The request should only proceed if an entity matches this string. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersDelete(string subscriptionId, string resourceGroupName, string resourceName, bool? ignorePodDisruptionBudget, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == ignorePodDisruptionBudget ? global::System.String.Empty : "ignore-pod-disruption-budget=" + global::System.Uri.EscapeDataString(ignorePodDisruptionBudget.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a managed cluster. + /// + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering + /// Pod Disruption Budget + /// The request should only proceed if an entity matches this string. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersDeleteViaIdentity(global::System.String viaIdentity, bool? ignorePodDisruptionBudget, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{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.ContainerService/managedClusters/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (null == ignorePodDisruptionBudget ? global::System.String.Empty : "ignore-pod-disruption-budget=" + global::System.Uri.EscapeDataString(ignorePodDisruptionBudget.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering + /// Pod Disruption Budget + /// The request should only proceed if an entity matches this string. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, bool? ignorePodDisruptionBudget, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + } + } + + /// Gets a managed 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 managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGet(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + /// or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + /// . + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the role for managed cluster accessProfile 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetAccessProfile(string subscriptionId, string resourceGroupName, string resourceName, string roleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/accessProfiles/" + + global::System.Uri.EscapeDataString(roleName) + + "/listCredential" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetAccessProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + /// or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + /// . + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetAccessProfileViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/accessProfiles/(?[^/]+)/listCredential$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'"); + } + + // 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 roleName = _match.Groups["roleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/accessProfiles/" + + roleName + + "/listCredential" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetAccessProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetAccessProfile_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAccessProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the role for managed cluster accessProfile 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 ManagedClustersGetAccessProfile_Validate(string subscriptionId, string resourceGroupName, string resourceName, string roleName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(roleName),roleName); + } + } + + /// Gets the results of a command which has been run on the Managed 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 managed cluster resource. + /// Id of the command. + /// a delegate that is called when the remote service returns 200 (OK). + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetCommandResult(string subscriptionId, string resourceGroupName, string resourceName, string commandId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/commandResults/" + + global::System.Uri.EscapeDataString(commandId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetCommandResult_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// Gets the results of a command which has been run on the Managed Cluster. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetCommandResultViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/commandResults/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'"); + } + + // 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 commandId = _match.Groups["commandId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/commandResults/" + + commandId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetCommandResult_Call(request,onOk,onAccepted,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetCommandResult_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onAccepted, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RunCommandResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Accepted: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' /home/cloudtest/.autorest/@autorest_powershell@3.0.519/node_modules/@autorest/powershell/dist/llcsharp/schema/object.js*/); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// Id of the command. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetCommandResult_Validate(string subscriptionId, string resourceGroupName, string resourceName, string commandId, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(commandId),commandId); + } + } + + /// + /// Contains Guardrails version along with its support info and whether it is a default version. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Safeguards version + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetGuardrailsVersions(string subscriptionId, string location, string version, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/locations/" + + global::System.Uri.EscapeDataString(location) + + "/guardrailsVersions/" + + global::System.Uri.EscapeDataString(version) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetGuardrailsVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Contains Guardrails version along with its support info and whether it is a default version. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetGuardrailsVersionsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/locations/(?[^/]+)/guardrailsVersions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions/{version}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var version = _match.Groups["version"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ContainerService/locations/" + + location + + "/guardrailsVersions/" + + version + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetGuardrailsVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetGuardrailsVersions_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersion.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 Azure region. + /// Safeguards version + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetGuardrailsVersions_Validate(string subscriptionId, string location, string version, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(version),version); + await eventListener.AssertMinimumLength(nameof(version),version,1); + await eventListener.AssertMaximumLength(nameof(version),version,24); + } + } + + /// + /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The mode of the mesh. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetMeshRevisionProfile(string subscriptionId, string location, string mode, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/locations/" + + global::System.Uri.EscapeDataString(location) + + "/meshRevisionProfiles/" + + global::System.Uri.EscapeDataString(mode) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetMeshRevisionProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetMeshRevisionProfileViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/locations/(?[^/]+)/meshRevisionProfiles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var mode = _match.Groups["mode"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ContainerService/locations/" + + location + + "/meshRevisionProfiles/" + + mode + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetMeshRevisionProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetMeshRevisionProfile_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 Azure region. + /// The mode of the mesh. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetMeshRevisionProfile_Validate(string subscriptionId, string location, string mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(mode),mode); + await eventListener.AssertMinimumLength(nameof(mode),mode,1); + await eventListener.AssertMaximumLength(nameof(mode),mode,24); + await eventListener.AssertRegEx(nameof(mode),mode,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets available upgrades for a service mesh in a 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 managed cluster resource. + /// The mode of the mesh. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetMeshUpgradeProfile(string subscriptionId, string resourceGroupName, string resourceName, string mode, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/meshUpgradeProfiles/" + + global::System.Uri.EscapeDataString(mode) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetMeshUpgradeProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets available upgrades for a service mesh in a 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetMeshUpgradeProfileViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/meshUpgradeProfiles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}'"); + } + + // 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 mode = _match.Groups["mode"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/meshUpgradeProfiles/" + + mode + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetMeshUpgradeProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetMeshUpgradeProfile_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The mode of the mesh. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetMeshUpgradeProfile_Validate(string subscriptionId, string resourceGroupName, string resourceName, string mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(mode),mode); + await eventListener.AssertMinimumLength(nameof(mode),mode,1); + await eventListener.AssertMaximumLength(nameof(mode),mode,24); + await eventListener.AssertRegEx(nameof(mode),mode,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets supported OS options in the specified subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The resource type for which the OS options needs to be returned + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetOSOptions(string subscriptionId, string location, string resourceType, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/locations/" + + global::System.Uri.EscapeDataString(location) + + "/osOptions/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(resourceType) ? global::System.String.Empty : "resource-type=" + global::System.Uri.EscapeDataString(resourceType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetOSOptions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets supported OS options in the specified subscription. + /// + /// The resource type for which the OS options needs to be returned + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetOSOptionsViaIdentity(global::System.String viaIdentity, string resourceType, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/locations/(?[^/]+)/osOptions/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ContainerService/locations/" + + location + + "/osOptions/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(resourceType) ? global::System.String.Empty : "resource-type=" + global::System.Uri.EscapeDataString(resourceType)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetOSOptions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetOSOptions_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 Azure region. + /// The resource type for which the OS options needs to be 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 ManagedClustersGetOSOptions_Validate(string subscriptionId, string location, string resourceType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(resourceType),resourceType); + } + } + + /// + /// Contains Safeguards version along with its support info and whether it is a default version. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Safeguards version + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetSafeguardsVersions(string subscriptionId, string location, string version, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/locations/" + + global::System.Uri.EscapeDataString(location) + + "/safeguardsVersions/" + + global::System.Uri.EscapeDataString(version) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetSafeguardsVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Contains Safeguards version along with its support info and whether it is a default version. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetSafeguardsVersionsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/locations/(?[^/]+)/safeguardsVersions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions/{version}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var version = _match.Groups["version"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ContainerService/locations/" + + location + + "/safeguardsVersions/" + + version + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetSafeguardsVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetSafeguardsVersions_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersion.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 Azure region. + /// Safeguards version + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetSafeguardsVersions_Validate(string subscriptionId, string location, string version, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(version),version); + await eventListener.AssertMinimumLength(nameof(version),version,1); + await eventListener.AssertMaximumLength(nameof(version),version,24); + } + } + + /// Gets the upgrade profile of a managed 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 managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetUpgradeProfile(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/upgradeProfiles/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetUpgradeProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the upgrade profile of a managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetUpgradeProfileViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/upgradeProfiles/default$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/upgradeProfiles/default" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGetUpgradeProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGetUpgradeProfile_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterUpgradeProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClustersGetUpgradeProfile_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets a managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{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.ContainerService/managedClusters/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClustersGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets a list of managed clusters in the specified 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/managedClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists managed clusters in the specified subscription and 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListByResourceGroup(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists managed clusters in the specified subscription and 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'"); + } + + // 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.ContainerService/managedClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 ManagedClustersListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + } + } + + /// Lists the admin credentials of a managed 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 managed cluster resource. + /// server fqdn type for credentials to be returned + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListClusterAdminCredentials(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/listClusterAdminCredential" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(serverFqdn) ? global::System.String.Empty : "server-fqdn=" + global::System.Uri.EscapeDataString(serverFqdn)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListClusterAdminCredentials_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the admin credentials of a managed cluster. + /// + /// server fqdn type for credentials to be returned + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListClusterAdminCredentialsViaIdentity(global::System.String viaIdentity, string serverFqdn, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/listClusterAdminCredential$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/listClusterAdminCredential" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(serverFqdn) ? global::System.String.Empty : "server-fqdn=" + global::System.Uri.EscapeDataString(serverFqdn)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListClusterAdminCredentials_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListClusterAdminCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CredentialResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// server fqdn type for credentials to be 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 ManagedClustersListClusterAdminCredentials_Validate(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(serverFqdn),serverFqdn); + } + } + + /// Lists the cluster monitoring user credentials of a managed 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 managed cluster resource. + /// server fqdn type for credentials to be returned + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListClusterMonitoringUserCredentials(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/listClusterMonitoringUserCredential" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(serverFqdn) ? global::System.String.Empty : "server-fqdn=" + global::System.Uri.EscapeDataString(serverFqdn)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListClusterMonitoringUserCredentials_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the cluster monitoring user credentials of a managed cluster. + /// + /// server fqdn type for credentials to be returned + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListClusterMonitoringUserCredentialsViaIdentity(global::System.String viaIdentity, string serverFqdn, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/listClusterMonitoringUserCredential$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/listClusterMonitoringUserCredential" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(serverFqdn) ? global::System.String.Empty : "server-fqdn=" + global::System.Uri.EscapeDataString(serverFqdn)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListClusterMonitoringUserCredentials_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListClusterMonitoringUserCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CredentialResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// server fqdn type for credentials to be 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 ManagedClustersListClusterMonitoringUserCredentials_Validate(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(serverFqdn),serverFqdn); + } + } + + /// Lists the user credentials of a managed 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 managed cluster resource. + /// server fqdn type for credentials to be returned + /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + /// azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the + /// path. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListClusterUserCredentials(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/listClusterUserCredential" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(serverFqdn) ? global::System.String.Empty : "server-fqdn=" + global::System.Uri.EscapeDataString(serverFqdn)) + + "&" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListClusterUserCredentials_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists the user credentials of a managed cluster. + /// + /// server fqdn type for credentials to be returned + /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + /// azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the + /// path. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListClusterUserCredentialsViaIdentity(global::System.String viaIdentity, string serverFqdn, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format? format, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/listClusterUserCredential$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/listClusterUserCredential" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(serverFqdn) ? global::System.String.Empty : "server-fqdn=" + global::System.Uri.EscapeDataString(serverFqdn)) + + "&" + + (string.IsNullOrEmpty(format) ? global::System.String.Empty : "format=" + global::System.Uri.EscapeDataString(format)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListClusterUserCredentials_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListClusterUserCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CredentialResults.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// server fqdn type for credentials to be returned + /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + /// azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the + /// path. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListClusterUserCredentials_Validate(string subscriptionId, string resourceGroupName, string resourceName, string serverFqdn, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format? format, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(serverFqdn),serverFqdn); + await eventListener.AssertNotNull(nameof(format),format); + await eventListener.AssertEnum(nameof(format),format,@"azure", @"exec"); + } + } + + /// + /// Contains list of Guardrails version along with its support info and whether it is a default version. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListGuardrailsVersions(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/locations/" + + global::System.Uri.EscapeDataString(location) + + "/guardrailsVersions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListGuardrailsVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Contains list of Guardrails version along with its support info and whether it is a default version. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListGuardrailsVersionsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/locations/(?[^/]+)/guardrailsVersions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ContainerService/locations/" + + location + + "/guardrailsVersions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListGuardrailsVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListGuardrailsVersions_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 Azure region. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListGuardrailsVersions_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + } + } + + /// + /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details + /// on preview status of the version + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListKubernetesVersions(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/locations/" + + global::System.Uri.EscapeDataString(location) + + "/kubernetesVersions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListKubernetesVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details + /// on preview status of the version + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListKubernetesVersionsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/locations/(?[^/]+)/kubernetesVersions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ContainerService/locations/" + + location + + "/kubernetesVersions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListKubernetesVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListKubernetesVersions_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 Azure region. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListKubernetesVersions_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + } + } + + /// + /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListMeshRevisionProfiles(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/locations/" + + global::System.Uri.EscapeDataString(location) + + "/meshRevisionProfiles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListMeshRevisionProfiles_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListMeshRevisionProfilesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/locations/(?[^/]+)/meshRevisionProfiles$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ContainerService/locations/" + + location + + "/meshRevisionProfiles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListMeshRevisionProfiles_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListMeshRevisionProfiles_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfileList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 Azure region. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListMeshRevisionProfiles_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + } + } + + /// Lists available upgrades for all service meshes in a specific 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 managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListMeshUpgradeProfiles(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/meshUpgradeProfiles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListMeshUpgradeProfiles_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists available upgrades for all service meshes in a specific 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListMeshUpgradeProfilesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/meshUpgradeProfiles$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/meshUpgradeProfiles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListMeshUpgradeProfiles_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListMeshUpgradeProfiles_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfileList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClustersListMeshUpgradeProfiles_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// + /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The + /// operation returns properties of each egress endpoint. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListOutboundNetworkDependenciesEndpoints(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/outboundNetworkDependenciesEndpoints" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListOutboundNetworkDependenciesEndpoints_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The + /// operation returns properties of each egress endpoint. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListOutboundNetworkDependenciesEndpointsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/outboundNetworkDependenciesEndpoints$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/outboundNetworkDependenciesEndpoints" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListOutboundNetworkDependenciesEndpoints_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListOutboundNetworkDependenciesEndpoints_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OutboundEnvironmentEndpointCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClustersListOutboundNetworkDependenciesEndpoints_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// + /// Contains list of Safeguards version along with its support info and whether it is a default version. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListSafeguardsVersions(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/locations/" + + global::System.Uri.EscapeDataString(location) + + "/safeguardsVersions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListSafeguardsVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Contains list of Safeguards version along with its support info and whether it is a default version. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListSafeguardsVersionsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/locations/(?[^/]+)/safeguardsVersions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ContainerService/locations/" + + location + + "/safeguardsVersions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersListSafeguardsVersions_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListSafeguardsVersions_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 Azure region. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersListSafeguardsVersions_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + } + } + + /// Gets a list of managed clusters in 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'"); + } + + // 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.ContainerService/managedClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 ManagedClustersList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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}$"); + } + } + + /// Rebalance nodes across specific load balancers. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The names of the load balancers to be rebalanced. If set to empty, all load balancers will be rebalanced. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersRebalanceLoadBalancers(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/rebalanceLoadBalancers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersRebalanceLoadBalancers_Call(request,onDefault,eventListener,sender); + } + } + + /// Rebalance nodes across specific load balancers. + /// + /// The names of the load balancers to be rebalanced. If set to empty, all load balancers will be rebalanced. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersRebalanceLoadBalancersViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/rebalanceLoadBalancers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/rebalanceLoadBalancers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersRebalanceLoadBalancers_Call(request,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersRebalanceLoadBalancers_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The names of the load balancers to be rebalanced. If set to empty, all load balancers will be rebalanced. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersRebalanceLoadBalancers_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) + /// to update your cluster with AKS-managed Azure AD. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The AAD profile to set on the Managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersResetAadProfile(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/resetAADProfile" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersResetAadProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) + /// to update your cluster with AKS-managed Azure AD. + /// + /// + /// The AAD profile to set on the Managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersResetAadProfileViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/resetAADProfile$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/resetAADProfile" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersResetAadProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersResetAadProfile_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The AAD profile to set on the Managed 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 ManagedClustersResetAadProfile_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// This action cannot be performed on a cluster that is not using a service principal + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The service principal profile to set on the managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersResetServicePrincipalProfile(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/resetServicePrincipalProfile" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersResetServicePrincipalProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This action cannot be performed on a cluster that is not using a service principal + /// + /// + /// The service principal profile to set on the managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersResetServicePrincipalProfileViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/resetServicePrincipalProfile$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/resetServicePrincipalProfile" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersResetServicePrincipalProfile_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersResetServicePrincipalProfile_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The service principal profile to set on the managed 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 ManagedClustersResetServicePrincipalProfile_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating + /// managed cluster certificates. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersRotateClusterCertificates(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/rotateClusterCertificates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersRotateClusterCertificates_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating + /// managed cluster certificates. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersRotateClusterCertificatesViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/rotateClusterCertificates$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/rotateClusterCertificates" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersRotateClusterCertificates_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersRotateClusterCertificates_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClustersRotateClusterCertificates_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Rotates the service account signing keys of a managed 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 managed cluster resource. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersRotateServiceAccountSigningKeys(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/rotateServiceAccountSigningKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersRotateServiceAccountSigningKeys_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Rotates the service account signing keys of a managed cluster. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersRotateServiceAccountSigningKeysViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/rotateServiceAccountSigningKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/rotateServiceAccountSigningKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersRotateServiceAccountSigningKeys_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersRotateServiceAccountSigningKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClustersRotateServiceAccountSigningKeys_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// + /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS + /// Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The run command request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersRunCommand(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/runCommand" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersRunCommand_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS + /// Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + /// + /// + /// The run command request + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersRunCommandViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/runCommand$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/runCommand" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersRunCommand_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersRunCommand_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RunCommandResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The run command request + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersRunCommand_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a 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 managed cluster resource. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersStart(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/start" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersStart_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersStartViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/start$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/start" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersStart_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersStart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClustersStart_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// + /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane + /// and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is + /// stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping + /// a 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 managed cluster resource. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersStop(string subscriptionId, string resourceGroupName, string resourceName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/stop" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersStop_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane + /// and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is + /// stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping + /// a cluster. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersStopViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/stop$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/stop" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersStop_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersStop_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 ManagedClustersStop_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Updates tags on a managed 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 managed cluster resource. + /// The request should only proceed if an entity matches this string. + /// Parameters supplied to the Update Managed Cluster Tags 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersUpdateTags(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersUpdateTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates tags on a managed cluster. + /// + /// The request should only proceed if an entity matches this string. + /// Parameters supplied to the Update Managed Cluster Tags 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagedClustersUpdateTagsViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{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.ContainerService/managedClusters/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagedClustersUpdateTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersUpdateTags_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The request should only proceed if an entity matches this string. + /// Parameters supplied to the Update Managed Cluster Tags operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagedClustersUpdateTags_Validate(string subscriptionId, string resourceGroupName, string resourceName, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get the status of a specific operation in the specified managed 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 managed cluster resource. + /// The ID of an ongoing async 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationStatusResultGet(string subscriptionId, string resourceGroupName, string resourceName, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationStatusResultGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the status of a specific operation in the specified 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 managed cluster resource. + /// The name of the agent pool. + /// The ID of an ongoing async 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationStatusResultGetByAgentPool(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string operationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "/operations/" + + global::System.Uri.EscapeDataString(operationId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationStatusResultGetByAgentPool_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the status of a specific operation in the specified agent pool. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationStatusResultGetByAgentPoolViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/agentPools/(?[^/]+)/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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}'"); + } + + // 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 agentPoolName = _match.Groups["agentPoolName"].Value; + var operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/agentPools/" + + agentPoolName + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationStatusResultGetByAgentPool_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationStatusResultGetByAgentPool_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the agent pool. + /// The ID of an ongoing async operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationStatusResultGetByAgentPool_Validate(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); + await eventListener.AssertMinimumLength(nameof(agentPoolName),agentPoolName,1); + await eventListener.AssertMaximumLength(nameof(agentPoolName),agentPoolName,12); + await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^[a-z][a-z0-9]{0,11}$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + } + } + + /// Get the status of a specific operation in the specified managed 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationStatusResultGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/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.ContainerService/managedClusters/{resourceName}/operations/{operationId}'"); + } + + // 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 operationId = _match.Groups["operationId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/operations/" + + operationId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationStatusResultGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationStatusResultGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The ID of an ongoing async operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationStatusResultGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string operationId, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(operationId),operationId); + await eventListener.AssertMinimumLength(nameof(operationId),operationId,1); + } + } + + /// Gets a list of operations in the specified managedCluster + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationStatusResultList(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationStatusResultList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of operations in the specified managedCluster + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationStatusResultListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/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.ContainerService/managedClusters/{resourceName}/operations'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationStatusResultList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationStatusResultList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationStatusResultList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 OperationStatusResultList_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets a list of 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.ContainerService.Runtime.ISendAsync pipeline to 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ContainerService/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of 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.ContainerService.Runtime.ISendAsync pipeline to 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.ContainerService/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.ContainerService/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ContainerService/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// Deletes a private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the private endpoint connection. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a private endpoint connection. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDeleteViaIdentity(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // 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 privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsDelete_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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the private endpoint connection. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the private endpoint connection. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // 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 privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the private endpoint connection. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 PrivateEndpointConnectionsList_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Updates a private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of the private endpoint connection. + /// The updated private endpoint connection. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsUpdate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Updates a private endpoint connection. + /// + /// The updated private endpoint connection. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // 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 privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsUpdate_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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of the private endpoint connection. + /// The updated private endpoint connection. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkResourcesList(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/privateLinkResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResourcesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 PrivateLinkResourcesList_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets the private link service ID for the specified managed 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 managed cluster resource. + /// Parameters required in order to resolve a private link service ID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResolvePrivateLinkServiceIdPost(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/resolvePrivateLinkServiceId" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResolvePrivateLinkServiceIdPost_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the private link service ID for the specified managed cluster. + /// + /// Parameters required in order to resolve a private link service ID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ResolvePrivateLinkServiceIdPostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/resolvePrivateLinkServiceId$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/resolvePrivateLinkServiceId" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ResolvePrivateLinkServiceIdPost_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResolvePrivateLinkServiceIdPost_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// Parameters required in order to resolve a private link service ID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ResolvePrivateLinkServiceIdPost_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates or updates a snapshot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The snapshot to create or update. + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/snapshots/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Creates or updates a snapshot. + /// + /// The snapshot to create or update. + /// 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot 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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/snapshots/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{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.ContainerService/snapshots/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SnapshotsCreateOrUpdate_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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Snapshot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Snapshot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The snapshot to create or 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 SnapshotsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a snapshot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsDelete(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/snapshots/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes a snapshot. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsDeleteViaIdentity(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/snapshots/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{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.ContainerService/snapshots/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsDelete_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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SnapshotsDelete_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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 SnapshotsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets a snapshot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsGet(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/snapshots/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a snapshot. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/snapshots/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{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.ContainerService/snapshots/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SnapshotsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Snapshot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 SnapshotsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// Gets a list of snapshots in the specified 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/snapshots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists snapshots in the specified subscription and 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsListByResourceGroup(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/snapshots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists snapshots in the specified subscription and 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/snapshots$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'"); + } + + // 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.ContainerService/snapshots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SnapshotsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 SnapshotsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + } + } + + /// Gets a list of snapshots in 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/snapshots$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'"); + } + + // 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.ContainerService/snapshots" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SnapshotsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 SnapshotsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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}$"); + } + } + + /// Updates tags on a snapshot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// Parameters supplied to the Update snapshot Tags 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsUpdateTags(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/snapshots/" + + global::System.Uri.EscapeDataString(resourceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsUpdateTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Updates tags on a snapshot. + /// + /// Parameters supplied to the Update snapshot Tags 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SnapshotsUpdateTagsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/snapshots/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{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.ContainerService/snapshots/" + + resourceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SnapshotsUpdateTags_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SnapshotsUpdateTags_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Snapshot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// Parameters supplied to the Update snapshot Tags operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SnapshotsUpdateTags_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create or update a trusted access role binding + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of trusted access role binding. + /// A trusted access role binding + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsCreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/trustedAccessRoleBindings/" + + global::System.Uri.EscapeDataString(trustedAccessRoleBindingName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRoleBindingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or update a trusted access role binding + /// + /// A trusted access role binding + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/trustedAccessRoleBindings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}'"); + } + + // 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 trustedAccessRoleBindingName = _match.Groups["trustedAccessRoleBindingName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/trustedAccessRoleBindings/" + + trustedAccessRoleBindingName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRoleBindingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBinding.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of trusted access role binding. + /// A trusted access role binding + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding body, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName); + await eventListener.AssertMinimumLength(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName,1); + await eventListener.AssertMaximumLength(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName,24); + await eventListener.AssertRegEx(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName,@"^([A-Za-z0-9-])+$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete a trusted access role binding. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of trusted access role binding. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsDelete(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/trustedAccessRoleBindings/" + + global::System.Uri.EscapeDataString(trustedAccessRoleBindingName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRoleBindingsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a trusted access role binding. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/trustedAccessRoleBindings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}'"); + } + + // 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 trustedAccessRoleBindingName = _match.Groups["trustedAccessRoleBindingName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/trustedAccessRoleBindings/" + + trustedAccessRoleBindingName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRoleBindingsDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of trusted access role binding. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsDelete_Validate(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName); + await eventListener.AssertMinimumLength(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName,1); + await eventListener.AssertMaximumLength(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName,24); + await eventListener.AssertRegEx(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName,@"^([A-Za-z0-9-])+$"); + } + } + + /// Get a trusted access role binding. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster resource. + /// The name of trusted access role binding. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsGet(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/trustedAccessRoleBindings/" + + global::System.Uri.EscapeDataString(trustedAccessRoleBindingName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRoleBindingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get a trusted access role binding. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/trustedAccessRoleBindings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}'"); + } + + // 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 trustedAccessRoleBindingName = _match.Groups["trustedAccessRoleBindingName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ContainerService/managedClusters/" + + resourceName + + "/trustedAccessRoleBindings/" + + trustedAccessRoleBindingName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRoleBindingsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBinding.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster resource. + /// The name of trusted access role binding. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsGet_Validate(string subscriptionId, string resourceGroupName, string resourceName, string trustedAccessRoleBindingName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + await eventListener.AssertNotNull(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName); + await eventListener.AssertMinimumLength(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName,1); + await eventListener.AssertMaximumLength(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName,24); + await eventListener.AssertRegEx(nameof(trustedAccessRoleBindingName),trustedAccessRoleBindingName,@"^([A-Za-z0-9-])+$"); + } + } + + /// List trusted access role bindings. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed cluster 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.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsList(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.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ContainerService/managedClusters/" + + global::System.Uri.EscapeDataString(resourceName) + + "/trustedAccessRoleBindings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRoleBindingsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List trusted access role bindings. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/managedClusters/(?[^/]+)/trustedAccessRoleBindings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings'"); + } + + // 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.ContainerService/managedClusters/" + + resourceName + + "/trustedAccessRoleBindings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRoleBindingsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrustedAccessRoleBindingsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 managed cluster 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 TrustedAccessRoleBindingsList_Validate(string subscriptionId, string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(resourceName),resourceName); + await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,1); + await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,63); + await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + + /// List supported trusted access roles. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRolesList(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ContainerService/locations/" + + global::System.Uri.EscapeDataString(location) + + "/trustedAccessRoles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRolesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List supported trusted access roles. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrustedAccessRolesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-04-02-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.ContainerService/locations/(?[^/]+)/trustedAccessRoles$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ContainerService/locations/" + + location + + "/trustedAccessRoles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrustedAccessRolesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrustedAccessRolesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Finally, 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 Azure region. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrustedAccessRolesList_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..f7b67221eeab --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AgentPoolsAbortLatestOperationAcceptedResponseHeadersTypeConverter))] + public partial class AgentPoolsAbortLatestOperationAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolsAbortLatestOperationAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("AzureAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation = (string) content.GetValueForProperty("AzureAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgentPoolsAbortLatestOperationAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("AzureAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation = (string) content.GetValueForProperty("AzureAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation, 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.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolsAbortLatestOperationAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolsAbortLatestOperationAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AgentPoolsAbortLatestOperationAcceptedResponseHeadersTypeConverter))] + public partial interface IAgentPoolsAbortLatestOperationAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..764325ce0dba --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolsAbortLatestOperationAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolsAbortLatestOperationAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolsAbortLatestOperationAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolsAbortLatestOperationAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..bdef0005ee72 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolsAbortLatestOperationAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public AgentPoolsAbortLatestOperationAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader1) is string __headerAzureAsyncOperationHeader1 ? __headerAzureAsyncOperationHeader1 : (string)null; + } + } + } + public partial interface IAgentPoolsAbortLatestOperationAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IAgentPoolsAbortLatestOperationAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..a97d8babbbbc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsAbortLatestOperationAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolsAbortLatestOperationAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolsAbortLatestOperationAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsAbortLatestOperationAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolsAbortLatestOperationAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..a4cdf01dbad6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AgentPoolsDeleteAcceptedResponseHeadersTypeConverter))] + public partial class AgentPoolsDeleteAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolsDeleteAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgentPoolsDeleteAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolsDeleteAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolsDeleteAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AgentPoolsDeleteAcceptedResponseHeadersTypeConverter))] + public partial interface IAgentPoolsDeleteAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..f45f991f0ca0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolsDeleteAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolsDeleteAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolsDeleteAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolsDeleteAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..9c2ded755158 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolsDeleteAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Creates an new instance. + public AgentPoolsDeleteAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IAgentPoolsDeleteAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IAgentPoolsDeleteAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..6b9540e8d4ce --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteAcceptedResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolsDeleteAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolsDeleteAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolsDeleteAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..3ab314353519 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AgentPoolsDeleteMachinesAcceptedResponseHeadersTypeConverter))] + public partial class AgentPoolsDeleteMachinesAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolsDeleteMachinesAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgentPoolsDeleteMachinesAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolsDeleteMachinesAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolsDeleteMachinesAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AgentPoolsDeleteMachinesAcceptedResponseHeadersTypeConverter))] + public partial interface IAgentPoolsDeleteMachinesAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..298ee6bc28a2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolsDeleteMachinesAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolsDeleteMachinesAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolsDeleteMachinesAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolsDeleteMachinesAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..cff4db542c87 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolsDeleteMachinesAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public AgentPoolsDeleteMachinesAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IAgentPoolsDeleteMachinesAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IAgentPoolsDeleteMachinesAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..3e72a184aa79 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/AgentPoolsDeleteMachinesAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolsDeleteMachinesAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolsDeleteMachinesAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAgentPoolsDeleteMachinesAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolsDeleteMachinesAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.PowerShell.cs new file mode 100644 index 000000000000..246a6049b564 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial class Any + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Any(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Any(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Any(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Any(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Any object + [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] + public partial interface IAny + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.TypeConverter.cs new file mode 100644 index 000000000000..7fc8914e5fe0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AnyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IAny ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Any.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Any.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Any.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.cs new file mode 100644 index 000000000000..6a318b46448e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Any object + public partial class Any : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAnyInternal + { + + /// Creates an new instance. + public Any() + { + + } + } + /// Any object + public partial interface IAny : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + + } + /// Any object + internal partial interface IAnyInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.json.cs new file mode 100644 index 000000000000..974910714cd7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Any.json.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Any object + public partial class Any + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal Any(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new Any(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.PowerShell.cs new file mode 100644 index 000000000000..d339be93e6a3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + /// + [System.ComponentModel.TypeConverter(typeof(AbsoluteMonthlyScheduleTypeConverter))] + public partial class AbsoluteMonthlySchedule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AbsoluteMonthlySchedule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)this).IntervalMonth = (int) content.GetValueForProperty("IntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)this).IntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)this).DayOfMonth = (int) content.GetValueForProperty("DayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)this).DayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AbsoluteMonthlySchedule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)this).IntervalMonth = (int) content.GetValueForProperty("IntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)this).IntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)this).DayOfMonth = (int) content.GetValueForProperty("DayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)this).DayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AbsoluteMonthlySchedule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AbsoluteMonthlySchedule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + [System.ComponentModel.TypeConverter(typeof(AbsoluteMonthlyScheduleTypeConverter))] + public partial interface IAbsoluteMonthlySchedule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.TypeConverter.cs new file mode 100644 index 000000000000..5cac4a8db121 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AbsoluteMonthlyScheduleTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AbsoluteMonthlySchedule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AbsoluteMonthlySchedule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AbsoluteMonthlySchedule.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.cs new file mode 100644 index 000000000000..d25546821141 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + /// + public partial class AbsoluteMonthlySchedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal + { + + /// Backing field for property. + private int _dayOfMonth; + + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int DayOfMonth { get => this._dayOfMonth; set => this._dayOfMonth = value; } + + /// Backing field for property. + private int _intervalMonth; + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int IntervalMonth { get => this._intervalMonth; set => this._intervalMonth = value; } + + /// Creates an new instance. + public AbsoluteMonthlySchedule() + { + + } + } + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + public partial interface IAbsoluteMonthlySchedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The date of the month.", + SerializedName = @"dayOfMonth", + PossibleTypes = new [] { typeof(int) })] + int DayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int IntervalMonth { get; set; } + + } + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + internal partial interface IAbsoluteMonthlyScheduleInternal + + { + /// The date of the month. + int DayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + int IntervalMonth { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.json.cs new file mode 100644 index 000000000000..7bb1b5405b6f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AbsoluteMonthlySchedule.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + /// + public partial class AbsoluteMonthlySchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AbsoluteMonthlySchedule(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_intervalMonth = If( json?.PropertyT("intervalMonths"), out var __jsonIntervalMonths) ? (int)__jsonIntervalMonths : IntervalMonth;} + {_dayOfMonth = If( json?.PropertyT("dayOfMonth"), out var __jsonDayOfMonth) ? (int)__jsonDayOfMonth : DayOfMonth;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AbsoluteMonthlySchedule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber(this._intervalMonth), "intervalMonths" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber(this._dayOfMonth), "dayOfMonth" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.PowerShell.cs new file mode 100644 index 000000000000..f8292dafb3d1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Profile for enabling a user to access a managed cluster. + [System.ComponentModel.TypeConverter(typeof(AccessProfileTypeConverter))] + public partial class AccessProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AccessProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubeConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfileInternal)this).KubeConfig = (byte[]) content.GetValueForProperty("KubeConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfileInternal)this).KubeConfig, i => i); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AccessProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubeConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfileInternal)this).KubeConfig = (byte[]) content.GetValueForProperty("KubeConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfileInternal)this).KubeConfig, i => i); + } + 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.ContainerService.Models.Api20240402Preview.IAccessProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AccessProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AccessProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Profile for enabling a user to access a managed cluster. + [System.ComponentModel.TypeConverter(typeof(AccessProfileTypeConverter))] + public partial interface IAccessProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.TypeConverter.cs new file mode 100644 index 000000000000..03ce3c82baf7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AccessProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAccessProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AccessProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AccessProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AccessProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.cs new file mode 100644 index 000000000000..7f5cc64e3edb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile for enabling a user to access a managed cluster. + public partial class AccessProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfileInternal + { + + /// Backing field for property. + private byte[] _kubeConfig; + + /// Base64-encoded Kubernetes configuration file. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public byte[] KubeConfig { get => this._kubeConfig; set => this._kubeConfig = value; } + + /// Creates an new instance. + public AccessProfile() + { + + } + } + /// Profile for enabling a user to access a managed cluster. + public partial interface IAccessProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Base64-encoded Kubernetes configuration file. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Base64-encoded Kubernetes configuration file.", + SerializedName = @"kubeConfig", + PossibleTypes = new [] { typeof(byte[]) })] + byte[] KubeConfig { get; set; } + + } + /// Profile for enabling a user to access a managed cluster. + internal partial interface IAccessProfileInternal + + { + /// Base64-encoded Kubernetes configuration file. + byte[] KubeConfig { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.json.cs new file mode 100644 index 000000000000..8037614b7085 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AccessProfile.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile for enabling a user to access a managed cluster. + public partial class AccessProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AccessProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kubeConfig = If( json?.PropertyT("kubeConfig"), out var __w) ? System.Convert.FromBase64String( ((string)__w).Replace("_","/").Replace("-","+").PadRight( ((string)__w).Length + ((string)__w).Length * 3 % 4, '=') ) : null;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AccessProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._kubeConfig ? global::System.Convert.ToBase64String( this._kubeConfig) : null ,(v)=> container.Add( "kubeConfig",v) ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.PowerShell.cs new file mode 100644 index 000000000000..62fb5a7bc8c3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Advanced Networking profile for enabling observability on a cluster. For more information see aka.ms/aksadvancednetworking. + /// + [System.ComponentModel.TypeConverter(typeof(AdvancedNetworkingTypeConverter))] + public partial class AdvancedNetworking + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AdvancedNetworking(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Observability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)this).Observability = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability) content.GetValueForProperty("Observability",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)this).Observability, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingObservabilityTypeConverter.ConvertFrom); + } + if (content.Contains("ObservabilityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)this).ObservabilityEnabled = (bool?) content.GetValueForProperty("ObservabilityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)this).ObservabilityEnabled, (__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 AdvancedNetworking(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Observability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)this).Observability = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability) content.GetValueForProperty("Observability",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)this).Observability, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingObservabilityTypeConverter.ConvertFrom); + } + if (content.Contains("ObservabilityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)this).ObservabilityEnabled = (bool?) content.GetValueForProperty("ObservabilityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)this).ObservabilityEnabled, (__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.ContainerService.Models.Api20240402Preview.IAdvancedNetworking DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AdvancedNetworking(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AdvancedNetworking(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Advanced Networking profile for enabling observability on a cluster. For more information see aka.ms/aksadvancednetworking. + [System.ComponentModel.TypeConverter(typeof(AdvancedNetworkingTypeConverter))] + public partial interface IAdvancedNetworking + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.TypeConverter.cs new file mode 100644 index 000000000000..28d3a68f1a66 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AdvancedNetworkingTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAdvancedNetworking ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AdvancedNetworking.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AdvancedNetworking.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AdvancedNetworking.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.cs new file mode 100644 index 000000000000..472ce24842c0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Advanced Networking profile for enabling observability on a cluster. For more information see aka.ms/aksadvancednetworking. + /// + public partial class AdvancedNetworking : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal + { + + /// Internal Acessors for Observability + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal.Observability { get => (this._observability = this._observability ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingObservability()); set { {_observability = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability _observability; + + /// + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability Observability { get => (this._observability = this._observability ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingObservability()); set => this._observability = value; } + + /// + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ObservabilityEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservabilityInternal)Observability).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservabilityInternal)Observability).Enabled = value ?? default(bool); } + + /// Creates an new instance. + public AdvancedNetworking() + { + + } + } + /// Advanced Networking profile for enabling observability on a cluster. For more information see aka.ms/aksadvancednetworking. + public partial interface IAdvancedNetworking : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the enablement of Advanced Networking observability functionalities on clusters.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ObservabilityEnabled { get; set; } + + } + /// Advanced Networking profile for enabling observability on a cluster. For more information see aka.ms/aksadvancednetworking. + internal partial interface IAdvancedNetworkingInternal + + { + /// + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability Observability { get; set; } + /// + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// + bool? ObservabilityEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.json.cs new file mode 100644 index 000000000000..a55a072ea466 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworking.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Advanced Networking profile for enabling observability on a cluster. For more information see aka.ms/aksadvancednetworking. + /// + public partial class AdvancedNetworking + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AdvancedNetworking(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_observability = If( json?.PropertyT("observability"), out var __jsonObservability) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingObservability.FromJson(__jsonObservability) : Observability;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AdvancedNetworking(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._observability ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._observability.ToJson(null,serializationMode) : null, "observability" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.PowerShell.cs new file mode 100644 index 000000000000..b8463fd97218 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + /// + [System.ComponentModel.TypeConverter(typeof(AdvancedNetworkingObservabilityTypeConverter))] + public partial class AdvancedNetworkingObservability + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AdvancedNetworkingObservability(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservabilityInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservabilityInternal)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 AdvancedNetworkingObservability(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservabilityInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservabilityInternal)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.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AdvancedNetworkingObservability(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AdvancedNetworkingObservability(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + [System.ComponentModel.TypeConverter(typeof(AdvancedNetworkingObservabilityTypeConverter))] + public partial interface IAdvancedNetworkingObservability + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.TypeConverter.cs new file mode 100644 index 000000000000..df0120fb2a67 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AdvancedNetworkingObservabilityTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AdvancedNetworkingObservability.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AdvancedNetworkingObservability.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AdvancedNetworkingObservability.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.cs new file mode 100644 index 000000000000..37dbf27b9956 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + /// + public partial class AdvancedNetworkingObservability : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservabilityInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Creates an new instance. + public AdvancedNetworkingObservability() + { + + } + } + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + public partial interface IAdvancedNetworkingObservability : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the enablement of Advanced Networking observability functionalities on clusters.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + internal partial interface IAdvancedNetworkingObservabilityInternal + + { + /// + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.json.cs new file mode 100644 index 000000000000..36c5b3273aa4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AdvancedNetworkingObservability.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + /// + public partial class AdvancedNetworkingObservability + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AdvancedNetworkingObservability(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AdvancedNetworkingObservability(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.PowerShell.cs new file mode 100644 index 000000000000..2e9dc4fdd0ec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.PowerShell.cs @@ -0,0 +1,888 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Agent Pool. + [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); + + /// + /// 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("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).AzureAsyncOperation = (string) content.GetValueForProperty("AzureAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).AzureAsyncOperation, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("KubeletConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig) content.GetValueForProperty("KubeletConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadRuntime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WorkloadRuntime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime?) content.GetValueForProperty("WorkloadRuntime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WorkloadRuntime, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime.CreateFrom); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxOSConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig) content.GetValueForProperty("LinuxOSConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfigTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GpuProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile) content.GetValueForProperty("GpuProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ArtifactStreamingProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ArtifactStreamingProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile) content.GetValueForProperty("ArtifactStreamingProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ArtifactStreamingProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfileTypeConverter.ConvertFrom); + } + if (content.Contains("VirtualMachinesProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachinesProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile) content.GetValueForProperty("VirtualMachinesProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachinesProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachinesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile) content.GetValueForProperty("GatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSDiskSizeGb = (int?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSDiskSizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType?) content.GetValueForProperty("OSDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType.CreateFrom); + } + if (content.Contains("KubeletDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType?) content.GetValueForProperty("KubeletDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType.CreateFrom); + } + if (content.Contains("MessageOfTheDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MessageOfTheDay = (string) content.GetValueForProperty("MessageOfTheDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MessageOfTheDay, global::System.Convert.ToString); + } + if (content.Contains("VnetSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VnetSubnetId = (string) content.GetValueForProperty("VnetSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VnetSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PodSubnetId = (string) content.GetValueForProperty("PodSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PodSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodIPAllocationMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PodIPAllocationMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode?) content.GetValueForProperty("PodIPAllocationMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PodIPAllocationMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode.CreateFrom); + } + if (content.Contains("MaxPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MaxPod = (int?) content.GetValueForProperty("MaxPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MaxPod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("MaxCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MaxCount = (int?) content.GetValueForProperty("MaxCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MaxCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MinCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MinCount = (int?) content.GetValueForProperty("MinCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MinCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnableAutoScaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableAutoScaling = (bool?) content.GetValueForProperty("EnableAutoScaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableAutoScaling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ScaleDownMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleDownMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode?) content.GetValueForProperty("ScaleDownMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleDownMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode.CreateFrom); + } + if (content.Contains("PropertiesType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PropertiesType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType?) content.GetValueForProperty("PropertiesType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PropertiesType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType.CreateFrom); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode.CreateFrom); + } + if (content.Contains("OrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OrchestratorVersion = (string) content.GetValueForProperty("OrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentOrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CurrentOrchestratorVersion = (string) content.GetValueForProperty("CurrentOrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CurrentOrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnableNodePublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableNodePublicIP = (bool?) content.GetValueForProperty("EnableNodePublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableNodePublicIP, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableCustomCaTrust")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableCustomCaTrust = (bool?) content.GetValueForProperty("EnableCustomCaTrust",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableCustomCaTrust, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodePublicIPPrefixId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodePublicIPPrefixId = (string) content.GetValueForProperty("NodePublicIPPrefixId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodePublicIPPrefixId, global::System.Convert.ToString); + } + if (content.Contains("ScaleSetPriority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleSetPriority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority?) content.GetValueForProperty("ScaleSetPriority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleSetPriority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority.CreateFrom); + } + if (content.Contains("ScaleSetEvictionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleSetEvictionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy?) content.GetValueForProperty("ScaleSetEvictionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleSetEvictionPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy.CreateFrom); + } + if (content.Contains("SpotMaxPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SpotMaxPrice = (float?) content.GetValueForProperty("SpotMaxPrice",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SpotMaxPrice, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeLabel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels) content.GetValueForProperty("NodeLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeLabel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabelsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeTaint = (string[]) content.GetValueForProperty("NodeTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeInitializationTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeInitializationTaint = (string[]) content.GetValueForProperty("NodeInitializationTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeInitializationTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProximityPlacementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ProximityPlacementGroupId = (string) content.GetValueForProperty("ProximityPlacementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ProximityPlacementGroupId, global::System.Convert.ToString); + } + if (content.Contains("EnableEncryptionAtHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableEncryptionAtHost = (bool?) content.GetValueForProperty("EnableEncryptionAtHost",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableEncryptionAtHost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableUltraSsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableUltraSsd = (bool?) content.GetValueForProperty("EnableUltraSsd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableUltraSsd, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuInstanceProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuInstanceProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile?) content.GetValueForProperty("GpuInstanceProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuInstanceProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile.CreateFrom); + } + if (content.Contains("CapacityReservationGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CapacityReservationGroupId = (string) content.GetValueForProperty("CapacityReservationGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CapacityReservationGroupId, global::System.Convert.ToString); + } + if (content.Contains("HostGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).HostGroupId = (string) content.GetValueForProperty("HostGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).HostGroupId, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineNodesStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachineNodesStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[]) content.GetValueForProperty("VirtualMachineNodesStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachineNodesStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachineNodesTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingDrainTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingDrainTimeoutInMinute = (int?) content.GetValueForProperty("UpgradeSettingDrainTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingDrainTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingNodeSoakDurationInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingNodeSoakDurationInMinute = (int?) content.GetValueForProperty("UpgradeSettingNodeSoakDurationInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingNodeSoakDurationInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingUndrainableNodeBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingUndrainableNodeBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior?) content.GetValueForProperty("UpgradeSettingUndrainableNodeBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingUndrainableNodeBehavior, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior.CreateFrom); + } + if (content.Contains("KubeletConfigCpuManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuManagerPolicy = (string) content.GetValueForProperty("KubeletConfigCpuManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigCpuCfsQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuCfsQuota = (bool?) content.GetValueForProperty("KubeletConfigCpuCfsQuota",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuCfsQuota, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigCpuCfsQuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuCfsQuotaPeriod = (string) content.GetValueForProperty("KubeletConfigCpuCfsQuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuCfsQuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigImageGcHighThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigImageGcHighThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcHighThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigImageGcHighThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigImageGcLowThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigImageGcLowThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcLowThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigImageGcLowThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigTopologyManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigTopologyManagerPolicy = (string) content.GetValueForProperty("KubeletConfigTopologyManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigTopologyManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigAllowedUnsafeSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigAllowedUnsafeSysctl = (string[]) content.GetValueForProperty("KubeletConfigAllowedUnsafeSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigAllowedUnsafeSysctl, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubeletConfigFailSwapOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigFailSwapOn = (bool?) content.GetValueForProperty("KubeletConfigFailSwapOn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigFailSwapOn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigContainerLogMaxSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigContainerLogMaxSizeMb = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigContainerLogMaxSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigContainerLogMaxFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigContainerLogMaxFile = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxFile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigContainerLogMaxFile, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigPodMaxPid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigPodMaxPid = (int?) content.GetValueForProperty("KubeletConfigPodMaxPid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigPodMaxPid, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigTransparentHugePageEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigTransparentHugePageEnabled = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigTransparentHugePageEnabled, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigTransparentHugePageDefrag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigTransparentHugePageDefrag = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageDefrag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigTransparentHugePageDefrag, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigSwapFileSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigSwapFileSizeMb = (int?) content.GetValueForProperty("LinuxOSConfigSwapFileSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigSwapFileSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigSysctl = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) content.GetValueForProperty("LinuxOSConfigSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigSysctl, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileDisableOutboundNat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WindowProfileDisableOutboundNat = (bool?) content.GetValueForProperty("WindowProfileDisableOutboundNat",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WindowProfileDisableOutboundNat, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNodePublicIPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileNodePublicIPTag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]) content.GetValueForProperty("NetworkProfileNodePublicIPTag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileNodePublicIPTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTagTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileAllowedHostPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileAllowedHostPort = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]) content.GetValueForProperty("NetworkProfileAllowedHostPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileAllowedHostPort, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileApplicationSecurityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileApplicationSecurityGroup = (string[]) content.GetValueForProperty("NetworkProfileApplicationSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileApplicationSecurityGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SecurityProfileSshAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileSshAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess?) content.GetValueForProperty("SecurityProfileSshAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileSshAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess.CreateFrom); + } + if (content.Contains("SecurityProfileEnableVtpm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileEnableVtpm = (bool?) content.GetValueForProperty("SecurityProfileEnableVtpm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileEnableVtpm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityProfileEnableSecureBoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileEnableSecureBoot = (bool?) content.GetValueForProperty("SecurityProfileEnableSecureBoot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileEnableSecureBoot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuProfileInstallGpuDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuProfileInstallGpuDriver = (bool?) content.GetValueForProperty("GpuProfileInstallGpuDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuProfileInstallGpuDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ArtifactStreamingProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ArtifactStreamingProfileEnabled = (bool?) content.GetValueForProperty("ArtifactStreamingProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ArtifactStreamingProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VirtualMachineProfileScale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachineProfileScale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile) content.GetValueForProperty("VirtualMachineProfileScale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachineProfileScale, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfilePublicIPPrefixSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GatewayProfilePublicIPPrefixSize = (int?) content.GetValueForProperty("GatewayProfilePublicIPPrefixSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GatewayProfilePublicIPPrefixSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ScaleManual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleManual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("ScaleManual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleManual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleAutoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleAutoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("ScaleAutoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleAutoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.ConvertFrom)); + } + 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("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).AzureAsyncOperation = (string) content.GetValueForProperty("AzureAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).AzureAsyncOperation, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("KubeletConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig) content.GetValueForProperty("KubeletConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadRuntime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WorkloadRuntime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime?) content.GetValueForProperty("WorkloadRuntime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WorkloadRuntime, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime.CreateFrom); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxOSConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig) content.GetValueForProperty("LinuxOSConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfigTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GpuProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile) content.GetValueForProperty("GpuProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ArtifactStreamingProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ArtifactStreamingProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile) content.GetValueForProperty("ArtifactStreamingProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ArtifactStreamingProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfileTypeConverter.ConvertFrom); + } + if (content.Contains("VirtualMachinesProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachinesProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile) content.GetValueForProperty("VirtualMachinesProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachinesProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachinesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile) content.GetValueForProperty("GatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSDiskSizeGb = (int?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSDiskSizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType?) content.GetValueForProperty("OSDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType.CreateFrom); + } + if (content.Contains("KubeletDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType?) content.GetValueForProperty("KubeletDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType.CreateFrom); + } + if (content.Contains("MessageOfTheDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MessageOfTheDay = (string) content.GetValueForProperty("MessageOfTheDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MessageOfTheDay, global::System.Convert.ToString); + } + if (content.Contains("VnetSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VnetSubnetId = (string) content.GetValueForProperty("VnetSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VnetSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PodSubnetId = (string) content.GetValueForProperty("PodSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PodSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodIPAllocationMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PodIPAllocationMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode?) content.GetValueForProperty("PodIPAllocationMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PodIPAllocationMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode.CreateFrom); + } + if (content.Contains("MaxPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MaxPod = (int?) content.GetValueForProperty("MaxPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MaxPod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("MaxCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MaxCount = (int?) content.GetValueForProperty("MaxCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MaxCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MinCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MinCount = (int?) content.GetValueForProperty("MinCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).MinCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnableAutoScaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableAutoScaling = (bool?) content.GetValueForProperty("EnableAutoScaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableAutoScaling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ScaleDownMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleDownMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode?) content.GetValueForProperty("ScaleDownMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleDownMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode.CreateFrom); + } + if (content.Contains("PropertiesType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PropertiesType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType?) content.GetValueForProperty("PropertiesType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PropertiesType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType.CreateFrom); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode.CreateFrom); + } + if (content.Contains("OrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OrchestratorVersion = (string) content.GetValueForProperty("OrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).OrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentOrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CurrentOrchestratorVersion = (string) content.GetValueForProperty("CurrentOrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CurrentOrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnableNodePublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableNodePublicIP = (bool?) content.GetValueForProperty("EnableNodePublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableNodePublicIP, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableCustomCaTrust")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableCustomCaTrust = (bool?) content.GetValueForProperty("EnableCustomCaTrust",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableCustomCaTrust, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodePublicIPPrefixId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodePublicIPPrefixId = (string) content.GetValueForProperty("NodePublicIPPrefixId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodePublicIPPrefixId, global::System.Convert.ToString); + } + if (content.Contains("ScaleSetPriority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleSetPriority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority?) content.GetValueForProperty("ScaleSetPriority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleSetPriority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority.CreateFrom); + } + if (content.Contains("ScaleSetEvictionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleSetEvictionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy?) content.GetValueForProperty("ScaleSetEvictionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleSetEvictionPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy.CreateFrom); + } + if (content.Contains("SpotMaxPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SpotMaxPrice = (float?) content.GetValueForProperty("SpotMaxPrice",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SpotMaxPrice, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeLabel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels) content.GetValueForProperty("NodeLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeLabel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabelsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeTaint = (string[]) content.GetValueForProperty("NodeTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeInitializationTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeInitializationTaint = (string[]) content.GetValueForProperty("NodeInitializationTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NodeInitializationTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProximityPlacementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ProximityPlacementGroupId = (string) content.GetValueForProperty("ProximityPlacementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ProximityPlacementGroupId, global::System.Convert.ToString); + } + if (content.Contains("EnableEncryptionAtHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableEncryptionAtHost = (bool?) content.GetValueForProperty("EnableEncryptionAtHost",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableEncryptionAtHost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableUltraSsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableUltraSsd = (bool?) content.GetValueForProperty("EnableUltraSsd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableUltraSsd, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuInstanceProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuInstanceProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile?) content.GetValueForProperty("GpuInstanceProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuInstanceProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile.CreateFrom); + } + if (content.Contains("CapacityReservationGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CapacityReservationGroupId = (string) content.GetValueForProperty("CapacityReservationGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CapacityReservationGroupId, global::System.Convert.ToString); + } + if (content.Contains("HostGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).HostGroupId = (string) content.GetValueForProperty("HostGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).HostGroupId, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineNodesStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachineNodesStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[]) content.GetValueForProperty("VirtualMachineNodesStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachineNodesStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachineNodesTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingDrainTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingDrainTimeoutInMinute = (int?) content.GetValueForProperty("UpgradeSettingDrainTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingDrainTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingNodeSoakDurationInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingNodeSoakDurationInMinute = (int?) content.GetValueForProperty("UpgradeSettingNodeSoakDurationInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingNodeSoakDurationInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingUndrainableNodeBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingUndrainableNodeBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior?) content.GetValueForProperty("UpgradeSettingUndrainableNodeBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).UpgradeSettingUndrainableNodeBehavior, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior.CreateFrom); + } + if (content.Contains("KubeletConfigCpuManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuManagerPolicy = (string) content.GetValueForProperty("KubeletConfigCpuManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigCpuCfsQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuCfsQuota = (bool?) content.GetValueForProperty("KubeletConfigCpuCfsQuota",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuCfsQuota, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigCpuCfsQuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuCfsQuotaPeriod = (string) content.GetValueForProperty("KubeletConfigCpuCfsQuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigCpuCfsQuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigImageGcHighThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigImageGcHighThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcHighThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigImageGcHighThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigImageGcLowThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigImageGcLowThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcLowThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigImageGcLowThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigTopologyManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigTopologyManagerPolicy = (string) content.GetValueForProperty("KubeletConfigTopologyManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigTopologyManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigAllowedUnsafeSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigAllowedUnsafeSysctl = (string[]) content.GetValueForProperty("KubeletConfigAllowedUnsafeSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigAllowedUnsafeSysctl, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubeletConfigFailSwapOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigFailSwapOn = (bool?) content.GetValueForProperty("KubeletConfigFailSwapOn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigFailSwapOn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigContainerLogMaxSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigContainerLogMaxSizeMb = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigContainerLogMaxSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigContainerLogMaxFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigContainerLogMaxFile = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxFile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigContainerLogMaxFile, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigPodMaxPid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigPodMaxPid = (int?) content.GetValueForProperty("KubeletConfigPodMaxPid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).KubeletConfigPodMaxPid, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigTransparentHugePageEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigTransparentHugePageEnabled = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigTransparentHugePageEnabled, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigTransparentHugePageDefrag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigTransparentHugePageDefrag = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageDefrag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigTransparentHugePageDefrag, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigSwapFileSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigSwapFileSizeMb = (int?) content.GetValueForProperty("LinuxOSConfigSwapFileSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigSwapFileSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigSysctl = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) content.GetValueForProperty("LinuxOSConfigSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).LinuxOSConfigSysctl, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileDisableOutboundNat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WindowProfileDisableOutboundNat = (bool?) content.GetValueForProperty("WindowProfileDisableOutboundNat",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).WindowProfileDisableOutboundNat, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNodePublicIPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileNodePublicIPTag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]) content.GetValueForProperty("NetworkProfileNodePublicIPTag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileNodePublicIPTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTagTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileAllowedHostPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileAllowedHostPort = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]) content.GetValueForProperty("NetworkProfileAllowedHostPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileAllowedHostPort, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileApplicationSecurityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileApplicationSecurityGroup = (string[]) content.GetValueForProperty("NetworkProfileApplicationSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).NetworkProfileApplicationSecurityGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SecurityProfileSshAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileSshAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess?) content.GetValueForProperty("SecurityProfileSshAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileSshAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess.CreateFrom); + } + if (content.Contains("SecurityProfileEnableVtpm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileEnableVtpm = (bool?) content.GetValueForProperty("SecurityProfileEnableVtpm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileEnableVtpm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityProfileEnableSecureBoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileEnableSecureBoot = (bool?) content.GetValueForProperty("SecurityProfileEnableSecureBoot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).SecurityProfileEnableSecureBoot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuProfileInstallGpuDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuProfileInstallGpuDriver = (bool?) content.GetValueForProperty("GpuProfileInstallGpuDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GpuProfileInstallGpuDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ArtifactStreamingProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ArtifactStreamingProfileEnabled = (bool?) content.GetValueForProperty("ArtifactStreamingProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ArtifactStreamingProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VirtualMachineProfileScale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachineProfileScale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile) content.GetValueForProperty("VirtualMachineProfileScale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).VirtualMachineProfileScale, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfilePublicIPPrefixSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GatewayProfilePublicIPPrefixSize = (int?) content.GetValueForProperty("GatewayProfilePublicIPPrefixSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).GatewayProfilePublicIPPrefixSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ScaleManual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleManual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("ScaleManual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleManual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleAutoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleAutoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("ScaleAutoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).ScaleAutoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.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.ContainerService.Models.Api20240402Preview.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.ContainerService.Models.Api20240402Preview.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.ContainerService.Models.Api20240402Preview.IAgentPool FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Agent Pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolTypeConverter))] + public partial interface IAgentPool + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.TypeConverter.cs new file mode 100644 index 000000000000..c8f0a915666a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPool ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPool.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPool.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPool.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.cs new file mode 100644 index 000000000000..acde8ca6f2c3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.cs @@ -0,0 +1,1719 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Agent Pool. + public partial class AgentPool : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource __subResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SubResource(); + + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ArtifactStreamingProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ArtifactStreamingProfileEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ArtifactStreamingProfileEnabled = value ?? default(bool); } + + /// + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).AvailabilityZone = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CapacityReservationGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).CapacityReservationGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).CapacityReservationGroupId = value ?? null; } + + /// + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user + /// pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? Count { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).Count = value ?? default(int); } + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CreationDataSourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).CreationDataSourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).CreationDataSourceResourceId = value ?? null; } + + /// + /// If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + /// was , this field will contain the full version being used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CurrentOrchestratorVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).CurrentOrchestratorVersion; } + + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ETag; } + + /// Whether to enable auto-scaler + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnableAutoScaling { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableAutoScaling; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableAutoScaling = value ?? default(bool); } + + /// + /// When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + /// host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node + /// trust stores. Defaults to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnableCustomCaTrust { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableCustomCaTrust; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableCustomCaTrust = value ?? default(bool); } + + /// + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnableEncryptionAtHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableEncryptionAtHost; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableEncryptionAtHost = value ?? default(bool); } + + /// + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnableFips { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableFips; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableFips = value ?? default(bool); } + + /// + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario + /// is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + /// For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + /// The default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnableNodePublicIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableNodePublicIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableNodePublicIP = value ?? default(bool); } + + /// Whether to enable UltraSSD + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnableUltraSsd { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableUltraSsd; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).EnableUltraSsd = value ?? default(bool); } + + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? GatewayProfilePublicIPPrefixSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GatewayProfilePublicIPPrefixSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GatewayProfilePublicIPPrefixSize = value ?? default(int); } + + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile? GpuInstanceProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GpuInstanceProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GpuInstanceProfile = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile)""); } + + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? GpuProfileInstallGpuDriver { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GpuProfileInstallGpuDriver; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GpuProfileInstallGpuDriver = value ?? default(bool); } + + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + /// For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string HostGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).HostGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).HostGroupId = value ?? null; } + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Id; } + + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] KubeletConfigAllowedUnsafeSysctl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigAllowedUnsafeSysctl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigAllowedUnsafeSysctl = value ?? null /* arrayOf */; } + + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigContainerLogMaxFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigContainerLogMaxFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigContainerLogMaxFile = value ?? default(int); } + + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigContainerLogMaxSizeMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigContainerLogMaxSizeMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigContainerLogMaxSizeMb = value ?? default(int); } + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? KubeletConfigCpuCfsQuota { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigCpuCfsQuota; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigCpuCfsQuota = value ?? default(bool); } + + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeletConfigCpuCfsQuotaPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigCpuCfsQuotaPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigCpuCfsQuotaPeriod = value ?? null; } + + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeletConfigCpuManagerPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigCpuManagerPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigCpuManagerPolicy = value ?? null; } + + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? KubeletConfigFailSwapOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigFailSwapOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigFailSwapOn = value ?? default(bool); } + + /// To disable image garbage collection, set to 100. The default is 85% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigImageGcHighThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigImageGcHighThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigImageGcHighThreshold = value ?? default(int); } + + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigImageGcLowThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigImageGcLowThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigImageGcLowThreshold = value ?? default(int); } + + /// The maximum number of processes per pod. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigPodMaxPid { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigPodMaxPid; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigPodMaxPid = value ?? default(int); } + + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeletConfigTopologyManagerPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigTopologyManagerPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfigTopologyManagerPolicy = value ?? null; } + + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType? KubeletDiskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletDiskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletDiskType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType)""); } + + /// The size in MB of a swap file that will be created on each node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? LinuxOSConfigSwapFileSizeMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfigSwapFileSizeMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfigSwapFileSizeMb = value ?? default(int); } + + /// Sysctl settings for Linux agent nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig LinuxOSConfigSysctl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfigSysctl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfigSysctl = value ?? null /* model class */; } + + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string LinuxOSConfigTransparentHugePageDefrag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfigTransparentHugePageDefrag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfigTransparentHugePageDefrag = value ?? null; } + + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string LinuxOSConfigTransparentHugePageEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfigTransparentHugePageEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfigTransparentHugePageEnabled = value ?? null; } + + /// The maximum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? MaxCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).MaxCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).MaxCount = value ?? default(int); } + + /// The maximum number of pods that can run on a node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? MaxPod { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).MaxPod; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).MaxPod = value ?? default(int); } + + /// + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + /// the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed + /// raw and not be executed as a script). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string MessageOfTheDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).MessageOfTheDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).MessageOfTheDay = value ?? null; } + + /// Internal Acessors for ArtifactStreamingProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.ArtifactStreamingProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ArtifactStreamingProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ArtifactStreamingProfile = value; } + + /// Internal Acessors for CreationData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.CreationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).CreationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).CreationData = value; } + + /// Internal Acessors for CurrentOrchestratorVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.CurrentOrchestratorVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).CurrentOrchestratorVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).CurrentOrchestratorVersion = value; } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ETag = value; } + + /// Internal Acessors for GatewayProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.GatewayProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GatewayProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GatewayProfile = value; } + + /// Internal Acessors for GpuProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.GpuProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GpuProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).GpuProfile = value; } + + /// Internal Acessors for KubeletConfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.KubeletConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).KubeletConfig = value; } + + /// Internal Acessors for LinuxOSConfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.LinuxOSConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).LinuxOSConfig = value; } + + /// Internal Acessors for NetworkProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.NetworkProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NetworkProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NetworkProfile = value; } + + /// Internal Acessors for NodeImageVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.NodeImageVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodeImageVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodeImageVersion = value; } + + /// Internal Acessors for PowerState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).PowerState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for SecurityProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.SecurityProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SecurityProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SecurityProfile = value; } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.UpgradeSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSetting = value; } + + /// Internal Acessors for VirtualMachineProfileScale + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.VirtualMachineProfileScale { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VirtualMachineProfileScale; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VirtualMachineProfileScale = value; } + + /// Internal Acessors for VirtualMachinesProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.VirtualMachinesProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VirtualMachinesProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VirtualMachinesProfile = value; } + + /// Internal Acessors for WindowsProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal.WindowsProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).WindowsProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).WindowsProfile = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Type = value; } + + /// The minimum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? MinCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).MinCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).MinCount = value ?? default(int); } + + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode? Mode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).Mode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).Mode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode)""); } + + /// + /// The name of the resource that is unique within a resource group. This name can be used to access the resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Name; } + + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] NetworkProfileAllowedHostPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NetworkProfileAllowedHostPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NetworkProfileAllowedHostPort = value ?? null /* arrayOf */; } + + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] NetworkProfileApplicationSecurityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NetworkProfileApplicationSecurityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NetworkProfileApplicationSecurityGroup = value ?? null /* arrayOf */; } + + /// IPTags of instance-level public IPs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NetworkProfileNodePublicIPTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NetworkProfileNodePublicIPTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NetworkProfileNodePublicIPTag = value ?? null /* arrayOf */; } + + /// The version of node image + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string NodeImageVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodeImageVersion; } + + /// + /// These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + /// pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + /// node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, + /// for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] NodeInitializationTaint { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodeInitializationTaint; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodeInitializationTaint = value ?? null /* arrayOf */; } + + /// The node labels to be persisted across all nodes in agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels NodeLabel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodeLabel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodeLabel = value ?? null /* model class */; } + + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string NodePublicIPPrefixId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodePublicIPPrefixId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodePublicIPPrefixId = value ?? null; } + + /// + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] NodeTaint { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodeTaint; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).NodeTaint = value ?? null /* arrayOf */; } + + /// + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it + /// will apply the default osDisk size according to the vmSize specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? OSDiskSizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OSDiskSizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OSDiskSizeGb = value ?? default(int); } + + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType? OSDiskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OSDiskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OSDiskType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType)""); } + + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OSSku; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OSSku = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku)""); } + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OSType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OSType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType)""); } + + /// + /// Both patch version and are supported. When is specified, the latest supported + /// patch version is chosen automatically. Updating the agent pool with the same once it has been created will + /// not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools + /// in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control + /// plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version + /// cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string OrchestratorVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OrchestratorVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).OrchestratorVersion = value ?? null; } + + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode? PodIPAllocationMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).PodIPAllocationMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).PodIPAllocationMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode)""); } + + /// + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PodSubnetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).PodSubnetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).PodSubnetId = value ?? null; } + + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).PowerStateCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).PowerStateCode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code)""); } + + /// The type of Agent Pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType? PropertiesType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties _property; + + /// Properties of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileProperties()); set => this._property = value; } + + /// The current deployment or provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ProvisioningState; } + + /// The ID for Proximity Placement Group. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ProximityPlacementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ProximityPlacementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ProximityPlacementGroupId = value ?? null; } + + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleAutoscale; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleAutoscale = value ?? null /* arrayOf */; } + + /// + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode? ScaleDownMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleDownMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleDownMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode)""); } + + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleManual; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleManual = value ?? null /* arrayOf */; } + + /// + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleSetEvictionPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleSetEvictionPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy)""); } + + /// + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority? ScaleSetPriority { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleSetPriority; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).ScaleSetPriority = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority)""); } + + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SecurityProfileEnableSecureBoot { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SecurityProfileEnableSecureBoot; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SecurityProfileEnableSecureBoot = value ?? default(bool); } + + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SecurityProfileEnableVtpm { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SecurityProfileEnableVtpm; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SecurityProfileEnableVtpm = value ?? default(bool); } + + /// SSH access method of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SecurityProfileSshAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SecurityProfileSshAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SecurityProfileSshAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess)""); } + + /// + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + /// For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public float? SpotMaxPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SpotMaxPrice; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).SpotMaxPrice = value ?? default(float); } + + /// The tags to be persisted on the agent pool virtual machine scale set. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).Tag = value ?? null /* model class */; } + + /// Resource type + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Type; } + + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? UpgradeSettingDrainTimeoutInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSettingDrainTimeoutInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSettingDrainTimeoutInMinute = value ?? default(int); } + + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSettingMaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSettingMaxSurge = value ?? null; } + + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? UpgradeSettingNodeSoakDurationInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSettingNodeSoakDurationInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSettingNodeSoakDurationInMinute = value ?? default(int); } + + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UpgradeSettingUndrainableNodeBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSettingUndrainableNodeBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).UpgradeSettingUndrainableNodeBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior)""); } + + /// + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might + /// fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string VMSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VMSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VMSize = value ?? null; } + + /// The status of nodes in a VirtualMachines agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] VirtualMachineNodesStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VirtualMachineNodesStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VirtualMachineNodesStatus = value ?? null /* arrayOf */; } + + /// + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to + /// nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string VnetSubnetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VnetSubnetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).VnetSubnetId = value ?? null; } + + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WindowProfileDisableOutboundNat { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).WindowProfileDisableOutboundNat; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).WindowProfileDisableOutboundNat = value ?? default(bool); } + + /// Determines the type of workload a node can run. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime? WorkloadRuntime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).WorkloadRuntime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)Property).WorkloadRuntime = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime)""); } + + /// Creates an new instance. + public AgentPool() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader0) is string __headerAzureAsyncOperationHeader0 ? __headerAzureAsyncOperationHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__subResource), __subResource); + await eventListener.AssertObjectIsValid(nameof(__subResource), __subResource); + } + } + /// Agent Pool. + public partial interface IAgentPool : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource + { + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, container images must also enable artifact streaming on ACR. If not specified, the default is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ArtifactStreamingProfileEnabled { get; set; } + /// + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + string[] AvailabilityZone { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + /// + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"AKS will associate the specified agent pool with the Capacity Reservation Group.", + SerializedName = @"capacityReservationGroupID", + PossibleTypes = new [] { typeof(string) })] + string CapacityReservationGroupId { get; set; } + /// + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user + /// pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? Count { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string CreationDataSourceResourceId { get; set; } + /// + /// If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + /// was , this field will contain the full version being used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion was , this field will contain the full version being used.", + SerializedName = @"currentOrchestratorVersion", + PossibleTypes = new [] { typeof(string) })] + string CurrentOrchestratorVersion { get; } + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; } + /// Whether to enable auto-scaler + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable auto-scaler", + SerializedName = @"enableAutoScaling", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableAutoScaling { get; set; } + /// + /// When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + /// host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node + /// trust stores. Defaults to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node trust stores. Defaults to false.", + SerializedName = @"enableCustomCATrust", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableCustomCaTrust { get; set; } + /// + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption", + SerializedName = @"enableEncryptionAtHost", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableEncryptionAtHost { get; set; } + /// + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.", + SerializedName = @"enableFIPS", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableFips { get; set; } + /// + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario + /// is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + /// For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + /// The default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.", + SerializedName = @"enableNodePublicIP", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNodePublicIP { get; set; } + /// Whether to enable UltraSSD + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable UltraSSD", + SerializedName = @"enableUltraSSD", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableUltraSsd { get; set; } + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31.", + SerializedName = @"publicIPPrefixSize", + PossibleTypes = new [] { typeof(int) })] + int? GatewayProfilePublicIPPrefixSize { get; set; } + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.", + SerializedName = @"gpuInstanceProfile", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile? GpuInstanceProfile { get; set; } + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves.", + SerializedName = @"installGPUDriver", + PossibleTypes = new [] { typeof(bool) })] + bool? GpuProfileInstallGpuDriver { get; set; } + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + /// For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).", + SerializedName = @"hostGroupID", + PossibleTypes = new [] { typeof(string) })] + string HostGroupId { get; set; } + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`).", + SerializedName = @"allowedUnsafeSysctls", + PossibleTypes = new [] { typeof(string) })] + string[] KubeletConfigAllowedUnsafeSysctl { get; set; } + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of container log files that can be present for a container. The number must be ≥ 2.", + SerializedName = @"containerLogMaxFiles", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigContainerLogMaxFile { get; set; } + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size (e.g. 10Mi) of container log file before it is rotated.", + SerializedName = @"containerLogMaxSizeMB", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigContainerLogMaxSizeMb { get; set; } + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"cpuCfsQuota", + PossibleTypes = new [] { typeof(bool) })] + bool? KubeletConfigCpuCfsQuota { get; set; } + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'.", + SerializedName = @"cpuCfsQuotaPeriod", + PossibleTypes = new [] { typeof(string) })] + string KubeletConfigCpuCfsQuotaPeriod { get; set; } + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'.", + SerializedName = @"cpuManagerPolicy", + PossibleTypes = new [] { typeof(string) })] + string KubeletConfigCpuManagerPolicy { get; set; } + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true it will make the Kubelet fail to start if swap is enabled on the node.", + SerializedName = @"failSwapOn", + PossibleTypes = new [] { typeof(bool) })] + bool? KubeletConfigFailSwapOn { get; set; } + /// To disable image garbage collection, set to 100. The default is 85% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To disable image garbage collection, set to 100. The default is 85%", + SerializedName = @"imageGcHighThreshold", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigImageGcHighThreshold { get; set; } + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be set higher than imageGcHighThreshold. The default is 80%", + SerializedName = @"imageGcLowThreshold", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigImageGcLowThreshold { get; set; } + /// The maximum number of processes per pod. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of processes per pod.", + SerializedName = @"podMaxPids", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigPodMaxPid { get; set; } + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'.", + SerializedName = @"topologyManagerPolicy", + PossibleTypes = new [] { typeof(string) })] + string KubeletConfigTopologyManagerPolicy { get; set; } + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.", + SerializedName = @"kubeletDiskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType? KubeletDiskType { get; set; } + /// The size in MB of a swap file that will be created on each node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size in MB of a swap file that will be created on each node.", + SerializedName = @"swapFileSizeMB", + PossibleTypes = new [] { typeof(int) })] + int? LinuxOSConfigSwapFileSizeMb { get; set; } + /// Sysctl settings for Linux agent nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl settings for Linux agent nodes.", + SerializedName = @"sysctls", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig LinuxOSConfigSysctl { get; set; } + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).", + SerializedName = @"transparentHugePageDefrag", + PossibleTypes = new [] { typeof(string) })] + string LinuxOSConfigTransparentHugePageDefrag { get; set; } + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).", + SerializedName = @"transparentHugePageEnabled", + PossibleTypes = new [] { typeof(string) })] + string LinuxOSConfigTransparentHugePageEnabled { get; set; } + /// The maximum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of nodes for auto-scaling", + SerializedName = @"maxCount", + PossibleTypes = new [] { typeof(int) })] + int? MaxCount { get; set; } + /// The maximum number of pods that can run on a node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of pods that can run on a node.", + SerializedName = @"maxPods", + PossibleTypes = new [] { typeof(int) })] + int? MaxPod { get; set; } + /// + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + /// the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed + /// raw and not be executed as a script). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script).", + SerializedName = @"messageOfTheDay", + PossibleTypes = new [] { typeof(string) })] + string MessageOfTheDay { get; set; } + /// The minimum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The minimum number of nodes for auto-scaling", + SerializedName = @"minCount", + PossibleTypes = new [] { typeof(int) })] + int? MinCount { get; set; } + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode? Mode { get; set; } + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The port ranges that are allowed to access. The specified ranges are allowed to overlap.", + SerializedName = @"allowedHostPorts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] NetworkProfileAllowedHostPort { get; set; } + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IDs of the application security groups which agent pool will associate when created.", + SerializedName = @"applicationSecurityGroups", + PossibleTypes = new [] { typeof(string) })] + string[] NetworkProfileApplicationSecurityGroup { get; set; } + /// IPTags of instance-level public IPs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IPTags of instance-level public IPs.", + SerializedName = @"nodePublicIPTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NetworkProfileNodePublicIPTag { get; set; } + /// The version of node image + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of node image", + SerializedName = @"nodeImageVersion", + PossibleTypes = new [] { typeof(string) })] + string NodeImageVersion { get; } + /// + /// These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + /// pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + /// node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, + /// for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-`", + SerializedName = @"nodeInitializationTaints", + PossibleTypes = new [] { typeof(string) })] + string[] NodeInitializationTaint { get; set; } + /// The node labels to be persisted across all nodes in agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The node labels to be persisted across all nodes in agent pool.", + SerializedName = @"nodeLabels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels NodeLabel { get; set; } + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}", + SerializedName = @"nodePublicIPPrefixID", + PossibleTypes = new [] { typeof(string) })] + string NodePublicIPPrefixId { get; set; } + /// + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.", + SerializedName = @"nodeTaints", + PossibleTypes = new [] { typeof(string) })] + string[] NodeTaint { get; set; } + /// + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it + /// will apply the default osDisk size according to the vmSize specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.", + SerializedName = @"osDiskSizeGB", + PossibleTypes = new [] { typeof(int) })] + int? OSDiskSizeGb { get; set; } + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).", + SerializedName = @"osDiskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType? OSDiskType { get; set; } + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated.", + SerializedName = @"osSKU", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get; set; } + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get; set; } + /// + /// Both patch version and are supported. When is specified, the latest supported + /// patch version is chosen automatically. Updating the agent pool with the same once it has been created will + /// not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools + /// in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control + /// plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version + /// cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).", + SerializedName = @"orchestratorVersion", + PossibleTypes = new [] { typeof(string) })] + string OrchestratorVersion { get; set; } + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'.", + SerializedName = @"podIPAllocationMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode? PodIPAllocationMode { get; set; } + /// + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", + SerializedName = @"podSubnetID", + PossibleTypes = new [] { typeof(string) })] + string PodSubnetId { get; set; } + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tells whether the cluster is Running or Stopped", + SerializedName = @"code", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get; set; } + /// The type of Agent Pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of Agent Pool.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType? PropertiesType { get; set; } + /// The current deployment or provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current deployment or provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// The ID for Proximity Placement Group. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID for Proximity Placement Group.", + SerializedName = @"proximityPlacementGroupID", + PossibleTypes = new [] { typeof(string) })] + string ProximityPlacementGroupId { get; set; } + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed.", + SerializedName = @"autoscale", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get; set; } + /// + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.", + SerializedName = @"scaleDownMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode? ScaleDownMode { get; set; } + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed.", + SerializedName = @"manual", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get; set; } + /// + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.", + SerializedName = @"scaleSetEvictionPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get; set; } + /// + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.", + SerializedName = @"scaleSetPriority", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority? ScaleSetPriority { get; set; } + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.", + SerializedName = @"enableSecureBoot", + PossibleTypes = new [] { typeof(bool) })] + bool? SecurityProfileEnableSecureBoot { get; set; } + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.", + SerializedName = @"enableVTPM", + PossibleTypes = new [] { typeof(bool) })] + bool? SecurityProfileEnableVtpm { get; set; } + /// SSH access method of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SSH access method of an agent pool.", + SerializedName = @"sshAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SecurityProfileSshAccess { get; set; } + /// + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + /// For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing)", + SerializedName = @"spotMaxPrice", + PossibleTypes = new [] { typeof(float) })] + float? SpotMaxPrice { get; set; } + /// The tags to be persisted on the agent pool virtual machine scale set. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags to be persisted on the agent pool virtual machine scale set.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags Tag { get; set; } + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes.", + SerializedName = @"drainTimeoutInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? UpgradeSettingDrainTimeoutInMinute { get; set; } + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxSurge { get; set; } + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes.", + SerializedName = @"nodeSoakDurationInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? UpgradeSettingNodeSoakDurationInMinute { get; set; } + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes.", + SerializedName = @"undrainableNodeBehavior", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UpgradeSettingUndrainableNodeBehavior { get; set; } + /// + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might + /// fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + string VMSize { get; set; } + /// The status of nodes in a VirtualMachines agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status of nodes in a VirtualMachines agent pool.", + SerializedName = @"virtualMachineNodesStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] VirtualMachineNodesStatus { get; set; } + /// + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to + /// nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", + SerializedName = @"vnetSubnetID", + PossibleTypes = new [] { typeof(string) })] + string VnetSubnetId { get; set; } + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled.", + SerializedName = @"disableOutboundNat", + PossibleTypes = new [] { typeof(bool) })] + bool? WindowProfileDisableOutboundNat { get; set; } + /// Determines the type of workload a node can run. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the type of workload a node can run.", + SerializedName = @"workloadRuntime", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime? WorkloadRuntime { get; set; } + + } + /// Agent Pool. + internal partial interface IAgentPoolInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal + { + /// Configuration for using artifact streaming on AKS. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile ArtifactStreamingProfile { get; set; } + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + bool? ArtifactStreamingProfileEnabled { get; set; } + /// + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// + string[] AvailabilityZone { get; set; } + + string AzureAsyncOperation { get; set; } + /// + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// + string CapacityReservationGroupId { get; set; } + /// + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user + /// pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// + int? Count { get; set; } + /// + /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + string CreationDataSourceResourceId { get; set; } + /// + /// If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + /// was , this field will contain the full version being used. + /// + string CurrentOrchestratorVersion { get; set; } + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + string ETag { get; set; } + /// Whether to enable auto-scaler + bool? EnableAutoScaling { get; set; } + /// + /// When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + /// host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node + /// trust stores. Defaults to false. + /// + bool? EnableCustomCaTrust { get; set; } + /// + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + /// + bool? EnableEncryptionAtHost { get; set; } + /// + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + /// for more details. + /// + bool? EnableFips { get; set; } + /// + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario + /// is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + /// For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + /// The default is false. + /// + bool? EnableNodePublicIP { get; set; } + /// Whether to enable UltraSSD + bool? EnableUltraSsd { get; set; } + /// + /// Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile GatewayProfile { get; set; } + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + int? GatewayProfilePublicIPPrefixSize { get; set; } + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile? GpuInstanceProfile { get; set; } + /// The GPU settings of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile GpuProfile { get; set; } + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + bool? GpuProfileInstallGpuDriver { get; set; } + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + /// For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// + string HostGroupId { get; set; } + /// The Kubelet configuration on the agent pool nodes. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig KubeletConfig { get; set; } + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + string[] KubeletConfigAllowedUnsafeSysctl { get; set; } + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + int? KubeletConfigContainerLogMaxFile { get; set; } + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + int? KubeletConfigContainerLogMaxSizeMb { get; set; } + /// The default is true. + bool? KubeletConfigCpuCfsQuota { get; set; } + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + string KubeletConfigCpuCfsQuotaPeriod { get; set; } + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + string KubeletConfigCpuManagerPolicy { get; set; } + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + bool? KubeletConfigFailSwapOn { get; set; } + /// To disable image garbage collection, set to 100. The default is 85% + int? KubeletConfigImageGcHighThreshold { get; set; } + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + int? KubeletConfigImageGcLowThreshold { get; set; } + /// The maximum number of processes per pod. + int? KubeletConfigPodMaxPid { get; set; } + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + string KubeletConfigTopologyManagerPolicy { get; set; } + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType? KubeletDiskType { get; set; } + /// The OS configuration of Linux agent nodes. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig LinuxOSConfig { get; set; } + /// The size in MB of a swap file that will be created on each node. + int? LinuxOSConfigSwapFileSizeMb { get; set; } + /// Sysctl settings for Linux agent nodes. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig LinuxOSConfigSysctl { get; set; } + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + string LinuxOSConfigTransparentHugePageDefrag { get; set; } + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + string LinuxOSConfigTransparentHugePageEnabled { get; set; } + /// The maximum number of nodes for auto-scaling + int? MaxCount { get; set; } + /// The maximum number of pods that can run on a node. + int? MaxPod { get; set; } + /// + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + /// the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed + /// raw and not be executed as a script). + /// + string MessageOfTheDay { get; set; } + /// The minimum number of nodes for auto-scaling + int? MinCount { get; set; } + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode? Mode { get; set; } + /// Network-related settings of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile NetworkProfile { get; set; } + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] NetworkProfileAllowedHostPort { get; set; } + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + string[] NetworkProfileApplicationSecurityGroup { get; set; } + /// IPTags of instance-level public IPs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NetworkProfileNodePublicIPTag { get; set; } + /// The version of node image + string NodeImageVersion { get; set; } + /// + /// These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + /// pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + /// node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, + /// for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + /// + string[] NodeInitializationTaint { get; set; } + /// The node labels to be persisted across all nodes in agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels NodeLabel { get; set; } + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + /// + string NodePublicIPPrefixId { get; set; } + /// + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// + string[] NodeTaint { get; set; } + /// + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it + /// will apply the default osDisk size according to the vmSize specified. + /// + int? OSDiskSizeGb { get; set; } + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType? OSDiskType { get; set; } + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get; set; } + /// The operating system type. The default is Linux. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get; set; } + /// + /// Both patch version and are supported. When is specified, the latest supported + /// patch version is chosen automatically. Updating the agent pool with the same once it has been created will + /// not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools + /// in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control + /// plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version + /// cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// + string OrchestratorVersion { get; set; } + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode? PodIPAllocationMode { get; set; } + /// + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + string PodSubnetId { get; set; } + /// + /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. + /// A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it + /// is Running and provisioning state is Succeeded + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState PowerState { get; set; } + /// Tells whether the cluster is Running or Stopped + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get; set; } + /// The type of Agent Pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType? PropertiesType { get; set; } + /// Properties of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties Property { get; set; } + /// The current deployment or provisioning state. + string ProvisioningState { get; set; } + /// The ID for Proximity Placement Group. + string ProximityPlacementGroupId { get; set; } + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get; set; } + /// + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode? ScaleDownMode { get; set; } + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get; set; } + /// + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get; set; } + /// + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority? ScaleSetPriority { get; set; } + /// The security settings of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile SecurityProfile { get; set; } + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + bool? SecurityProfileEnableSecureBoot { get; set; } + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + bool? SecurityProfileEnableVtpm { get; set; } + /// SSH access method of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SecurityProfileSshAccess { get; set; } + /// + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + /// For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + /// + float? SpotMaxPrice { get; set; } + /// The tags to be persisted on the agent pool virtual machine scale set. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags Tag { get; set; } + /// Settings for upgrading the agentpool + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + int? UpgradeSettingDrainTimeoutInMinute { get; set; } + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + string UpgradeSettingMaxSurge { get; set; } + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + int? UpgradeSettingNodeSoakDurationInMinute { get; set; } + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UpgradeSettingUndrainableNodeBehavior { get; set; } + /// + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might + /// fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + /// + string VMSize { get; set; } + /// The status of nodes in a VirtualMachines agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] VirtualMachineNodesStatus { get; set; } + /// Specifications on how to scale a VirtualMachines agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile VirtualMachineProfileScale { get; set; } + /// Specifications on VirtualMachines agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile VirtualMachinesProfile { get; set; } + /// + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to + /// nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + string VnetSubnetId { get; set; } + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + bool? WindowProfileDisableOutboundNat { get; set; } + /// The Windows agent pool's specific profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile WindowsProfile { get; set; } + /// Determines the type of workload a node can run. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime? WorkloadRuntime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.json.cs new file mode 100644 index 000000000000..386f25cc708c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPool.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Agent Pool. + public partial class AgentPool + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPool(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __subResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SubResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPool(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __subResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.PowerShell.cs new file mode 100644 index 000000000000..cb3eece7f3e8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AgentPoolArtifactStreamingProfileTypeConverter))] + public partial class AgentPoolArtifactStreamingProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolArtifactStreamingProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfileInternal)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 AgentPoolArtifactStreamingProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfileInternal)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.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolArtifactStreamingProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolArtifactStreamingProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AgentPoolArtifactStreamingProfileTypeConverter))] + public partial interface IAgentPoolArtifactStreamingProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.TypeConverter.cs new file mode 100644 index 000000000000..1466c3362b16 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolArtifactStreamingProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolArtifactStreamingProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolArtifactStreamingProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolArtifactStreamingProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.cs new file mode 100644 index 000000000000..a000e0b00d4c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolArtifactStreamingProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfileInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Creates an new instance. + public AgentPoolArtifactStreamingProfile() + { + + } + } + public partial interface IAgentPoolArtifactStreamingProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, container images must also enable artifact streaming on ACR. If not specified, the default is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + internal partial interface IAgentPoolArtifactStreamingProfileInternal + + { + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.json.cs new file mode 100644 index 000000000000..5c6172c0f883 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolArtifactStreamingProfile.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolArtifactStreamingProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolArtifactStreamingProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolArtifactStreamingProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.PowerShell.cs new file mode 100644 index 000000000000..e0dd36e35a4e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The list of available versions for an agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolAvailableVersionsTypeConverter))] + public partial class AgentPoolAvailableVersions + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolAvailableVersions(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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("AgentPoolVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).AgentPoolVersion = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[]) content.GetValueForProperty("AgentPoolVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).AgentPoolVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgentPoolAvailableVersions(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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("AgentPoolVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).AgentPoolVersion = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[]) content.GetValueForProperty("AgentPoolVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal)this).AgentPoolVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTypeConverter.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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolAvailableVersions(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolAvailableVersions(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of available versions for an agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolAvailableVersionsTypeConverter))] + public partial interface IAgentPoolAvailableVersions + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.TypeConverter.cs new file mode 100644 index 000000000000..377ba7699d1d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolAvailableVersionsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolAvailableVersions.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolAvailableVersions.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolAvailableVersions.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.cs new file mode 100644 index 000000000000..f24be51f2eba --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available versions for an agent pool. + public partial class AgentPoolAvailableVersions : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal + { + + /// List of versions available for agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[] AgentPoolVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesInternal)Property).AgentPoolVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesInternal)Property).AgentPoolVersion = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _id; + + /// The ID of the agent pool version list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsProperties()); set { {_property = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the agent pool version list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties _property; + + /// Properties of agent pool available versions. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsProperties()); set => this._property = value; } + + /// Backing field for property. + private string _type; + + /// Type of the agent pool version list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public AgentPoolAvailableVersions() + { + + } + } + /// The list of available versions for an agent pool. + public partial interface IAgentPoolAvailableVersions : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// List of versions available for agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of versions available for agent pool.", + SerializedName = @"agentPoolVersions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[] AgentPoolVersion { get; set; } + /// The ID of the agent pool version list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID of the agent pool version list.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The name of the agent pool version list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the agent pool version list.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Type of the agent pool version list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Type of the agent pool version list.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The list of available versions for an agent pool. + internal partial interface IAgentPoolAvailableVersionsInternal + + { + /// List of versions available for agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[] AgentPoolVersion { get; set; } + /// The ID of the agent pool version list. + string Id { get; set; } + /// The name of the agent pool version list. + string Name { get; set; } + /// Properties of agent pool available versions. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties Property { get; set; } + /// Type of the agent pool version list. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.json.cs new file mode 100644 index 000000000000..927b3b5e0f87 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersions.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available versions for an agent pool. + public partial class AgentPoolAvailableVersions + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolAvailableVersions(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsProperties.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolAvailableVersions(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.PowerShell.cs new file mode 100644 index 000000000000..a0fac60646d1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The list of available agent pool versions. + [System.ComponentModel.TypeConverter(typeof(AgentPoolAvailableVersionsPropertiesTypeConverter))] + public partial class AgentPoolAvailableVersionsProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolAvailableVersionsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AgentPoolVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesInternal)this).AgentPoolVersion = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[]) content.GetValueForProperty("AgentPoolVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesInternal)this).AgentPoolVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgentPoolAvailableVersionsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AgentPoolVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesInternal)this).AgentPoolVersion = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[]) content.GetValueForProperty("AgentPoolVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesInternal)this).AgentPoolVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTypeConverter.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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolAvailableVersionsProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolAvailableVersionsProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of available agent pool versions. + [System.ComponentModel.TypeConverter(typeof(AgentPoolAvailableVersionsPropertiesTypeConverter))] + public partial interface IAgentPoolAvailableVersionsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.TypeConverter.cs new file mode 100644 index 000000000000..50766b41c6da --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolAvailableVersionsPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolAvailableVersionsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolAvailableVersionsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolAvailableVersionsProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.cs new file mode 100644 index 000000000000..4cd73d2405c5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available agent pool versions. + public partial class AgentPoolAvailableVersionsProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[] _agentPoolVersion; + + /// List of versions available for agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[] AgentPoolVersion { get => this._agentPoolVersion; set => this._agentPoolVersion = value; } + + /// Creates an new instance. + public AgentPoolAvailableVersionsProperties() + { + + } + } + /// The list of available agent pool versions. + public partial interface IAgentPoolAvailableVersionsProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// List of versions available for agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of versions available for agent pool.", + SerializedName = @"agentPoolVersions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[] AgentPoolVersion { get; set; } + + } + /// The list of available agent pool versions. + internal partial interface IAgentPoolAvailableVersionsPropertiesInternal + + { + /// List of versions available for agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem[] AgentPoolVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.json.cs new file mode 100644 index 000000000000..8d5ce45a02dc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsProperties.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available agent pool versions. + public partial class AgentPoolAvailableVersionsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolAvailableVersionsProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_agentPoolVersion = If( json?.PropertyT("agentPoolVersions"), out var __jsonAgentPoolVersions) ? If( __jsonAgentPoolVersions as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.FromJson(__u) )) ))() : null : AgentPoolVersion;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolAvailableVersionsProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._agentPoolVersion) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._agentPoolVersion ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("agentPoolVersions",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.PowerShell.cs new file mode 100644 index 000000000000..b7ca8746561e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTypeConverter))] + public partial class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Default")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).Default = (bool?) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).Default, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("IsPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).IsPreview = (bool?) content.GetValueForProperty("IsPreview",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).IsPreview, (__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 AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Default")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).Default = (bool?) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).Default, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("IsPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).IsPreview = (bool?) content.GetValueForProperty("IsPreview",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal)this).IsPreview, (__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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTypeConverter))] + public partial interface IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.TypeConverter.cs new file mode 100644 index 000000000000..006e3882688e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs new file mode 100644 index 000000000000..7de183f6048a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal + { + + /// Backing field for property. + private bool? _default; + + /// Whether this version is the default agent pool version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Default { get => this._default; set => this._default = value; } + + /// Backing field for property. + private bool? _isPreview; + + /// Whether Kubernetes version is currently in preview. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? IsPreview { get => this._isPreview; set => this._isPreview = value; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } + + /// + /// Creates an new instance. + /// + public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem() + { + + } + } + public partial interface IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether this version is the default agent pool version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether this version is the default agent pool version.", + SerializedName = @"default", + PossibleTypes = new [] { typeof(bool) })] + bool? Default { get; set; } + /// Whether Kubernetes version is currently in preview. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether Kubernetes version is currently in preview.", + SerializedName = @"isPreview", + PossibleTypes = new [] { typeof(bool) })] + bool? IsPreview { get; set; } + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Kubernetes version (major.minor.patch).", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + + } + internal partial interface IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItemInternal + + { + /// Whether this version is the default agent pool version. + bool? Default { get; set; } + /// Whether Kubernetes version is currently in preview. + bool? IsPreview { get; set; } + /// The Kubernetes version (major.minor.patch). + string KubernetesVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.json.cs new file mode 100644 index 000000000000..34545b4f37cd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (bool?)__jsonDefault : Default;} + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} + {_isPreview = If( json?.PropertyT("isPreview"), out var __jsonIsPreview) ? (bool?)__jsonIsPreview : IsPreview;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._default ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._default) : null, "default" ,container.Add ); + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + AddIf( null != this._isPreview ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._isPreview) : null, "isPreview" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.PowerShell.cs new file mode 100644 index 000000000000..62024077acd5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Specifies a list of machine names from the agent pool to be deleted. + [System.ComponentModel.TypeConverter(typeof(AgentPoolDeleteMachinesParameterTypeConverter))] + public partial class AgentPoolDeleteMachinesParameter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolDeleteMachinesParameter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameterInternal)this).MachineName = (string[]) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameterInternal)this).MachineName, __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 AgentPoolDeleteMachinesParameter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameterInternal)this).MachineName = (string[]) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameterInternal)this).MachineName, __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.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolDeleteMachinesParameter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolDeleteMachinesParameter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Specifies a list of machine names from the agent pool to be deleted. + [System.ComponentModel.TypeConverter(typeof(AgentPoolDeleteMachinesParameterTypeConverter))] + public partial interface IAgentPoolDeleteMachinesParameter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.TypeConverter.cs new file mode 100644 index 000000000000..36306e2c9075 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolDeleteMachinesParameterTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolDeleteMachinesParameter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolDeleteMachinesParameter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolDeleteMachinesParameter.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.cs new file mode 100644 index 000000000000..f9b259c760bc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifies a list of machine names from the agent pool to be deleted. + public partial class AgentPoolDeleteMachinesParameter : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameterInternal + { + + /// Backing field for property. + private string[] _machineName; + + /// The agent pool machine names. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] MachineName { get => this._machineName; set => this._machineName = value; } + + /// Creates an new instance. + public AgentPoolDeleteMachinesParameter() + { + + } + } + /// Specifies a list of machine names from the agent pool to be deleted. + public partial interface IAgentPoolDeleteMachinesParameter : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The agent pool machine names. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The agent pool machine names.", + SerializedName = @"machineNames", + PossibleTypes = new [] { typeof(string) })] + string[] MachineName { get; set; } + + } + /// Specifies a list of machine names from the agent pool to be deleted. + internal partial interface IAgentPoolDeleteMachinesParameterInternal + + { + /// The agent pool machine names. + string[] MachineName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.json.cs new file mode 100644 index 000000000000..f957f6b9345e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolDeleteMachinesParameter.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifies a list of machine names from the agent pool to be deleted. + public partial class AgentPoolDeleteMachinesParameter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolDeleteMachinesParameter(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_machineName = If( json?.PropertyT("machineNames"), out var __jsonMachineNames) ? If( __jsonMachineNames as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : MachineName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolDeleteMachinesParameter(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._machineName) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._machineName ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("machineNames",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.PowerShell.cs new file mode 100644 index 000000000000..2f7ae196db0c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Profile of the managed cluster gateway agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolGatewayProfileTypeConverter))] + public partial class AgentPoolGatewayProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolGatewayProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicIPPrefixSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfileInternal)this).PublicIPPrefixSize = (int?) content.GetValueForProperty("PublicIPPrefixSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfileInternal)this).PublicIPPrefixSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgentPoolGatewayProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicIPPrefixSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfileInternal)this).PublicIPPrefixSize = (int?) content.GetValueForProperty("PublicIPPrefixSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfileInternal)this).PublicIPPrefixSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolGatewayProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolGatewayProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Profile of the managed cluster gateway agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolGatewayProfileTypeConverter))] + public partial interface IAgentPoolGatewayProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.TypeConverter.cs new file mode 100644 index 000000000000..d3c42bc12b5f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolGatewayProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolGatewayProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolGatewayProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolGatewayProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.cs new file mode 100644 index 000000000000..a7629469262e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of the managed cluster gateway agent pool. + public partial class AgentPoolGatewayProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfileInternal + { + + /// Backing field for property. + private int? _publicIPPrefixSize; + + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? PublicIPPrefixSize { get => this._publicIPPrefixSize; set => this._publicIPPrefixSize = value; } + + /// Creates an new instance. + public AgentPoolGatewayProfile() + { + + } + } + /// Profile of the managed cluster gateway agent pool. + public partial interface IAgentPoolGatewayProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31.", + SerializedName = @"publicIPPrefixSize", + PossibleTypes = new [] { typeof(int) })] + int? PublicIPPrefixSize { get; set; } + + } + /// Profile of the managed cluster gateway agent pool. + internal partial interface IAgentPoolGatewayProfileInternal + + { + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + int? PublicIPPrefixSize { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.json.cs new file mode 100644 index 000000000000..b297f3efc9a5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGatewayProfile.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of the managed cluster gateway agent pool. + public partial class AgentPoolGatewayProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolGatewayProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_publicIPPrefixSize = If( json?.PropertyT("publicIPPrefixSize"), out var __jsonPublicIPPrefixSize) ? (int?)__jsonPublicIPPrefixSize : PublicIPPrefixSize;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolGatewayProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._publicIPPrefixSize ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._publicIPPrefixSize) : null, "publicIPPrefixSize" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.PowerShell.cs new file mode 100644 index 000000000000..362db01a4292 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AgentPoolGpuProfileTypeConverter))] + public partial class AgentPoolGpuProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolGpuProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InstallGpuDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfileInternal)this).InstallGpuDriver = (bool?) content.GetValueForProperty("InstallGpuDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfileInternal)this).InstallGpuDriver, (__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 AgentPoolGpuProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InstallGpuDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfileInternal)this).InstallGpuDriver = (bool?) content.GetValueForProperty("InstallGpuDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfileInternal)this).InstallGpuDriver, (__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.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolGpuProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolGpuProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AgentPoolGpuProfileTypeConverter))] + public partial interface IAgentPoolGpuProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.TypeConverter.cs new file mode 100644 index 000000000000..f831a8c7f317 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolGpuProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolGpuProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolGpuProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolGpuProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.cs new file mode 100644 index 000000000000..047a382e035d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolGpuProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfileInternal + { + + /// Backing field for property. + private bool? _installGpuDriver; + + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? InstallGpuDriver { get => this._installGpuDriver; set => this._installGpuDriver = value; } + + /// Creates an new instance. + public AgentPoolGpuProfile() + { + + } + } + public partial interface IAgentPoolGpuProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves.", + SerializedName = @"installGPUDriver", + PossibleTypes = new [] { typeof(bool) })] + bool? InstallGpuDriver { get; set; } + + } + internal partial interface IAgentPoolGpuProfileInternal + + { + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + bool? InstallGpuDriver { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.json.cs new file mode 100644 index 000000000000..8719d9c3bec4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolGpuProfile.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolGpuProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolGpuProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_installGpuDriver = If( json?.PropertyT("installGPUDriver"), out var __jsonInstallGpuDriver) ? (bool?)__jsonInstallGpuDriver : InstallGpuDriver;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolGpuProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._installGpuDriver ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._installGpuDriver) : null, "installGPUDriver" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.PowerShell.cs new file mode 100644 index 000000000000..2b5ebbc0097a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The response from the List Agent Pools operation. + [System.ComponentModel.TypeConverter(typeof(AgentPoolListResultTypeConverter))] + public partial class AgentPoolListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolListResult(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.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal)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 AgentPoolListResult(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.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal)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.ContainerService.Models.Api20240402Preview.IAgentPoolListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List Agent Pools operation. + [System.ComponentModel.TypeConverter(typeof(AgentPoolListResultTypeConverter))] + public partial interface IAgentPoolListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.TypeConverter.cs new file mode 100644 index 000000000000..c99ef1522189 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.cs new file mode 100644 index 000000000000..87b1821e4068 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Agent Pools operation. + public partial class AgentPoolListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next set of agent pool results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool[] _value; + + /// The list of agent pools. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public AgentPoolListResult() + { + + } + } + /// The response from the List Agent Pools operation. + public partial interface IAgentPoolListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next set of agent pool results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next set of agent pool results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of agent pools. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of agent pools.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool[] Value { get; set; } + + } + /// The response from the List Agent Pools operation. + internal partial interface IAgentPoolListResultInternal + + { + /// The URL to get the next set of agent pool results. + string NextLink { get; set; } + /// The list of agent pools. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.json.cs new file mode 100644 index 000000000000..affd75edf8e4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Agent Pools operation. + public partial class AgentPoolListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPool) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPool.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.ContainerService.Models.Api20240402Preview.IAgentPoolListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.PowerShell.cs new file mode 100644 index 000000000000..c0d9bfaf4f1a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Network settings of an agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolNetworkProfileTypeConverter))] + public partial class AgentPoolNetworkProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolNetworkProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NodePublicIPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).NodePublicIPTag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]) content.GetValueForProperty("NodePublicIPTag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).NodePublicIPTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTagTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowedHostPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).AllowedHostPort = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]) content.GetValueForProperty("AllowedHostPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).AllowedHostPort, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ApplicationSecurityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).ApplicationSecurityGroup = (string[]) content.GetValueForProperty("ApplicationSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).ApplicationSecurityGroup, __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 AgentPoolNetworkProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NodePublicIPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).NodePublicIPTag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]) content.GetValueForProperty("NodePublicIPTag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).NodePublicIPTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTagTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowedHostPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).AllowedHostPort = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]) content.GetValueForProperty("AllowedHostPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).AllowedHostPort, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ApplicationSecurityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).ApplicationSecurityGroup = (string[]) content.GetValueForProperty("ApplicationSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)this).ApplicationSecurityGroup, __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.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolNetworkProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolNetworkProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Network settings of an agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolNetworkProfileTypeConverter))] + public partial interface IAgentPoolNetworkProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.TypeConverter.cs new file mode 100644 index 000000000000..d8fc7c30e9a7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolNetworkProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolNetworkProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolNetworkProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolNetworkProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.cs new file mode 100644 index 000000000000..580f03473482 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Network settings of an agent pool. + public partial class AgentPoolNetworkProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] _allowedHostPort; + + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] AllowedHostPort { get => this._allowedHostPort; set => this._allowedHostPort = value; } + + /// Backing field for property. + private string[] _applicationSecurityGroup; + + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] ApplicationSecurityGroup { get => this._applicationSecurityGroup; set => this._applicationSecurityGroup = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] _nodePublicIPTag; + + /// IPTags of instance-level public IPs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NodePublicIPTag { get => this._nodePublicIPTag; set => this._nodePublicIPTag = value; } + + /// Creates an new instance. + public AgentPoolNetworkProfile() + { + + } + } + /// Network settings of an agent pool. + public partial interface IAgentPoolNetworkProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The port ranges that are allowed to access. The specified ranges are allowed to overlap.", + SerializedName = @"allowedHostPorts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] AllowedHostPort { get; set; } + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IDs of the application security groups which agent pool will associate when created.", + SerializedName = @"applicationSecurityGroups", + PossibleTypes = new [] { typeof(string) })] + string[] ApplicationSecurityGroup { get; set; } + /// IPTags of instance-level public IPs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IPTags of instance-level public IPs.", + SerializedName = @"nodePublicIPTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NodePublicIPTag { get; set; } + + } + /// Network settings of an agent pool. + internal partial interface IAgentPoolNetworkProfileInternal + + { + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] AllowedHostPort { get; set; } + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + string[] ApplicationSecurityGroup { get; set; } + /// IPTags of instance-level public IPs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NodePublicIPTag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.json.cs new file mode 100644 index 000000000000..c7b611e82048 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolNetworkProfile.json.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Network settings of an agent pool. + public partial class AgentPoolNetworkProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolNetworkProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_nodePublicIPTag = If( json?.PropertyT("nodePublicIPTags"), out var __jsonNodePublicIPTags) ? If( __jsonNodePublicIPTags as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIPTag) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTag.FromJson(__u) )) ))() : null : NodePublicIPTag;} + {_allowedHostPort = If( json?.PropertyT("allowedHostPorts"), out var __jsonAllowedHostPorts) ? If( __jsonAllowedHostPorts as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPortRange) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRange.FromJson(__p) )) ))() : null : AllowedHostPort;} + {_applicationSecurityGroup = If( json?.PropertyT("applicationSecurityGroups"), out var __jsonApplicationSecurityGroups) ? If( __jsonApplicationSecurityGroups as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : ApplicationSecurityGroup;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolNetworkProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._nodePublicIPTag) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._nodePublicIPTag ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("nodePublicIPTags",__w); + } + if (null != this._allowedHostPort) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._allowedHostPort ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("allowedHostPorts",__r); + } + if (null != this._applicationSecurityGroup) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __n in this._applicationSecurityGroup ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("applicationSecurityGroups",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.PowerShell.cs new file mode 100644 index 000000000000..4a4536c7a94e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The security settings of an agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolSecurityProfileTypeConverter))] + public partial class AgentPoolSecurityProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolSecurityProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).SshAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess?) content.GetValueForProperty("SshAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).SshAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess.CreateFrom); + } + if (content.Contains("EnableVtpm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).EnableVtpm = (bool?) content.GetValueForProperty("EnableVtpm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).EnableVtpm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableSecureBoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).EnableSecureBoot = (bool?) content.GetValueForProperty("EnableSecureBoot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).EnableSecureBoot, (__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 AgentPoolSecurityProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).SshAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess?) content.GetValueForProperty("SshAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).SshAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess.CreateFrom); + } + if (content.Contains("EnableVtpm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).EnableVtpm = (bool?) content.GetValueForProperty("EnableVtpm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).EnableVtpm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableSecureBoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).EnableSecureBoot = (bool?) content.GetValueForProperty("EnableSecureBoot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)this).EnableSecureBoot, (__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.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolSecurityProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolSecurityProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The security settings of an agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolSecurityProfileTypeConverter))] + public partial interface IAgentPoolSecurityProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.TypeConverter.cs new file mode 100644 index 000000000000..2fdf14853ba7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolSecurityProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolSecurityProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolSecurityProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolSecurityProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.cs new file mode 100644 index 000000000000..9474c0cf9a33 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The security settings of an agent pool. + public partial class AgentPoolSecurityProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal + { + + /// Backing field for property. + private bool? _enableSecureBoot; + + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableSecureBoot { get => this._enableSecureBoot; set => this._enableSecureBoot = value; } + + /// Backing field for property. + private bool? _enableVtpm; + + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableVtpm { get => this._enableVtpm; set => this._enableVtpm = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? _sshAccess; + + /// SSH access method of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SshAccess { get => this._sshAccess; set => this._sshAccess = value; } + + /// Creates an new instance. + public AgentPoolSecurityProfile() + { + + } + } + /// The security settings of an agent pool. + public partial interface IAgentPoolSecurityProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.", + SerializedName = @"enableSecureBoot", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableSecureBoot { get; set; } + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.", + SerializedName = @"enableVTPM", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableVtpm { get; set; } + /// SSH access method of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SSH access method of an agent pool.", + SerializedName = @"sshAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SshAccess { get; set; } + + } + /// The security settings of an agent pool. + internal partial interface IAgentPoolSecurityProfileInternal + + { + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + bool? EnableSecureBoot { get; set; } + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + bool? EnableVtpm { get; set; } + /// SSH access method of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SshAccess { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.json.cs new file mode 100644 index 000000000000..22c8ff894e2d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolSecurityProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The security settings of an agent pool. + public partial class AgentPoolSecurityProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolSecurityProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sshAccess = If( json?.PropertyT("sshAccess"), out var __jsonSshAccess) ? (string)__jsonSshAccess : (string)SshAccess;} + {_enableVtpm = If( json?.PropertyT("enableVTPM"), out var __jsonEnableVtpm) ? (bool?)__jsonEnableVtpm : EnableVtpm;} + {_enableSecureBoot = If( json?.PropertyT("enableSecureBoot"), out var __jsonEnableSecureBoot) ? (bool?)__jsonEnableSecureBoot : EnableSecureBoot;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolSecurityProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sshAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._sshAccess.ToString()) : null, "sshAccess" ,container.Add ); + AddIf( null != this._enableVtpm ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableVtpm) : null, "enableVTPM" ,container.Add ); + AddIf( null != this._enableSecureBoot ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableSecureBoot) : null, "enableSecureBoot" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.PowerShell.cs new file mode 100644 index 000000000000..bbbbad9a776b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.PowerShell.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The list of available upgrades for an agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolUpgradeProfileTypeConverter))] + public partial class AgentPoolUpgradeProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolUpgradeProfile(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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Upgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfilePropertiesUpgradesItemTypeConverter.ConvertFrom)); + } + if (content.Contains("LatestNodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).LatestNodeImageVersion = (string) content.GetValueForProperty("LatestNodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).LatestNodeImageVersion, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgentPoolUpgradeProfile(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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Upgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfilePropertiesUpgradesItemTypeConverter.ConvertFrom)); + } + if (content.Contains("LatestNodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).LatestNodeImageVersion = (string) content.GetValueForProperty("LatestNodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal)this).LatestNodeImageVersion, 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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolUpgradeProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolUpgradeProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of available upgrades for an agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolUpgradeProfileTypeConverter))] + public partial interface IAgentPoolUpgradeProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.TypeConverter.cs new file mode 100644 index 000000000000..9dfe10009888 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolUpgradeProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolUpgradeProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolUpgradeProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolUpgradeProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.cs new file mode 100644 index 000000000000..855ad23e58c6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available upgrades for an agent pool. + public partial class AgentPoolUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal + { + + /// Backing field for property. + private string _id; + + /// The ID of the agent pool upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)Property).KubernetesVersion = value ; } + + /// The latest AKS supported node image version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string LatestNodeImageVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)Property).LatestNodeImageVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)Property).LatestNodeImageVersion = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfileProperties()); set { {_property = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the agent pool upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)Property).OSType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)Property).OSType = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties _property; + + /// The properties of the agent pool upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfileProperties()); set => this._property = value; } + + /// Backing field for property. + private string _type; + + /// The type of the agent pool upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[] Upgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)Property).Upgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)Property).Upgrade = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public AgentPoolUpgradeProfile() + { + + } + } + /// The list of available upgrades for an agent pool. + public partial interface IAgentPoolUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The ID of the agent pool upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID of the agent pool upgrade profile.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Kubernetes version (major.minor.patch).", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// The latest AKS supported node image version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The latest AKS supported node image version.", + SerializedName = @"latestNodeImageVersion", + PossibleTypes = new [] { typeof(string) })] + string LatestNodeImageVersion { get; set; } + /// The name of the agent pool upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the agent pool upgrade profile.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get; set; } + /// The type of the agent pool upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the agent pool upgrade profile.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of orchestrator types and versions available for upgrade.", + SerializedName = @"upgrades", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[] Upgrade { get; set; } + + } + /// The list of available upgrades for an agent pool. + internal partial interface IAgentPoolUpgradeProfileInternal + + { + /// The ID of the agent pool upgrade profile. + string Id { get; set; } + /// The Kubernetes version (major.minor.patch). + string KubernetesVersion { get; set; } + /// The latest AKS supported node image version. + string LatestNodeImageVersion { get; set; } + /// The name of the agent pool upgrade profile. + string Name { get; set; } + /// The operating system type. The default is Linux. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get; set; } + /// The properties of the agent pool upgrade profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties Property { get; set; } + /// The type of the agent pool upgrade profile. + string Type { get; set; } + /// List of orchestrator types and versions available for upgrade. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[] Upgrade { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.json.cs new file mode 100644 index 000000000000..09db7f3f9f89 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available upgrades for an agent pool. + public partial class AgentPoolUpgradeProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolUpgradeProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfileProperties.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolUpgradeProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.PowerShell.cs new file mode 100644 index 000000000000..11b1003f22d6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The list of available upgrade versions. + [System.ComponentModel.TypeConverter(typeof(AgentPoolUpgradeProfilePropertiesTypeConverter))] + public partial class AgentPoolUpgradeProfileProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolUpgradeProfileProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).Upgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfilePropertiesUpgradesItemTypeConverter.ConvertFrom)); + } + if (content.Contains("LatestNodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).LatestNodeImageVersion = (string) content.GetValueForProperty("LatestNodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).LatestNodeImageVersion, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgentPoolUpgradeProfileProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).Upgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfilePropertiesUpgradesItemTypeConverter.ConvertFrom)); + } + if (content.Contains("LatestNodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).LatestNodeImageVersion = (string) content.GetValueForProperty("LatestNodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal)this).LatestNodeImageVersion, 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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolUpgradeProfileProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolUpgradeProfileProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of available upgrade versions. + [System.ComponentModel.TypeConverter(typeof(AgentPoolUpgradeProfilePropertiesTypeConverter))] + public partial interface IAgentPoolUpgradeProfileProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.TypeConverter.cs new file mode 100644 index 000000000000..0adccc26ad44 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolUpgradeProfilePropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolUpgradeProfileProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolUpgradeProfileProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolUpgradeProfileProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.cs new file mode 100644 index 000000000000..8a744d82a3b8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available upgrade versions. + public partial class AgentPoolUpgradeProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesInternal + { + + /// Backing field for property. + private string _kubernetesVersion; + + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } + + /// Backing field for property. + private string _latestNodeImageVersion; + + /// The latest AKS supported node image version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string LatestNodeImageVersion { get => this._latestNodeImageVersion; set => this._latestNodeImageVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType _oSType; + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get => this._oSType; set => this._oSType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[] _upgrade; + + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[] Upgrade { get => this._upgrade; set => this._upgrade = value; } + + /// Creates an new instance. + public AgentPoolUpgradeProfileProperties() + { + + } + } + /// The list of available upgrade versions. + public partial interface IAgentPoolUpgradeProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Kubernetes version (major.minor.patch).", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// The latest AKS supported node image version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The latest AKS supported node image version.", + SerializedName = @"latestNodeImageVersion", + PossibleTypes = new [] { typeof(string) })] + string LatestNodeImageVersion { get; set; } + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get; set; } + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of orchestrator types and versions available for upgrade.", + SerializedName = @"upgrades", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[] Upgrade { get; set; } + + } + /// The list of available upgrade versions. + internal partial interface IAgentPoolUpgradeProfilePropertiesInternal + + { + /// The Kubernetes version (major.minor.patch). + string KubernetesVersion { get; set; } + /// The latest AKS supported node image version. + string LatestNodeImageVersion { get; set; } + /// The operating system type. The default is Linux. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get; set; } + /// List of orchestrator types and versions available for upgrade. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem[] Upgrade { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.json.cs new file mode 100644 index 000000000000..ddf63323c35b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfileProperties.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available upgrade versions. + public partial class AgentPoolUpgradeProfileProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolUpgradeProfileProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} + {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)OSType;} + {_upgrade = If( json?.PropertyT("upgrades"), out var __jsonUpgrades) ? If( __jsonUpgrades as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeProfilePropertiesUpgradesItem.FromJson(__u) )) ))() : null : Upgrade;} + {_latestNodeImageVersion = If( json?.PropertyT("latestNodeImageVersion"), out var __jsonLatestNodeImageVersion) ? (string)__jsonLatestNodeImageVersion : (string)LatestNodeImageVersion;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfileProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolUpgradeProfileProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add ); + if (null != this._upgrade) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._upgrade ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("upgrades",__w); + } + AddIf( null != (((object)this._latestNodeImageVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._latestNodeImageVersion.ToString()) : null, "latestNodeImageVersion" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.PowerShell.cs new file mode 100644 index 000000000000..15542c042c9a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AgentPoolUpgradeProfilePropertiesUpgradesItemTypeConverter))] + public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolUpgradeProfilePropertiesUpgradesItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("IsPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal)this).IsPreview = (bool?) content.GetValueForProperty("IsPreview",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal)this).IsPreview, (__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 AgentPoolUpgradeProfilePropertiesUpgradesItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("IsPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal)this).IsPreview = (bool?) content.GetValueForProperty("IsPreview",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal)this).IsPreview, (__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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolUpgradeProfilePropertiesUpgradesItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolUpgradeProfilePropertiesUpgradesItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AgentPoolUpgradeProfilePropertiesUpgradesItemTypeConverter))] + public partial interface IAgentPoolUpgradeProfilePropertiesUpgradesItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.TypeConverter.cs new file mode 100644 index 000000000000..f13fe2d184c5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolUpgradeProfilePropertiesUpgradesItemTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolUpgradeProfilePropertiesUpgradesItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolUpgradeProfilePropertiesUpgradesItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolUpgradeProfilePropertiesUpgradesItem.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs new file mode 100644 index 000000000000..b4ec8080721c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal + { + + /// Backing field for property. + private bool? _isPreview; + + /// Whether the Kubernetes version is currently in preview. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? IsPreview { get => this._isPreview; set => this._isPreview = value; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } + + /// + /// Creates an new instance. + /// + public AgentPoolUpgradeProfilePropertiesUpgradesItem() + { + + } + } + public partial interface IAgentPoolUpgradeProfilePropertiesUpgradesItem : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether the Kubernetes version is currently in preview. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the Kubernetes version is currently in preview.", + SerializedName = @"isPreview", + PossibleTypes = new [] { typeof(bool) })] + bool? IsPreview { get; set; } + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Kubernetes version (major.minor.patch).", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + + } + internal partial interface IAgentPoolUpgradeProfilePropertiesUpgradesItemInternal + + { + /// Whether the Kubernetes version is currently in preview. + bool? IsPreview { get; set; } + /// The Kubernetes version (major.minor.patch). + string KubernetesVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.json.cs new file mode 100644 index 000000000000..a43260ab48ca --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeProfilePropertiesUpgradesItem.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolUpgradeProfilePropertiesUpgradesItem(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} + {_isPreview = If( json?.PropertyT("isPreview"), out var __jsonIsPreview) ? (bool?)__jsonIsPreview : IsPreview;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfilePropertiesUpgradesItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolUpgradeProfilePropertiesUpgradesItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + AddIf( null != this._isPreview ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._isPreview) : null, "isPreview" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.PowerShell.cs new file mode 100644 index 000000000000..e131fdb19621 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Settings for upgrading an agentpool + [System.ComponentModel.TypeConverter(typeof(AgentPoolUpgradeSettingsTypeConverter))] + public partial class AgentPoolUpgradeSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolUpgradeSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).MaxSurge = (string) content.GetValueForProperty("MaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).MaxSurge, global::System.Convert.ToString); + } + if (content.Contains("DrainTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).DrainTimeoutInMinute = (int?) content.GetValueForProperty("DrainTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).DrainTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NodeSoakDurationInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).NodeSoakDurationInMinute = (int?) content.GetValueForProperty("NodeSoakDurationInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).NodeSoakDurationInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UndrainableNodeBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).UndrainableNodeBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior?) content.GetValueForProperty("UndrainableNodeBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).UndrainableNodeBehavior, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgentPoolUpgradeSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).MaxSurge = (string) content.GetValueForProperty("MaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).MaxSurge, global::System.Convert.ToString); + } + if (content.Contains("DrainTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).DrainTimeoutInMinute = (int?) content.GetValueForProperty("DrainTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).DrainTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NodeSoakDurationInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).NodeSoakDurationInMinute = (int?) content.GetValueForProperty("NodeSoakDurationInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).NodeSoakDurationInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UndrainableNodeBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).UndrainableNodeBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior?) content.GetValueForProperty("UndrainableNodeBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)this).UndrainableNodeBehavior, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior.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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolUpgradeSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolUpgradeSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Settings for upgrading an agentpool + [System.ComponentModel.TypeConverter(typeof(AgentPoolUpgradeSettingsTypeConverter))] + public partial interface IAgentPoolUpgradeSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.TypeConverter.cs new file mode 100644 index 000000000000..c70e4427d15e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolUpgradeSettingsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolUpgradeSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolUpgradeSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolUpgradeSettings.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.cs new file mode 100644 index 000000000000..9b3faeb0f37f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Settings for upgrading an agentpool + public partial class AgentPoolUpgradeSettings : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal + { + + /// Backing field for property. + private int? _drainTimeoutInMinute; + + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? DrainTimeoutInMinute { get => this._drainTimeoutInMinute; set => this._drainTimeoutInMinute = value; } + + /// Backing field for property. + private string _maxSurge; + + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string MaxSurge { get => this._maxSurge; set => this._maxSurge = value; } + + /// Backing field for property. + private int? _nodeSoakDurationInMinute; + + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NodeSoakDurationInMinute { get => this._nodeSoakDurationInMinute; set => this._nodeSoakDurationInMinute = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? _undrainableNodeBehavior; + + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UndrainableNodeBehavior { get => this._undrainableNodeBehavior; set => this._undrainableNodeBehavior = value; } + + /// Creates an new instance. + public AgentPoolUpgradeSettings() + { + + } + } + /// Settings for upgrading an agentpool + public partial interface IAgentPoolUpgradeSettings : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes.", + SerializedName = @"drainTimeoutInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? DrainTimeoutInMinute { get; set; } + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + string MaxSurge { get; set; } + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes.", + SerializedName = @"nodeSoakDurationInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? NodeSoakDurationInMinute { get; set; } + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes.", + SerializedName = @"undrainableNodeBehavior", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UndrainableNodeBehavior { get; set; } + + } + /// Settings for upgrading an agentpool + internal partial interface IAgentPoolUpgradeSettingsInternal + + { + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + int? DrainTimeoutInMinute { get; set; } + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + string MaxSurge { get; set; } + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + int? NodeSoakDurationInMinute { get; set; } + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UndrainableNodeBehavior { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.json.cs new file mode 100644 index 000000000000..d17fa02cfd5b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolUpgradeSettings.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Settings for upgrading an agentpool + public partial class AgentPoolUpgradeSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolUpgradeSettings(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_maxSurge = If( json?.PropertyT("maxSurge"), out var __jsonMaxSurge) ? (string)__jsonMaxSurge : (string)MaxSurge;} + {_drainTimeoutInMinute = If( json?.PropertyT("drainTimeoutInMinutes"), out var __jsonDrainTimeoutInMinutes) ? (int?)__jsonDrainTimeoutInMinutes : DrainTimeoutInMinute;} + {_nodeSoakDurationInMinute = If( json?.PropertyT("nodeSoakDurationInMinutes"), out var __jsonNodeSoakDurationInMinutes) ? (int?)__jsonNodeSoakDurationInMinutes : NodeSoakDurationInMinute;} + {_undrainableNodeBehavior = If( json?.PropertyT("undrainableNodeBehavior"), out var __jsonUndrainableNodeBehavior) ? (string)__jsonUndrainableNodeBehavior : (string)UndrainableNodeBehavior;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolUpgradeSettings(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._maxSurge)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._maxSurge.ToString()) : null, "maxSurge" ,container.Add ); + AddIf( null != this._drainTimeoutInMinute ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._drainTimeoutInMinute) : null, "drainTimeoutInMinutes" ,container.Add ); + AddIf( null != this._nodeSoakDurationInMinute ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._nodeSoakDurationInMinute) : null, "nodeSoakDurationInMinutes" ,container.Add ); + AddIf( null != (((object)this._undrainableNodeBehavior)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._undrainableNodeBehavior.ToString()) : null, "undrainableNodeBehavior" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.PowerShell.cs new file mode 100644 index 000000000000..e02b61809aec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The Windows agent pool's specific profile. + [System.ComponentModel.TypeConverter(typeof(AgentPoolWindowsProfileTypeConverter))] + public partial class AgentPoolWindowsProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AgentPoolWindowsProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisableOutboundNat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfileInternal)this).DisableOutboundNat = (bool?) content.GetValueForProperty("DisableOutboundNat",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfileInternal)this).DisableOutboundNat, (__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 AgentPoolWindowsProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisableOutboundNat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfileInternal)this).DisableOutboundNat = (bool?) content.GetValueForProperty("DisableOutboundNat",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfileInternal)this).DisableOutboundNat, (__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.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolWindowsProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolWindowsProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Windows agent pool's specific profile. + [System.ComponentModel.TypeConverter(typeof(AgentPoolWindowsProfileTypeConverter))] + public partial interface IAgentPoolWindowsProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.TypeConverter.cs new file mode 100644 index 000000000000..16f7f5fa7d0d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AgentPoolWindowsProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AgentPoolWindowsProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AgentPoolWindowsProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AgentPoolWindowsProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.cs new file mode 100644 index 000000000000..fb68e686d75d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The Windows agent pool's specific profile. + public partial class AgentPoolWindowsProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfileInternal + { + + /// Backing field for property. + private bool? _disableOutboundNat; + + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? DisableOutboundNat { get => this._disableOutboundNat; set => this._disableOutboundNat = value; } + + /// Creates an new instance. + public AgentPoolWindowsProfile() + { + + } + } + /// The Windows agent pool's specific profile. + public partial interface IAgentPoolWindowsProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled.", + SerializedName = @"disableOutboundNat", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableOutboundNat { get; set; } + + } + /// The Windows agent pool's specific profile. + internal partial interface IAgentPoolWindowsProfileInternal + + { + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + bool? DisableOutboundNat { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.json.cs new file mode 100644 index 000000000000..7fc81a5c03b4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AgentPoolWindowsProfile.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The Windows agent pool's specific profile. + public partial class AgentPoolWindowsProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolWindowsProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_disableOutboundNat = If( json?.PropertyT("disableOutboundNat"), out var __jsonDisableOutboundNat) ? (bool?)__jsonDisableOutboundNat : DisableOutboundNat;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AgentPoolWindowsProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._disableOutboundNat ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._disableOutboundNat) : null, "disableOutboundNat" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.PowerShell.cs new file mode 100644 index 000000000000..60b5a6edf0c4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Specifications on auto-scaling. + [System.ComponentModel.TypeConverter(typeof(AutoScaleProfileTypeConverter))] + public partial class AutoScaleProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AutoScaleProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).Size = (string[]) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).Size, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MinCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).MinCount = (int?) content.GetValueForProperty("MinCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).MinCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaxCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).MaxCount = (int?) content.GetValueForProperty("MaxCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).MaxCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AutoScaleProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).Size = (string[]) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).Size, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MinCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).MinCount = (int?) content.GetValueForProperty("MinCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).MinCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaxCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).MaxCount = (int?) content.GetValueForProperty("MaxCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal)this).MaxCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Models.Api20240402Preview.IAutoScaleProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AutoScaleProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AutoScaleProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Specifications on auto-scaling. + [System.ComponentModel.TypeConverter(typeof(AutoScaleProfileTypeConverter))] + public partial interface IAutoScaleProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.TypeConverter.cs new file mode 100644 index 000000000000..c6fd8ceb4cca --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AutoScaleProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAutoScaleProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AutoScaleProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AutoScaleProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AutoScaleProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.cs new file mode 100644 index 000000000000..54c8817c1c97 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifications on auto-scaling. + public partial class AutoScaleProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfileInternal + { + + /// Backing field for property. + private int? _maxCount; + + /// The maximum number of nodes of the specified sizes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? MaxCount { get => this._maxCount; set => this._maxCount = value; } + + /// Backing field for property. + private int? _minCount; + + /// The minimum number of nodes of the specified sizes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? MinCount { get => this._minCount; set => this._minCount = value; } + + /// Backing field for property. + private string[] _size; + + /// + /// The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first + /// available one when auto scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will + /// use the next size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Size { get => this._size; set => this._size = value; } + + /// Creates an new instance. + public AutoScaleProfile() + { + + } + } + /// Specifications on auto-scaling. + public partial interface IAutoScaleProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The maximum number of nodes of the specified sizes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of nodes of the specified sizes.", + SerializedName = @"maxCount", + PossibleTypes = new [] { typeof(int) })] + int? MaxCount { get; set; } + /// The minimum number of nodes of the specified sizes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The minimum number of nodes of the specified sizes.", + SerializedName = @"minCount", + PossibleTypes = new [] { typeof(int) })] + int? MinCount { get; set; } + /// + /// The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first + /// available one when auto scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will + /// use the next size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when auto scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size.", + SerializedName = @"sizes", + PossibleTypes = new [] { typeof(string) })] + string[] Size { get; set; } + + } + /// Specifications on auto-scaling. + internal partial interface IAutoScaleProfileInternal + + { + /// The maximum number of nodes of the specified sizes. + int? MaxCount { get; set; } + /// The minimum number of nodes of the specified sizes. + int? MinCount { get; set; } + /// + /// The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first + /// available one when auto scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will + /// use the next size. + /// + string[] Size { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.json.cs new file mode 100644 index 000000000000..96d7997f16d8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AutoScaleProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifications on auto-scaling. + public partial class AutoScaleProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AutoScaleProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_size = If( json?.PropertyT("sizes"), out var __jsonSizes) ? If( __jsonSizes as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Size;} + {_minCount = If( json?.PropertyT("minCount"), out var __jsonMinCount) ? (int?)__jsonMinCount : MinCount;} + {_maxCount = If( json?.PropertyT("maxCount"), out var __jsonMaxCount) ? (int?)__jsonMaxCount : MaxCount;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AutoScaleProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._size) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._size ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("sizes",__w); + } + AddIf( null != this._minCount ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._minCount) : null, "minCount" ,container.Add ); + AddIf( null != this._maxCount ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._maxCount) : null, "maxCount" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.PowerShell.cs new file mode 100644 index 000000000000..6858a20097be --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Azure Key Vault key management service settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(AzureKeyVaultKmsTypeConverter))] + public partial class AzureKeyVaultKms + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureKeyVaultKms(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyId = (string) content.GetValueForProperty("KeyId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyId, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyVaultNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes?) content.GetValueForProperty("KeyVaultNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyVaultNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes.CreateFrom); + } + if (content.Contains("KeyVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyVaultResourceId = (string) content.GetValueForProperty("KeyVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyVaultResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureKeyVaultKms(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyId = (string) content.GetValueForProperty("KeyId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyId, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyVaultNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes?) content.GetValueForProperty("KeyVaultNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyVaultNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes.CreateFrom); + } + if (content.Contains("KeyVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyVaultResourceId = (string) content.GetValueForProperty("KeyVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)this).KeyVaultResourceId, 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.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureKeyVaultKms(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureKeyVaultKms(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure Key Vault key management service settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(AzureKeyVaultKmsTypeConverter))] + public partial interface IAzureKeyVaultKms + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.TypeConverter.cs new file mode 100644 index 000000000000..593de1aa48cf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureKeyVaultKmsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureKeyVaultKms.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureKeyVaultKms.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureKeyVaultKms.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.cs new file mode 100644 index 000000000000..d16d82b62d2d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Azure Key Vault key management service settings for the security profile. + public partial class AzureKeyVaultKms : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable Azure Key Vault key management service. The default is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _keyId; + + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KeyId { get => this._keyId; set => this._keyId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? _keyVaultNetworkAccess; + + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? KeyVaultNetworkAccess { get => this._keyVaultNetworkAccess; set => this._keyVaultNetworkAccess = value; } + + /// Backing field for property. + private string _keyVaultResourceId; + + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KeyVaultResourceId { get => this._keyVaultResourceId; set => this._keyVaultResourceId = value; } + + /// Creates an new instance. + public AzureKeyVaultKms() + { + + } + } + /// Azure Key Vault key management service settings for the security profile. + public partial interface IAzureKeyVaultKms : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable Azure Key Vault key management service. The default is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure Key Vault key management service. The default is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty.", + SerializedName = @"keyId", + PossibleTypes = new [] { typeof(string) })] + string KeyId { get; set; } + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`.", + SerializedName = @"keyVaultNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? KeyVaultNetworkAccess { get; set; } + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty.", + SerializedName = @"keyVaultResourceId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultResourceId { get; set; } + + } + /// Azure Key Vault key management service settings for the security profile. + internal partial interface IAzureKeyVaultKmsInternal + + { + /// Whether to enable Azure Key Vault key management service. The default is false. + bool? Enabled { get; set; } + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + string KeyId { get; set; } + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? KeyVaultNetworkAccess { get; set; } + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + string KeyVaultResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.json.cs new file mode 100644 index 000000000000..3020c4e6b6f5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/AzureKeyVaultKms.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Azure Key Vault key management service settings for the security profile. + public partial class AzureKeyVaultKms + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal AzureKeyVaultKms(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)KeyId;} + {_keyVaultNetworkAccess = If( json?.PropertyT("keyVaultNetworkAccess"), out var __jsonKeyVaultNetworkAccess) ? (string)__jsonKeyVaultNetworkAccess : (string)KeyVaultNetworkAccess;} + {_keyVaultResourceId = If( json?.PropertyT("keyVaultResourceId"), out var __jsonKeyVaultResourceId) ? (string)__jsonKeyVaultResourceId : (string)KeyVaultResourceId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AzureKeyVaultKms(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != (((object)this._keyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._keyId.ToString()) : null, "keyId" ,container.Add ); + AddIf( null != (((object)this._keyVaultNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._keyVaultNetworkAccess.ToString()) : null, "keyVaultNetworkAccess" ,container.Add ); + AddIf( null != (((object)this._keyVaultResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._keyVaultResourceId.ToString()) : null, "keyVaultResourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.PowerShell.cs new file mode 100644 index 000000000000..9ccb38467a07 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// An error response from the Container service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] + public partial class CloudError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CloudError(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.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloudError(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.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBodyTypeConverter.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.ContainerService.Models.Api20240402Preview.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An error response from the Container service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] + public partial interface ICloudError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.TypeConverter.cs new file mode 100644 index 000000000000..13b5e401915f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloudErrorTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloudError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloudError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloudError.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.cs new file mode 100644 index 000000000000..1b101c85a40f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// An error response from the Container service. + public partial class CloudError : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal + { + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)Error).Code = value ?? null; } + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody _error; + + /// Details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBody()); set => this._error = value; } + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBody()); set { {_error = value;} } } + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)Error).Target = value ?? null; } + + /// Creates an new instance. + public CloudError() + { + + } + } + /// An error response from the Container service. + public partial interface ICloudError : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; set; } + + } + /// An error response from the Container service. + internal partial interface ICloudErrorInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[] Detail { get; set; } + /// Details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody Error { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.json.cs new file mode 100644 index 000000000000..f4cd5d13bf40 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudError.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// An error response from the Container service. + public partial class CloudError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal CloudError(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.CloudErrorBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new CloudError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.PowerShell.cs new file mode 100644 index 000000000000..2bcd4670e7ac --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// An error response from the Container service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorBodyTypeConverter))] + public partial class CloudErrorBody + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CloudErrorBody(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.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloudErrorBody(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.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBodyTypeConverter.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.ContainerService.Models.Api20240402Preview.ICloudErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudErrorBody(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudErrorBody(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An error response from the Container service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorBodyTypeConverter))] + public partial interface ICloudErrorBody + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.TypeConverter.cs new file mode 100644 index 000000000000..0b43ee40fc7d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloudErrorBodyTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudErrorBody ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloudErrorBody.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloudErrorBody.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloudErrorBody.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.cs new file mode 100644 index 000000000000..06281bdce18c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// An error response from the Container service. + public partial class CloudErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBodyInternal + { + + /// Backing field for property. + private string _code; + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[] _detail; + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[] Detail { get => this._detail; set => this._detail = value; } + + /// Backing field for property. + private string _message; + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private string _target; + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Target { get => this._target; set => this._target = value; } + + /// Creates an new instance. + public CloudErrorBody() + { + + } + } + /// An error response from the Container service. + public partial interface ICloudErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; set; } + + } + /// An error response from the Container service. + internal partial interface ICloudErrorBodyInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.json.cs new file mode 100644 index 000000000000..6df97684d925 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CloudErrorBody.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// An error response from the Container service. + public partial class CloudErrorBody + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal CloudErrorBody(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudErrorBody) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CloudErrorBody.FromJson(__u) )) ))() : null : Detail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new CloudErrorBody(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.PowerShell.cs new file mode 100644 index 000000000000..117f1341d870 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Settings for upgrading a cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterUpgradeSettingsTypeConverter))] + public partial class ClusterUpgradeSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ClusterUpgradeSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OverrideSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings) content.GetValueForProperty("OverrideSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("OverrideSettingForceUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSettingForceUpgrade = (bool?) content.GetValueForProperty("OverrideSettingForceUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSettingForceUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OverrideSettingUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSettingUntil = (global::System.DateTime?) content.GetValueForProperty("OverrideSettingUntil",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSettingUntil, (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 ClusterUpgradeSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OverrideSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings) content.GetValueForProperty("OverrideSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("OverrideSettingForceUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSettingForceUpgrade = (bool?) content.GetValueForProperty("OverrideSettingForceUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSettingForceUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OverrideSettingUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSettingUntil = (global::System.DateTime?) content.GetValueForProperty("OverrideSettingUntil",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)this).OverrideSettingUntil, (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.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterUpgradeSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterUpgradeSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Settings for upgrading a cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterUpgradeSettingsTypeConverter))] + public partial interface IClusterUpgradeSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.TypeConverter.cs new file mode 100644 index 000000000000..35af1817d0d5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ClusterUpgradeSettingsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ClusterUpgradeSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ClusterUpgradeSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ClusterUpgradeSettings.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.cs new file mode 100644 index 000000000000..d6c43bd1d761 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Settings for upgrading a cluster. + public partial class ClusterUpgradeSettings : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal + { + + /// Internal Acessors for OverrideSetting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal.OverrideSetting { get => (this._overrideSetting = this._overrideSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettings()); set { {_overrideSetting = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings _overrideSetting; + + /// Settings for overrides. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings OverrideSetting { get => (this._overrideSetting = this._overrideSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettings()); set => this._overrideSetting = value; } + + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OverrideSettingForceUpgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)OverrideSetting).ForceUpgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)OverrideSetting).ForceUpgrade = value ?? default(bool); } + + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? OverrideSettingUntil { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)OverrideSetting).Until; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)OverrideSetting).Until = value ?? default(global::System.DateTime); } + + /// Creates an new instance. + public ClusterUpgradeSettings() + { + + } + } + /// Settings for upgrading a cluster. + public partial interface IClusterUpgradeSettings : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution.", + SerializedName = @"forceUpgrade", + PossibleTypes = new [] { typeof(bool) })] + bool? OverrideSettingForceUpgrade { get; set; } + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect.", + SerializedName = @"until", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OverrideSettingUntil { get; set; } + + } + /// Settings for upgrading a cluster. + internal partial interface IClusterUpgradeSettingsInternal + + { + /// Settings for overrides. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings OverrideSetting { get; set; } + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + bool? OverrideSettingForceUpgrade { get; set; } + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + global::System.DateTime? OverrideSettingUntil { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.json.cs new file mode 100644 index 000000000000..551c430b6cbf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ClusterUpgradeSettings.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Settings for upgrading a cluster. + public partial class ClusterUpgradeSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ClusterUpgradeSettings(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_overrideSetting = If( json?.PropertyT("overrideSettings"), out var __jsonOverrideSettings) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettings.FromJson(__jsonOverrideSettings) : OverrideSetting;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ClusterUpgradeSettings(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._overrideSetting ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._overrideSetting.ToJson(null,serializationMode) : null, "overrideSettings" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.PowerShell.cs new file mode 100644 index 000000000000..b7e5bdee0a1a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The results of a run command + [System.ComponentModel.TypeConverter(typeof(CommandResultPropertiesTypeConverter))] + public partial class CommandResultProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CommandResultProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ExitCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).ExitCode = (int?) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).ExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StartedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FinishedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Log")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).Log = (string) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).Log, global::System.Convert.ToString); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).Reason = (string) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).Reason, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CommandResultProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ExitCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).ExitCode = (int?) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).ExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StartedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FinishedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Log")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).Log = (string) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).Log, global::System.Convert.ToString); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).Reason = (string) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)this).Reason, 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.ContainerService.Models.Api20240402Preview.ICommandResultProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CommandResultProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CommandResultProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The results of a run command + [System.ComponentModel.TypeConverter(typeof(CommandResultPropertiesTypeConverter))] + public partial interface ICommandResultProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.TypeConverter.cs new file mode 100644 index 000000000000..2b2606e18dca --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CommandResultPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICommandResultProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CommandResultProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CommandResultProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CommandResultProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.cs new file mode 100644 index 000000000000..211c9f3a59aa --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The results of a run command + public partial class CommandResultProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal + { + + /// Backing field for property. + private int? _exitCode; + + /// The exit code of the command + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? ExitCode { get => this._exitCode; } + + /// Backing field for property. + private global::System.DateTime? _finishedAt; + + /// The time when the command finished. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime? FinishedAt { get => this._finishedAt; } + + /// Backing field for property. + private string _log; + + /// The command output. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Log { get => this._log; } + + /// Internal Acessors for ExitCode + int? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal.ExitCode { get => this._exitCode; set { {_exitCode = value;} } } + + /// Internal Acessors for FinishedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal.FinishedAt { get => this._finishedAt; set { {_finishedAt = value;} } } + + /// Internal Acessors for Log + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal.Log { get => this._log; set { {_log = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Reason + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal.Reason { get => this._reason; set { {_reason = value;} } } + + /// Internal Acessors for StartedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal.StartedAt { get => this._startedAt; set { {_startedAt = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _reason; + + /// An explanation of why provisioningState is set to failed (if so). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Reason { get => this._reason; } + + /// Backing field for property. + private global::System.DateTime? _startedAt; + + /// The time when the command started. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime? StartedAt { get => this._startedAt; } + + /// Creates an new instance. + public CommandResultProperties() + { + + } + } + /// The results of a run command + public partial interface ICommandResultProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The exit code of the command + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exit code of the command", + SerializedName = @"exitCode", + PossibleTypes = new [] { typeof(int) })] + int? ExitCode { get; } + /// The time when the command finished. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the command finished.", + SerializedName = @"finishedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FinishedAt { get; } + /// The command output. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The command output.", + SerializedName = @"logs", + PossibleTypes = new [] { typeof(string) })] + string Log { get; } + /// provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"provisioning State", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// An explanation of why provisioningState is set to failed (if so). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An explanation of why provisioningState is set to failed (if so).", + SerializedName = @"reason", + PossibleTypes = new [] { typeof(string) })] + string Reason { get; } + /// The time when the command started. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the command started.", + SerializedName = @"startedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedAt { get; } + + } + /// The results of a run command + internal partial interface ICommandResultPropertiesInternal + + { + /// The exit code of the command + int? ExitCode { get; set; } + /// The time when the command finished. + global::System.DateTime? FinishedAt { get; set; } + /// The command output. + string Log { get; set; } + /// provisioning State + string ProvisioningState { get; set; } + /// An explanation of why provisioningState is set to failed (if so). + string Reason { get; set; } + /// The time when the command started. + global::System.DateTime? StartedAt { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.json.cs new file mode 100644 index 000000000000..33c9f14759c2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CommandResultProperties.json.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The results of a run command + public partial class CommandResultProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal CommandResultProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_exitCode = If( json?.PropertyT("exitCode"), out var __jsonExitCode) ? (int?)__jsonExitCode : ExitCode;} + {_startedAt = If( json?.PropertyT("startedAt"), out var __jsonStartedAt) ? global::System.DateTime.TryParse((string)__jsonStartedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedAtValue) ? __jsonStartedAtValue : StartedAt : StartedAt;} + {_finishedAt = If( json?.PropertyT("finishedAt"), out var __jsonFinishedAt) ? global::System.DateTime.TryParse((string)__jsonFinishedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFinishedAtValue) ? __jsonFinishedAtValue : FinishedAt : FinishedAt;} + {_log = If( json?.PropertyT("logs"), out var __jsonLogs) ? (string)__jsonLogs : (string)Log;} + {_reason = If( json?.PropertyT("reason"), out var __jsonReason) ? (string)__jsonReason : (string)Reason;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new CommandResultProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._exitCode ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._exitCode) : null, "exitCode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._startedAt ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._startedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedAt" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._finishedAt ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._finishedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "finishedAt" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._log)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._log.ToString()) : null, "logs" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._reason.ToString()) : null, "reason" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.PowerShell.cs new file mode 100644 index 000000000000..dd869433789f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Version information about a product/service that is compatible with a service mesh revision. + /// + [System.ComponentModel.TypeConverter(typeof(CompatibleVersionsTypeConverter))] + public partial class CompatibleVersions + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CompatibleVersions(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.ContainerService.Models.Api20240402Preview.ICompatibleVersionsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersionsInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersionsInternal)this).Version = (string[]) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersionsInternal)this).Version, __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 CompatibleVersions(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.ContainerService.Models.Api20240402Preview.ICompatibleVersionsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersionsInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersionsInternal)this).Version = (string[]) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersionsInternal)this).Version, __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.ContainerService.Models.Api20240402Preview.ICompatibleVersions DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CompatibleVersions(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CompatibleVersions(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Version information about a product/service that is compatible with a service mesh revision. + [System.ComponentModel.TypeConverter(typeof(CompatibleVersionsTypeConverter))] + public partial interface ICompatibleVersions + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.TypeConverter.cs new file mode 100644 index 000000000000..90bb9be25022 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CompatibleVersionsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICompatibleVersions ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CompatibleVersions.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CompatibleVersions.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CompatibleVersions.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.cs new file mode 100644 index 000000000000..725d6654d938 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Version information about a product/service that is compatible with a service mesh revision. + /// + public partial class CompatibleVersions : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersionsInternal + { + + /// Backing field for property. + private string _name; + + /// The product/service name. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string[] _version; + + /// Product/service versions compatible with a service mesh add-on revision. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public CompatibleVersions() + { + + } + } + /// Version information about a product/service that is compatible with a service mesh revision. + public partial interface ICompatibleVersions : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The product/service name. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The product/service name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Product/service versions compatible with a service mesh add-on revision. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Product/service versions compatible with a service mesh add-on revision.", + SerializedName = @"versions", + PossibleTypes = new [] { typeof(string) })] + string[] Version { get; set; } + + } + /// Version information about a product/service that is compatible with a service mesh revision. + internal partial interface ICompatibleVersionsInternal + + { + /// The product/service name. + string Name { get; set; } + /// Product/service versions compatible with a service mesh add-on revision. + string[] Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.json.cs new file mode 100644 index 000000000000..aa8bea1f6a37 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CompatibleVersions.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Version information about a product/service that is compatible with a service mesh revision. + /// + public partial class CompatibleVersions + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal CompatibleVersions(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_version = If( json?.PropertyT("versions"), out var __jsonVersions) ? If( __jsonVersions as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Version;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new CompatibleVersions(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (null != this._version) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._version ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("versions",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.PowerShell.cs new file mode 100644 index 000000000000..5dc624600894 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Profile for Linux VMs in the container service cluster. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceLinuxProfileTypeConverter))] + public partial class ContainerServiceLinuxProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ContainerServiceLinuxProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Ssh")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).Ssh = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration) content.GetValueForProperty("Ssh",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).Ssh, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKeyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ContainerServiceLinuxProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Ssh")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).Ssh = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration) content.GetValueForProperty("Ssh",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).Ssh, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKeyTypeConverter.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.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerServiceLinuxProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerServiceLinuxProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Profile for Linux VMs in the container service cluster. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceLinuxProfileTypeConverter))] + public partial interface IContainerServiceLinuxProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.TypeConverter.cs new file mode 100644 index 000000000000..ef252e02d7ad --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerServiceLinuxProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerServiceLinuxProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerServiceLinuxProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerServiceLinuxProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.cs new file mode 100644 index 000000000000..dcab27ad251d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile for Linux VMs in the container service cluster. + public partial class ContainerServiceLinuxProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal + { + + /// Backing field for property. + private string _adminUsername; + + /// The administrator username to use for Linux VMs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string AdminUsername { get => this._adminUsername; set => this._adminUsername = value; } + + /// Internal Acessors for Ssh + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal.Ssh { get => (this._ssh = this._ssh ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshConfiguration()); set { {_ssh = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration _ssh; + + /// The SSH configuration for Linux-based VMs running on Azure. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration Ssh { get => (this._ssh = this._ssh ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshConfiguration()); set => this._ssh = value; } + + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfigurationInternal)Ssh).PublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfigurationInternal)Ssh).PublicKey = value ; } + + /// Creates an new instance. + public ContainerServiceLinuxProfile() + { + + } + } + /// Profile for Linux VMs in the container service cluster. + public partial interface IContainerServiceLinuxProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The administrator username to use for Linux VMs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The administrator username to use for Linux VMs.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdminUsername { get; set; } + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified.", + SerializedName = @"publicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get; set; } + + } + /// Profile for Linux VMs in the container service cluster. + internal partial interface IContainerServiceLinuxProfileInternal + + { + /// The administrator username to use for Linux VMs. + string AdminUsername { get; set; } + /// The SSH configuration for Linux-based VMs running on Azure. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration Ssh { get; set; } + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.json.cs new file mode 100644 index 000000000000..abee6db76d8a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceLinuxProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile for Linux VMs in the container service cluster. + public partial class ContainerServiceLinuxProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerServiceLinuxProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_ssh = If( json?.PropertyT("ssh"), out var __jsonSsh) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshConfiguration.FromJson(__jsonSsh) : Ssh;} + {_adminUsername = If( json?.PropertyT("adminUsername"), out var __jsonAdminUsername) ? (string)__jsonAdminUsername : (string)AdminUsername;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ContainerServiceLinuxProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._ssh ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._ssh.ToJson(null,serializationMode) : null, "ssh" ,container.Add ); + AddIf( null != (((object)this._adminUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._adminUsername.ToString()) : null, "adminUsername" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.PowerShell.cs new file mode 100644 index 000000000000..1666ac524444 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.PowerShell.cs @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Profile of network configuration. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceNetworkProfileTypeConverter))] + public partial class ContainerServiceNetworkProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ContainerServiceNetworkProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LoadBalancerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile) content.GetValueForProperty("LoadBalancerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NatGatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile) content.GetValueForProperty("NatGatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNatGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StaticEgressGatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).StaticEgressGatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile) content.GetValueForProperty("StaticEgressGatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).StaticEgressGatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStaticEgressGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("KubeProxyConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig) content.GetValueForProperty("KubeProxyConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Monitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).Monitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring) content.GetValueForProperty("Monitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).Monitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("AdvancedNetworking")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).AdvancedNetworking = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking) content.GetValueForProperty("AdvancedNetworking",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).AdvancedNetworking, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("NetworkDataplane")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkDataplane = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane?) content.GetValueForProperty("NetworkDataplane",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkDataplane, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane.CreateFrom); + } + if (content.Contains("PodCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).PodCidr = (string) content.GetValueForProperty("PodCidr",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).PodCidr, global::System.Convert.ToString); + } + if (content.Contains("ServiceCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ServiceCidr = (string) content.GetValueForProperty("ServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ServiceCidr, global::System.Convert.ToString); + } + if (content.Contains("DnsServiceIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).DnsServiceIP, global::System.Convert.ToString); + } + if (content.Contains("OutboundType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType?) content.GetValueForProperty("OutboundType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType.CreateFrom); + } + if (content.Contains("LoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("LoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.CreateFrom); + } + if (content.Contains("PodCidrs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).PodCidrs = (string[]) content.GetValueForProperty("PodCidrs",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).PodCidrs, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceCidrs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ServiceCidrs = (string[]) content.GetValueForProperty("ServiceCidrs",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ServiceCidrs, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IPFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IPFamily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily[]) content.GetValueForProperty("IPFamily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IPFamily, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily.CreateFrom)); + } + if (content.Contains("KubeProxyConfigMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode?) content.GetValueForProperty("KubeProxyConfigMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode.CreateFrom); + } + if (content.Contains("AdvancedNetworkingObservability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).AdvancedNetworkingObservability = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability) content.GetValueForProperty("AdvancedNetworkingObservability",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).AdvancedNetworkingObservability, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingObservabilityTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerProfileManagedOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileManagedOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs) content.GetValueForProperty("LoadBalancerProfileManagedOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileManagedOutboundIP, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileManagedOutboundIPsTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerProfileOutboundIPPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileOutboundIPPrefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes) content.GetValueForProperty("LoadBalancerProfileOutboundIPPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileOutboundIPPrefix, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPPrefixesTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerProfileOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs) content.GetValueForProperty("LoadBalancerProfileOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileOutboundIP, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPsTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerProfileEffectiveOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileEffectiveOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("LoadBalancerProfileEffectiveOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileEffectiveOutboundIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("LoadBalancerProfileAllocatedOutboundPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileAllocatedOutboundPort = (int?) content.GetValueForProperty("LoadBalancerProfileAllocatedOutboundPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileAllocatedOutboundPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LoadBalancerProfileIdleTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileIdleTimeoutInMinute = (int?) content.GetValueForProperty("LoadBalancerProfileIdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileIdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LoadBalancerProfileEnableMultipleStandardLoadBalancer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileEnableMultipleStandardLoadBalancer = (bool?) content.GetValueForProperty("LoadBalancerProfileEnableMultipleStandardLoadBalancer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileEnableMultipleStandardLoadBalancer, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LoadBalancerProfileBackendPoolType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileBackendPoolType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType?) content.GetValueForProperty("LoadBalancerProfileBackendPoolType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileBackendPoolType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType.CreateFrom); + } + if (content.Contains("LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode?) content.GetValueForProperty("LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode.CreateFrom); + } + if (content.Contains("NatGatewayProfileManagedOutboundIPProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileManagedOutboundIPProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile) content.GetValueForProperty("NatGatewayProfileManagedOutboundIPProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileManagedOutboundIPProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterManagedOutboundIPProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NatGatewayProfileEffectiveOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileEffectiveOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("NatGatewayProfileEffectiveOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileEffectiveOutboundIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("NatGatewayProfileIdleTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileIdleTimeoutInMinute = (int?) content.GetValueForProperty("NatGatewayProfileIdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileIdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StaticEgressGatewayProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).StaticEgressGatewayProfileEnabled = (bool?) content.GetValueForProperty("StaticEgressGatewayProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).StaticEgressGatewayProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeProxyConfigIpvsConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigIpvsConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig) content.GetValueForProperty("KubeProxyConfigIpvsConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigIpvsConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfigTypeConverter.ConvertFrom); + } + if (content.Contains("KubeProxyConfigEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigEnabled = (bool?) content.GetValueForProperty("KubeProxyConfigEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).MonitoringEnabled = (bool?) content.GetValueForProperty("MonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).MonitoringEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ManagedOutboundIPCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPCount = (int?) content.GetValueForProperty("ManagedOutboundIPCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagedOutboundIPCountIpv6")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPCountIpv6 = (int?) content.GetValueForProperty("ManagedOutboundIPCountIpv6",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPCountIpv6, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OutboundIPPrefixPublicIpprefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundIPPrefixPublicIpprefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("OutboundIPPrefixPublicIpprefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundIPPrefixPublicIpprefix, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("OutboundIPPublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundIPPublicIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("OutboundIPPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundIPPublicIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("ManagedOutboundIPProfileCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPProfileCount = (int?) content.GetValueForProperty("ManagedOutboundIPProfileCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPProfileCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigScheduler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigScheduler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler?) content.GetValueForProperty("IpvConfigScheduler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigScheduler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler.CreateFrom); + } + if (content.Contains("IpvConfigTcpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigTcpTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigTcpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigTcpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigTcpFinTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigTcpFinTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigTcpFinTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigTcpFinTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigUdpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigUdpTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigUdpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigUdpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ObservabilityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ObservabilityEnabled = (bool?) content.GetValueForProperty("ObservabilityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ObservabilityEnabled, (__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 ContainerServiceNetworkProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LoadBalancerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile) content.GetValueForProperty("LoadBalancerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NatGatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile) content.GetValueForProperty("NatGatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNatGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StaticEgressGatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).StaticEgressGatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile) content.GetValueForProperty("StaticEgressGatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).StaticEgressGatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStaticEgressGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("KubeProxyConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig) content.GetValueForProperty("KubeProxyConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Monitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).Monitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring) content.GetValueForProperty("Monitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).Monitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("AdvancedNetworking")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).AdvancedNetworking = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking) content.GetValueForProperty("AdvancedNetworking",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).AdvancedNetworking, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("NetworkDataplane")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkDataplane = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane?) content.GetValueForProperty("NetworkDataplane",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NetworkDataplane, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane.CreateFrom); + } + if (content.Contains("PodCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).PodCidr = (string) content.GetValueForProperty("PodCidr",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).PodCidr, global::System.Convert.ToString); + } + if (content.Contains("ServiceCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ServiceCidr = (string) content.GetValueForProperty("ServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ServiceCidr, global::System.Convert.ToString); + } + if (content.Contains("DnsServiceIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).DnsServiceIP, global::System.Convert.ToString); + } + if (content.Contains("OutboundType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType?) content.GetValueForProperty("OutboundType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType.CreateFrom); + } + if (content.Contains("LoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("LoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.CreateFrom); + } + if (content.Contains("PodCidrs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).PodCidrs = (string[]) content.GetValueForProperty("PodCidrs",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).PodCidrs, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceCidrs")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ServiceCidrs = (string[]) content.GetValueForProperty("ServiceCidrs",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ServiceCidrs, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IPFamily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IPFamily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily[]) content.GetValueForProperty("IPFamily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IPFamily, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily.CreateFrom)); + } + if (content.Contains("KubeProxyConfigMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode?) content.GetValueForProperty("KubeProxyConfigMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode.CreateFrom); + } + if (content.Contains("AdvancedNetworkingObservability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).AdvancedNetworkingObservability = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability) content.GetValueForProperty("AdvancedNetworkingObservability",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).AdvancedNetworkingObservability, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworkingObservabilityTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerProfileManagedOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileManagedOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs) content.GetValueForProperty("LoadBalancerProfileManagedOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileManagedOutboundIP, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileManagedOutboundIPsTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerProfileOutboundIPPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileOutboundIPPrefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes) content.GetValueForProperty("LoadBalancerProfileOutboundIPPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileOutboundIPPrefix, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPPrefixesTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerProfileOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs) content.GetValueForProperty("LoadBalancerProfileOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileOutboundIP, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPsTypeConverter.ConvertFrom); + } + if (content.Contains("LoadBalancerProfileEffectiveOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileEffectiveOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("LoadBalancerProfileEffectiveOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileEffectiveOutboundIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("LoadBalancerProfileAllocatedOutboundPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileAllocatedOutboundPort = (int?) content.GetValueForProperty("LoadBalancerProfileAllocatedOutboundPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileAllocatedOutboundPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LoadBalancerProfileIdleTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileIdleTimeoutInMinute = (int?) content.GetValueForProperty("LoadBalancerProfileIdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileIdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LoadBalancerProfileEnableMultipleStandardLoadBalancer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileEnableMultipleStandardLoadBalancer = (bool?) content.GetValueForProperty("LoadBalancerProfileEnableMultipleStandardLoadBalancer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileEnableMultipleStandardLoadBalancer, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LoadBalancerProfileBackendPoolType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileBackendPoolType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType?) content.GetValueForProperty("LoadBalancerProfileBackendPoolType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileBackendPoolType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType.CreateFrom); + } + if (content.Contains("LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode?) content.GetValueForProperty("LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode.CreateFrom); + } + if (content.Contains("NatGatewayProfileManagedOutboundIPProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileManagedOutboundIPProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile) content.GetValueForProperty("NatGatewayProfileManagedOutboundIPProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileManagedOutboundIPProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterManagedOutboundIPProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NatGatewayProfileEffectiveOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileEffectiveOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("NatGatewayProfileEffectiveOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileEffectiveOutboundIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("NatGatewayProfileIdleTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileIdleTimeoutInMinute = (int?) content.GetValueForProperty("NatGatewayProfileIdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).NatGatewayProfileIdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StaticEgressGatewayProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).StaticEgressGatewayProfileEnabled = (bool?) content.GetValueForProperty("StaticEgressGatewayProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).StaticEgressGatewayProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeProxyConfigIpvsConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigIpvsConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig) content.GetValueForProperty("KubeProxyConfigIpvsConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigIpvsConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfigTypeConverter.ConvertFrom); + } + if (content.Contains("KubeProxyConfigEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigEnabled = (bool?) content.GetValueForProperty("KubeProxyConfigEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).KubeProxyConfigEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).MonitoringEnabled = (bool?) content.GetValueForProperty("MonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).MonitoringEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ManagedOutboundIPCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPCount = (int?) content.GetValueForProperty("ManagedOutboundIPCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagedOutboundIPCountIpv6")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPCountIpv6 = (int?) content.GetValueForProperty("ManagedOutboundIPCountIpv6",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPCountIpv6, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OutboundIPPrefixPublicIpprefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundIPPrefixPublicIpprefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("OutboundIPPrefixPublicIpprefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundIPPrefixPublicIpprefix, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("OutboundIPPublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundIPPublicIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("OutboundIPPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).OutboundIPPublicIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("ManagedOutboundIPProfileCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPProfileCount = (int?) content.GetValueForProperty("ManagedOutboundIPProfileCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ManagedOutboundIPProfileCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigScheduler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigScheduler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler?) content.GetValueForProperty("IpvConfigScheduler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigScheduler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler.CreateFrom); + } + if (content.Contains("IpvConfigTcpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigTcpTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigTcpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigTcpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigTcpFinTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigTcpFinTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigTcpFinTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigTcpFinTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigUdpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigUdpTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigUdpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).IpvConfigUdpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ObservabilityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ObservabilityEnabled = (bool?) content.GetValueForProperty("ObservabilityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal)this).ObservabilityEnabled, (__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.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerServiceNetworkProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerServiceNetworkProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Profile of network configuration. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceNetworkProfileTypeConverter))] + public partial interface IContainerServiceNetworkProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.TypeConverter.cs new file mode 100644 index 000000000000..879bb4fbbb45 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerServiceNetworkProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerServiceNetworkProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerServiceNetworkProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerServiceNetworkProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.cs new file mode 100644 index 000000000000..fae92438e192 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.cs @@ -0,0 +1,839 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of network configuration. + public partial class ContainerServiceNetworkProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking _advancedNetworking; + + /// + /// Advanced Networking profile for enabling observability on a cluster. For more information see aka.ms/aksadvancednetworking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking AdvancedNetworking { get => (this._advancedNetworking = this._advancedNetworking ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworking()); set => this._advancedNetworking = value; } + + /// Backing field for property. + private string _dnsServiceIP; + + /// + /// An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in serviceCidr. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string DnsServiceIP { get => this._dnsServiceIP; set => this._dnsServiceIP = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily[] _iPFamily; + + /// + /// IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For + /// dual-stack, the expected values are IPv4 and IPv6. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily[] IPFamily { get => this._iPFamily; set => this._iPFamily = value; } + + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? IpvConfigScheduler { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvConfigScheduler; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvConfigScheduler = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler)""); } + + /// + /// The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? IpvConfigTcpFinTimeoutSecond { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvConfigTcpFinTimeoutSecond; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvConfigTcpFinTimeoutSecond = value ?? default(int); } + + /// + /// The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? IpvConfigTcpTimeoutSecond { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvConfigTcpTimeoutSecond; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvConfigTcpTimeoutSecond = value ?? default(int); } + + /// + /// The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? IpvConfigUdpTimeoutSecond { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvConfigUdpTimeoutSecond; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvConfigUdpTimeoutSecond = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig _kubeProxyConfig; + + /// + /// Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. + /// See https://v.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented + /// by a - string. Kubernetes version 1.23 would be '1-23'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig KubeProxyConfig { get => (this._kubeProxyConfig = this._kubeProxyConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfig()); set => this._kubeProxyConfig = value; } + + /// + /// Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default + /// without these customizations). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? KubeProxyConfigEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).Enabled = value ?? default(bool); } + + /// Specify which proxy mode to use ('IPTABLES' or 'IPVS') + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode? KubeProxyConfigMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).Mode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).Mode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile _loadBalancerProfile; + + /// Profile of the cluster load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile LoadBalancerProfile { get => (this._loadBalancerProfile = this._loadBalancerProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfile()); set => this._loadBalancerProfile = value; } + + /// + /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default + /// value is 0 which results in Azure dynamically allocating ports. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? LoadBalancerProfileAllocatedOutboundPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).AllocatedOutboundPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).AllocatedOutboundPort = value ?? default(int); } + + /// The type of the managed inbound Load Balancer BackendPool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType? LoadBalancerProfileBackendPoolType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).BackendPoolType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).BackendPoolType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType)""); } + + /// The health probing behavior for External Traffic Policy Cluster services. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode? LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).ClusterServiceLoadBalancerHealthProbeMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).ClusterServiceLoadBalancerHealthProbeMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode)""); } + + /// The effective outbound IP resources of the cluster load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] LoadBalancerProfileEffectiveOutboundIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).EffectiveOutboundIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).EffectiveOutboundIP = value ?? null /* arrayOf */; } + + /// Enable multiple standard load balancers per AKS cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? LoadBalancerProfileEnableMultipleStandardLoadBalancer { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).EnableMultipleStandardLoadBalancer; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).EnableMultipleStandardLoadBalancer = value ?? default(bool); } + + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? LoadBalancerProfileIdleTimeoutInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).IdleTimeoutInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).IdleTimeoutInMinute = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? _loadBalancerSku; + + /// + /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more + /// information about the differences between load balancer SKUs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? LoadBalancerSku { get => this._loadBalancerSku; set => this._loadBalancerSku = value; } + + /// + /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ManagedOutboundIPCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).ManagedOutboundIPCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).ManagedOutboundIPCount = value ?? default(int); } + + /// + /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ManagedOutboundIPCountIpv6 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).ManagedOutboundIPCountIpv6; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).ManagedOutboundIPCountIpv6 = value ?? default(int); } + + /// + /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). + /// The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ManagedOutboundIPProfileCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)NatGatewayProfile).ManagedOutboundIPProfileCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)NatGatewayProfile).ManagedOutboundIPProfileCount = value ?? default(int); } + + /// Internal Acessors for AdvancedNetworking + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.AdvancedNetworking { get => (this._advancedNetworking = this._advancedNetworking ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworking()); set { {_advancedNetworking = value;} } } + + /// Internal Acessors for AdvancedNetworkingObservability + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.AdvancedNetworkingObservability { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)AdvancedNetworking).Observability; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)AdvancedNetworking).Observability = value; } + + /// Internal Acessors for KubeProxyConfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.KubeProxyConfig { get => (this._kubeProxyConfig = this._kubeProxyConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfig()); set { {_kubeProxyConfig = value;} } } + + /// Internal Acessors for KubeProxyConfigIpvsConfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.KubeProxyConfigIpvsConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvsConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)KubeProxyConfig).IpvsConfig = value; } + + /// Internal Acessors for LoadBalancerProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.LoadBalancerProfile { get => (this._loadBalancerProfile = this._loadBalancerProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfile()); set { {_loadBalancerProfile = value;} } } + + /// Internal Acessors for LoadBalancerProfileManagedOutboundIP + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.LoadBalancerProfileManagedOutboundIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).ManagedOutboundIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).ManagedOutboundIP = value; } + + /// Internal Acessors for LoadBalancerProfileOutboundIP + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.LoadBalancerProfileOutboundIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).OutboundIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).OutboundIP = value; } + + /// Internal Acessors for LoadBalancerProfileOutboundIPPrefix + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.LoadBalancerProfileOutboundIPPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).OutboundIPPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).OutboundIPPrefix = value; } + + /// Internal Acessors for Monitoring + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.Monitoring { get => (this._monitoring = this._monitoring ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkMonitoring()); set { {_monitoring = value;} } } + + /// Internal Acessors for NatGatewayProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.NatGatewayProfile { get => (this._natGatewayProfile = this._natGatewayProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNatGatewayProfile()); set { {_natGatewayProfile = value;} } } + + /// Internal Acessors for NatGatewayProfileManagedOutboundIPProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.NatGatewayProfileManagedOutboundIPProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)NatGatewayProfile).ManagedOutboundIPProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)NatGatewayProfile).ManagedOutboundIPProfile = value; } + + /// Internal Acessors for StaticEgressGatewayProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileInternal.StaticEgressGatewayProfile { get => (this._staticEgressGatewayProfile = this._staticEgressGatewayProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStaticEgressGatewayProfile()); set { {_staticEgressGatewayProfile = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring _monitoring; + + /// + /// This addon can be used to configure network monitoring and generate network monitoring data in Prometheus format + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring Monitoring { get => (this._monitoring = this._monitoring ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkMonitoring()); set => this._monitoring = value; } + + /// Enable or disable the network monitoring plugin on the cluster + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? MonitoringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoringInternal)Monitoring).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoringInternal)Monitoring).Enabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile _natGatewayProfile; + + /// Profile of the cluster NAT gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile NatGatewayProfile { get => (this._natGatewayProfile = this._natGatewayProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNatGatewayProfile()); set => this._natGatewayProfile = value; } + + /// The effective outbound IP resources of the cluster NAT gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] NatGatewayProfileEffectiveOutboundIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)NatGatewayProfile).EffectiveOutboundIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)NatGatewayProfile).EffectiveOutboundIP = value ?? null /* arrayOf */; } + + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 4 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? NatGatewayProfileIdleTimeoutInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)NatGatewayProfile).IdleTimeoutInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)NatGatewayProfile).IdleTimeoutInMinute = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane? _networkDataplane; + + /// Network dataplane used in the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane? NetworkDataplane { get => this._networkDataplane; set => this._networkDataplane = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? _networkMode; + + /// This cannot be specified if networkPlugin is anything other than 'azure'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkMode { get => this._networkMode; set => this._networkMode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? _networkPlugin; + + /// Network plugin used for building the Kubernetes network. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkPlugin { get => this._networkPlugin; set => this._networkPlugin = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? _networkPluginMode; + + /// Network plugin mode used for building the Kubernetes network. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkPluginMode { get => this._networkPluginMode; set => this._networkPluginMode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? _networkPolicy; + + /// Network policy used for building the Kubernetes network. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkPolicy { get => this._networkPolicy; set => this._networkPolicy = value; } + + /// + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ObservabilityEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)AdvancedNetworking).ObservabilityEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingInternal)AdvancedNetworking).ObservabilityEnabled = value ?? default(bool); } + + /// A list of public IP prefix resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPrefixPublicIpprefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).OutboundIPPrefixPublicIpprefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).OutboundIPPrefixPublicIpprefix = value ?? null /* arrayOf */; } + + /// A list of public IP resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPublicIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).OutboundIPPublicIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)LoadBalancerProfile).OutboundIPPublicIP = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType? _outboundType; + + /// + /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType? OutboundType { get => this._outboundType; set => this._outboundType = value; } + + /// Backing field for property. + private string _podCidr; + + /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string PodCidr { get => this._podCidr; set => this._podCidr = value; } + + /// Backing field for property. + private string[] _podCidrs; + + /// + /// 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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] PodCidrs { get => this._podCidrs; set => this._podCidrs = value; } + + /// Backing field for property. + private string _serviceCidr; + + /// + /// A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ServiceCidr { get => this._serviceCidr; set => this._serviceCidr = value; } + + /// Backing field for property. + private string[] _serviceCidrs; + + /// + /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for + /// dual-stack networking. They must not overlap with any Subnet IP ranges. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] ServiceCidrs { get => this._serviceCidrs; set => this._serviceCidrs = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile _staticEgressGatewayProfile; + + /// + /// The profile for Static Egress Gateway addon. For more details about Static Egress Gateway, see https://aka.ms/aks/static-egress-gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile StaticEgressGatewayProfile { get => (this._staticEgressGatewayProfile = this._staticEgressGatewayProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStaticEgressGatewayProfile()); set => this._staticEgressGatewayProfile = value; } + + /// Indicates if Static Egress Gateway addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? StaticEgressGatewayProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfileInternal)StaticEgressGatewayProfile).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfileInternal)StaticEgressGatewayProfile).Enabled = value ?? default(bool); } + + /// Creates an new instance. + public ContainerServiceNetworkProfile() + { + + } + } + /// Profile of network configuration. + public partial interface IContainerServiceNetworkProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in serviceCidr. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr.", + SerializedName = @"dnsServiceIP", + PossibleTypes = new [] { typeof(string) })] + string DnsServiceIP { get; set; } + /// + /// IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For + /// dual-stack, the expected values are IPv4 and IPv6. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6.", + SerializedName = @"ipFamilies", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily[] IPFamily { get; set; } + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html.", + SerializedName = @"scheduler", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? IpvConfigScheduler { get; set; } + /// + /// The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value.", + SerializedName = @"tcpFinTimeoutSeconds", + PossibleTypes = new [] { typeof(int) })] + int? IpvConfigTcpFinTimeoutSecond { get; set; } + /// + /// The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value.", + SerializedName = @"tcpTimeoutSeconds", + PossibleTypes = new [] { typeof(int) })] + int? IpvConfigTcpTimeoutSecond { get; set; } + /// + /// The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value.", + SerializedName = @"udpTimeoutSeconds", + PossibleTypes = new [] { typeof(int) })] + int? IpvConfigUdpTimeoutSecond { get; set; } + /// + /// Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default + /// without these customizations). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default without these customizations).", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? KubeProxyConfigEnabled { get; set; } + /// Specify which proxy mode to use ('IPTABLES' or 'IPVS') + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify which proxy mode to use ('IPTABLES' or 'IPVS')", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode? KubeProxyConfigMode { get; set; } + /// + /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default + /// value is 0 which results in Azure dynamically allocating ports. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports.", + SerializedName = @"allocatedOutboundPorts", + PossibleTypes = new [] { typeof(int) })] + int? LoadBalancerProfileAllocatedOutboundPort { get; set; } + /// The type of the managed inbound Load Balancer BackendPool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the managed inbound Load Balancer BackendPool.", + SerializedName = @"backendPoolType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType? LoadBalancerProfileBackendPoolType { get; set; } + /// The health probing behavior for External Traffic Policy Cluster services. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The health probing behavior for External Traffic Policy Cluster services.", + SerializedName = @"clusterServiceLoadBalancerHealthProbeMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode? LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode { get; set; } + /// The effective outbound IP resources of the cluster load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The effective outbound IP resources of the cluster load balancer.", + SerializedName = @"effectiveOutboundIPs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] LoadBalancerProfileEffectiveOutboundIP { get; set; } + /// Enable multiple standard load balancers per AKS cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable multiple standard load balancers per AKS cluster or not.", + SerializedName = @"enableMultipleStandardLoadBalancers", + PossibleTypes = new [] { typeof(bool) })] + bool? LoadBalancerProfileEnableMultipleStandardLoadBalancer { get; set; } + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes.", + SerializedName = @"idleTimeoutInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? LoadBalancerProfileIdleTimeoutInMinute { get; set; } + /// + /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more + /// information about the differences between load balancer SKUs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs.", + SerializedName = @"loadBalancerSku", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? LoadBalancerSku { get; set; } + /// + /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. ", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? ManagedOutboundIPCount { get; set; } + /// + /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. ", + SerializedName = @"countIPv6", + PossibleTypes = new [] { typeof(int) })] + int? ManagedOutboundIPCountIpv6 { get; set; } + /// + /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). + /// The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. ", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? ManagedOutboundIPProfileCount { get; set; } + /// Enable or disable the network monitoring plugin on the cluster + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable the network monitoring plugin on the cluster", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? MonitoringEnabled { get; set; } + /// The effective outbound IP resources of the cluster NAT gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The effective outbound IP resources of the cluster NAT gateway.", + SerializedName = @"effectiveOutboundIPs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] NatGatewayProfileEffectiveOutboundIP { get; set; } + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 4 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes.", + SerializedName = @"idleTimeoutInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? NatGatewayProfileIdleTimeoutInMinute { get; set; } + /// Network dataplane used in the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Network dataplane used in the Kubernetes cluster.", + SerializedName = @"networkDataplane", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane? NetworkDataplane { get; set; } + /// This cannot be specified if networkPlugin is anything other than 'azure'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be specified if networkPlugin is anything other than 'azure'.", + SerializedName = @"networkMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkMode { get; set; } + /// Network plugin used for building the Kubernetes network. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Network plugin used for building the Kubernetes network.", + SerializedName = @"networkPlugin", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkPlugin { get; set; } + /// Network plugin mode used for building the Kubernetes network. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Network plugin mode used for building the Kubernetes network.", + SerializedName = @"networkPluginMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkPluginMode { get; set; } + /// Network policy used for building the Kubernetes network. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Network policy used for building the Kubernetes network.", + SerializedName = @"networkPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkPolicy { get; set; } + /// + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the enablement of Advanced Networking observability functionalities on clusters.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ObservabilityEnabled { get; set; } + /// A list of public IP prefix resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of public IP prefix resources.", + SerializedName = @"publicIPPrefixes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPrefixPublicIpprefix { get; set; } + /// A list of public IP resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of public IP resources.", + SerializedName = @"publicIPs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPublicIP { get; set; } + /// + /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype).", + SerializedName = @"outboundType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType? OutboundType { get; set; } + /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A CIDR notation IP range from which to assign pod IPs when kubenet is used.", + SerializedName = @"podCidr", + PossibleTypes = new [] { typeof(string) })] + string PodCidr { get; set; } + /// + /// 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.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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[] PodCidrs { get; set; } + /// + /// A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges.", + SerializedName = @"serviceCidr", + PossibleTypes = new [] { typeof(string) })] + string ServiceCidr { get; set; } + /// + /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for + /// dual-stack networking. They must not overlap with any Subnet IP ranges. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges.", + SerializedName = @"serviceCidrs", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceCidrs { get; set; } + /// Indicates if Static Egress Gateway addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Static Egress Gateway addon is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? StaticEgressGatewayProfileEnabled { get; set; } + + } + /// Profile of network configuration. + internal partial interface IContainerServiceNetworkProfileInternal + + { + /// + /// Advanced Networking profile for enabling observability on a cluster. For more information see aka.ms/aksadvancednetworking. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworking AdvancedNetworking { get; set; } + /// + /// Observability profile to enable advanced network metrics and flow logs with historical contexts. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAdvancedNetworkingObservability AdvancedNetworkingObservability { get; set; } + /// + /// An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in serviceCidr. + /// + string DnsServiceIP { get; set; } + /// + /// IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For + /// dual-stack, the expected values are IPv4 and IPv6. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily[] IPFamily { get; set; } + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? IpvConfigScheduler { get; set; } + /// + /// The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + /// + int? IpvConfigTcpFinTimeoutSecond { get; set; } + /// + /// The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + /// + int? IpvConfigTcpTimeoutSecond { get; set; } + /// + /// The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + /// + int? IpvConfigUdpTimeoutSecond { get; set; } + /// + /// Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. + /// See https://v.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented + /// by a - string. Kubernetes version 1.23 would be '1-23'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig KubeProxyConfig { get; set; } + /// + /// Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default + /// without these customizations). + /// + bool? KubeProxyConfigEnabled { get; set; } + /// + /// Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig KubeProxyConfigIpvsConfig { get; set; } + /// Specify which proxy mode to use ('IPTABLES' or 'IPVS') + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode? KubeProxyConfigMode { get; set; } + /// Profile of the cluster load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile LoadBalancerProfile { get; set; } + /// + /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default + /// value is 0 which results in Azure dynamically allocating ports. + /// + int? LoadBalancerProfileAllocatedOutboundPort { get; set; } + /// The type of the managed inbound Load Balancer BackendPool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType? LoadBalancerProfileBackendPoolType { get; set; } + /// The health probing behavior for External Traffic Policy Cluster services. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode? LoadBalancerProfileClusterServiceLoadBalancerHealthProbeMode { get; set; } + /// The effective outbound IP resources of the cluster load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] LoadBalancerProfileEffectiveOutboundIP { get; set; } + /// Enable multiple standard load balancers per AKS cluster or not. + bool? LoadBalancerProfileEnableMultipleStandardLoadBalancer { get; set; } + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 30 minutes. + /// + int? LoadBalancerProfileIdleTimeoutInMinute { get; set; } + /// Desired managed outbound IPs for the cluster load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs LoadBalancerProfileManagedOutboundIP { get; set; } + /// Desired outbound IP resources for the cluster load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs LoadBalancerProfileOutboundIP { get; set; } + /// Desired outbound IP Prefix resources for the cluster load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes LoadBalancerProfileOutboundIPPrefix { get; set; } + /// + /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more + /// information about the differences between load balancer SKUs. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? LoadBalancerSku { get; set; } + /// + /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 1. + /// + int? ManagedOutboundIPCount { get; set; } + /// + /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + /// + int? ManagedOutboundIPCountIpv6 { get; set; } + /// + /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). + /// The default value is 1. + /// + int? ManagedOutboundIPProfileCount { get; set; } + /// + /// This addon can be used to configure network monitoring and generate network monitoring data in Prometheus format + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring Monitoring { get; set; } + /// Enable or disable the network monitoring plugin on the cluster + bool? MonitoringEnabled { get; set; } + /// Profile of the cluster NAT gateway. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile NatGatewayProfile { get; set; } + /// The effective outbound IP resources of the cluster NAT gateway. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] NatGatewayProfileEffectiveOutboundIP { get; set; } + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 4 minutes. + /// + int? NatGatewayProfileIdleTimeoutInMinute { get; set; } + /// Profile of the managed outbound IP resources of the cluster NAT gateway. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile NatGatewayProfileManagedOutboundIPProfile { get; set; } + /// Network dataplane used in the Kubernetes cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane? NetworkDataplane { get; set; } + /// This cannot be specified if networkPlugin is anything other than 'azure'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkMode { get; set; } + /// Network plugin used for building the Kubernetes network. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkPlugin { get; set; } + /// Network plugin mode used for building the Kubernetes network. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkPluginMode { get; set; } + /// Network policy used for building the Kubernetes network. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkPolicy { get; set; } + /// + /// Indicates the enablement of Advanced Networking observability functionalities on clusters. + /// + bool? ObservabilityEnabled { get; set; } + /// A list of public IP prefix resources. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPrefixPublicIpprefix { get; set; } + /// A list of public IP resources. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPublicIP { get; set; } + /// + /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType? OutboundType { get; set; } + /// A CIDR notation IP range from which to assign pod IPs when kubenet is used. + string PodCidr { get; set; } + /// + /// 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[] PodCidrs { get; set; } + /// + /// A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + /// + string ServiceCidr { get; set; } + /// + /// One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for + /// dual-stack networking. They must not overlap with any Subnet IP ranges. + /// + string[] ServiceCidrs { get; set; } + /// + /// The profile for Static Egress Gateway addon. For more details about Static Egress Gateway, see https://aka.ms/aks/static-egress-gateway. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile StaticEgressGatewayProfile { get; set; } + /// Indicates if Static Egress Gateway addon is enabled or not. + bool? StaticEgressGatewayProfileEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.json.cs new file mode 100644 index 000000000000..7c4200e46ceb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfile.json.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of network configuration. + public partial class ContainerServiceNetworkProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerServiceNetworkProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_loadBalancerProfile = If( json?.PropertyT("loadBalancerProfile"), out var __jsonLoadBalancerProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfile.FromJson(__jsonLoadBalancerProfile) : LoadBalancerProfile;} + {_natGatewayProfile = If( json?.PropertyT("natGatewayProfile"), out var __jsonNatGatewayProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNatGatewayProfile.FromJson(__jsonNatGatewayProfile) : NatGatewayProfile;} + {_staticEgressGatewayProfile = If( json?.PropertyT("staticEgressGatewayProfile"), out var __jsonStaticEgressGatewayProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStaticEgressGatewayProfile.FromJson(__jsonStaticEgressGatewayProfile) : StaticEgressGatewayProfile;} + {_kubeProxyConfig = If( json?.PropertyT("kubeProxyConfig"), out var __jsonKubeProxyConfig) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfig.FromJson(__jsonKubeProxyConfig) : KubeProxyConfig;} + {_monitoring = If( json?.PropertyT("monitoring"), out var __jsonMonitoring) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkMonitoring.FromJson(__jsonMonitoring) : Monitoring;} + {_advancedNetworking = If( json?.PropertyT("advancedNetworking"), out var __jsonAdvancedNetworking) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AdvancedNetworking.FromJson(__jsonAdvancedNetworking) : AdvancedNetworking;} + {_networkPlugin = If( json?.PropertyT("networkPlugin"), out var __jsonNetworkPlugin) ? (string)__jsonNetworkPlugin : (string)NetworkPlugin;} + {_networkPluginMode = If( json?.PropertyT("networkPluginMode"), out var __jsonNetworkPluginMode) ? (string)__jsonNetworkPluginMode : (string)NetworkPluginMode;} + {_networkPolicy = If( json?.PropertyT("networkPolicy"), out var __jsonNetworkPolicy) ? (string)__jsonNetworkPolicy : (string)NetworkPolicy;} + {_networkMode = If( json?.PropertyT("networkMode"), out var __jsonNetworkMode) ? (string)__jsonNetworkMode : (string)NetworkMode;} + {_networkDataplane = If( json?.PropertyT("networkDataplane"), out var __jsonNetworkDataplane) ? (string)__jsonNetworkDataplane : (string)NetworkDataplane;} + {_podCidr = If( json?.PropertyT("podCidr"), out var __jsonPodCidr) ? (string)__jsonPodCidr : (string)PodCidr;} + {_serviceCidr = If( json?.PropertyT("serviceCidr"), out var __jsonServiceCidr) ? (string)__jsonServiceCidr : (string)ServiceCidr;} + {_dnsServiceIP = If( json?.PropertyT("dnsServiceIP"), out var __jsonDnsServiceIP) ? (string)__jsonDnsServiceIP : (string)DnsServiceIP;} + {_outboundType = If( json?.PropertyT("outboundType"), out var __jsonOutboundType) ? (string)__jsonOutboundType : (string)OutboundType;} + {_loadBalancerSku = If( json?.PropertyT("loadBalancerSku"), out var __jsonLoadBalancerSku) ? (string)__jsonLoadBalancerSku : (string)LoadBalancerSku;} + {_podCidrs = If( json?.PropertyT("podCidrs"), out var __jsonPodCidrs) ? If( __jsonPodCidrs as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : PodCidrs;} + {_serviceCidrs = If( json?.PropertyT("serviceCidrs"), out var __jsonServiceCidrs) ? If( __jsonServiceCidrs as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ServiceCidrs;} + {_iPFamily = If( json?.PropertyT("ipFamilies"), out var __jsonIPFamilies) ? If( __jsonIPFamilies as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Support.IPFamily) (__k is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString __j ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily)(__j.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily)""))) ))() : null : IPFamily;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ContainerServiceNetworkProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._loadBalancerProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._loadBalancerProfile.ToJson(null,serializationMode) : null, "loadBalancerProfile" ,container.Add ); + AddIf( null != this._natGatewayProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._natGatewayProfile.ToJson(null,serializationMode) : null, "natGatewayProfile" ,container.Add ); + AddIf( null != this._staticEgressGatewayProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._staticEgressGatewayProfile.ToJson(null,serializationMode) : null, "staticEgressGatewayProfile" ,container.Add ); + AddIf( null != this._kubeProxyConfig ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._kubeProxyConfig.ToJson(null,serializationMode) : null, "kubeProxyConfig" ,container.Add ); + AddIf( null != this._monitoring ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._monitoring.ToJson(null,serializationMode) : null, "monitoring" ,container.Add ); + AddIf( null != this._advancedNetworking ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._advancedNetworking.ToJson(null,serializationMode) : null, "advancedNetworking" ,container.Add ); + AddIf( null != (((object)this._networkPlugin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._networkPlugin.ToString()) : null, "networkPlugin" ,container.Add ); + AddIf( null != (((object)this._networkPluginMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._networkPluginMode.ToString()) : null, "networkPluginMode" ,container.Add ); + AddIf( null != (((object)this._networkPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._networkPolicy.ToString()) : null, "networkPolicy" ,container.Add ); + AddIf( null != (((object)this._networkMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._networkMode.ToString()) : null, "networkMode" ,container.Add ); + AddIf( null != (((object)this._networkDataplane)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._networkDataplane.ToString()) : null, "networkDataplane" ,container.Add ); + AddIf( null != (((object)this._podCidr)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._podCidr.ToString()) : null, "podCidr" ,container.Add ); + AddIf( null != (((object)this._serviceCidr)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._serviceCidr.ToString()) : null, "serviceCidr" ,container.Add ); + AddIf( null != (((object)this._dnsServiceIP)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._dnsServiceIP.ToString()) : null, "dnsServiceIP" ,container.Add ); + AddIf( null != (((object)this._outboundType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._outboundType.ToString()) : null, "outboundType" ,container.Add ); + AddIf( null != (((object)this._loadBalancerSku)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._loadBalancerSku.ToString()) : null, "loadBalancerSku" ,container.Add ); + if (null != this._podCidrs) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._podCidrs ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("podCidrs",__w); + } + if (null != this._serviceCidrs) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._serviceCidrs ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("serviceCidrs",__r); + } + if (null != this._iPFamily) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __n in this._iPFamily ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("ipFamilies",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.PowerShell.cs new file mode 100644 index 000000000000..2437ebe53702 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. + /// See https://v.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented + /// by a - string. Kubernetes version 1.23 would be '1-23'. + /// + [System.ComponentModel.TypeConverter(typeof(ContainerServiceNetworkProfileKubeProxyConfigTypeConverter))] + public partial class ContainerServiceNetworkProfileKubeProxyConfig + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ContainerServiceNetworkProfileKubeProxyConfig(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IpvsConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvsConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig) content.GetValueForProperty("IpvsConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvsConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode.CreateFrom); + } + if (content.Contains("IpvConfigScheduler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigScheduler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler?) content.GetValueForProperty("IpvConfigScheduler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigScheduler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler.CreateFrom); + } + if (content.Contains("IpvConfigTcpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigTcpTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigTcpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigTcpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigTcpFinTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigTcpFinTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigTcpFinTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigTcpFinTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigUdpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigUdpTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigUdpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigUdpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ContainerServiceNetworkProfileKubeProxyConfig(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IpvsConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvsConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig) content.GetValueForProperty("IpvsConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvsConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfigTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode.CreateFrom); + } + if (content.Contains("IpvConfigScheduler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigScheduler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler?) content.GetValueForProperty("IpvConfigScheduler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigScheduler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler.CreateFrom); + } + if (content.Contains("IpvConfigTcpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigTcpTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigTcpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigTcpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigTcpFinTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigTcpFinTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigTcpFinTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigTcpFinTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IpvConfigUdpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigUdpTimeoutSecond = (int?) content.GetValueForProperty("IpvConfigUdpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal)this).IpvConfigUdpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerServiceNetworkProfileKubeProxyConfig(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerServiceNetworkProfileKubeProxyConfig(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. + /// See https://v.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented + /// by a - string. Kubernetes version 1.23 would be '1-23'. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceNetworkProfileKubeProxyConfigTypeConverter))] + public partial interface IContainerServiceNetworkProfileKubeProxyConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.TypeConverter.cs new file mode 100644 index 000000000000..8f5550f4caed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerServiceNetworkProfileKubeProxyConfigTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerServiceNetworkProfileKubeProxyConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerServiceNetworkProfileKubeProxyConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerServiceNetworkProfileKubeProxyConfig.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.cs new file mode 100644 index 000000000000..fe487dbf476d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. + /// See https://v.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented + /// by a - string. Kubernetes version 1.23 would be '1-23'. + /// + public partial class ContainerServiceNetworkProfileKubeProxyConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// + /// Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default + /// without these customizations). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? IpvConfigScheduler { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)IpvsConfig).Scheduler; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)IpvsConfig).Scheduler = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler)""); } + + /// + /// The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? IpvConfigTcpFinTimeoutSecond { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)IpvsConfig).TcpFinTimeoutSecond; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)IpvsConfig).TcpFinTimeoutSecond = value ?? default(int); } + + /// + /// The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? IpvConfigTcpTimeoutSecond { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)IpvsConfig).TcpTimeoutSecond; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)IpvsConfig).TcpTimeoutSecond = value ?? default(int); } + + /// + /// The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? IpvConfigUdpTimeoutSecond { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)IpvsConfig).UdpTimeoutSecond; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)IpvsConfig).UdpTimeoutSecond = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig _ipvsConfig; + + /// + /// Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig IpvsConfig { get => (this._ipvsConfig = this._ipvsConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig()); set => this._ipvsConfig = value; } + + /// Internal Acessors for IpvsConfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigInternal.IpvsConfig { get => (this._ipvsConfig = this._ipvsConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig()); set { {_ipvsConfig = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode? _mode; + + /// Specify which proxy mode to use ('IPTABLES' or 'IPVS') + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode? Mode { get => this._mode; set => this._mode = value; } + + /// + /// Creates an new instance. + /// + public ContainerServiceNetworkProfileKubeProxyConfig() + { + + } + } + /// Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. + /// See https://v.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented + /// by a - string. Kubernetes version 1.23 would be '1-23'. + public partial interface IContainerServiceNetworkProfileKubeProxyConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default + /// without these customizations). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default without these customizations).", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html.", + SerializedName = @"scheduler", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? IpvConfigScheduler { get; set; } + /// + /// The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value.", + SerializedName = @"tcpFinTimeoutSeconds", + PossibleTypes = new [] { typeof(int) })] + int? IpvConfigTcpFinTimeoutSecond { get; set; } + /// + /// The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value.", + SerializedName = @"tcpTimeoutSeconds", + PossibleTypes = new [] { typeof(int) })] + int? IpvConfigTcpTimeoutSecond { get; set; } + /// + /// The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value.", + SerializedName = @"udpTimeoutSeconds", + PossibleTypes = new [] { typeof(int) })] + int? IpvConfigUdpTimeoutSecond { get; set; } + /// Specify which proxy mode to use ('IPTABLES' or 'IPVS') + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specify which proxy mode to use ('IPTABLES' or 'IPVS')", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode? Mode { get; set; } + + } + /// Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. + /// See https://v.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented + /// by a - string. Kubernetes version 1.23 would be '1-23'. + internal partial interface IContainerServiceNetworkProfileKubeProxyConfigInternal + + { + /// + /// Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default + /// without these customizations). + /// + bool? Enabled { get; set; } + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? IpvConfigScheduler { get; set; } + /// + /// The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + /// + int? IpvConfigTcpFinTimeoutSecond { get; set; } + /// + /// The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + /// + int? IpvConfigTcpTimeoutSecond { get; set; } + /// + /// The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + /// + int? IpvConfigUdpTimeoutSecond { get; set; } + /// + /// Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig IpvsConfig { get; set; } + /// Specify which proxy mode to use ('IPTABLES' or 'IPVS') + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode? Mode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.json.cs new file mode 100644 index 000000000000..fa1c68419c37 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfig.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. + /// See https://v.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented + /// by a - string. Kubernetes version 1.23 would be '1-23'. + /// + public partial class ContainerServiceNetworkProfileKubeProxyConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerServiceNetworkProfileKubeProxyConfig(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_ipvsConfig = If( json?.PropertyT("ipvsConfig"), out var __jsonIpvsConfig) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.FromJson(__jsonIpvsConfig) : IpvsConfig;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ContainerServiceNetworkProfileKubeProxyConfig(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._ipvsConfig ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._ipvsConfig.ToJson(null,serializationMode) : null, "ipvsConfig" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.PowerShell.cs new file mode 100644 index 000000000000..a6680f503df0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.PowerShell.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + /// + [System.ComponentModel.TypeConverter(typeof(ContainerServiceNetworkProfileKubeProxyConfigIpvsConfigTypeConverter))] + public partial class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scheduler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).Scheduler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler?) content.GetValueForProperty("Scheduler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).Scheduler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler.CreateFrom); + } + if (content.Contains("TcpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).TcpTimeoutSecond = (int?) content.GetValueForProperty("TcpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).TcpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TcpFinTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).TcpFinTimeoutSecond = (int?) content.GetValueForProperty("TcpFinTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).TcpFinTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UdpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).UdpTimeoutSecond = (int?) content.GetValueForProperty("UdpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).UdpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scheduler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).Scheduler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler?) content.GetValueForProperty("Scheduler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).Scheduler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler.CreateFrom); + } + if (content.Contains("TcpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).TcpTimeoutSecond = (int?) content.GetValueForProperty("TcpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).TcpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TcpFinTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).TcpFinTimeoutSecond = (int?) content.GetValueForProperty("TcpFinTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).TcpFinTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UdpTimeoutSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).UdpTimeoutSecond = (int?) content.GetValueForProperty("UdpTimeoutSecond",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal)this).UdpTimeoutSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceNetworkProfileKubeProxyConfigIpvsConfigTypeConverter))] + public partial interface IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.TypeConverter.cs new file mode 100644 index 000000000000..02687330c812 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfigTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.cs new file mode 100644 index 000000000000..24c7de930013 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + /// + public partial class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? _scheduler; + + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? Scheduler { get => this._scheduler; set => this._scheduler = value; } + + /// Backing field for property. + private int? _tcpFinTimeoutSecond; + + /// + /// The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? TcpFinTimeoutSecond { get => this._tcpFinTimeoutSecond; set => this._tcpFinTimeoutSecond = value; } + + /// Backing field for property. + private int? _tcpTimeoutSecond; + + /// + /// The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? TcpTimeoutSecond { get => this._tcpTimeoutSecond; set => this._tcpTimeoutSecond = value; } + + /// Backing field for property. + private int? _udpTimeoutSecond; + + /// + /// The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? UdpTimeoutSecond { get => this._udpTimeoutSecond; set => this._udpTimeoutSecond = value; } + + /// + /// Creates an new instance. + /// + public ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig() + { + + } + } + /// Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + public partial interface IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html.", + SerializedName = @"scheduler", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? Scheduler { get; set; } + /// + /// The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value.", + SerializedName = @"tcpFinTimeoutSeconds", + PossibleTypes = new [] { typeof(int) })] + int? TcpFinTimeoutSecond { get; set; } + /// + /// The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value.", + SerializedName = @"tcpTimeoutSeconds", + PossibleTypes = new [] { typeof(int) })] + int? TcpTimeoutSecond { get; set; } + /// + /// The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value.", + SerializedName = @"udpTimeoutSeconds", + PossibleTypes = new [] { typeof(int) })] + int? UdpTimeoutSecond { get; set; } + + } + /// Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + internal partial interface IContainerServiceNetworkProfileKubeProxyConfigIpvsConfigInternal + + { + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler? Scheduler { get; set; } + /// + /// The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + /// + int? TcpFinTimeoutSecond { get; set; } + /// + /// The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + /// + int? TcpTimeoutSecond { get; set; } + /// + /// The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + /// + int? UdpTimeoutSecond { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.json.cs new file mode 100644 index 000000000000..965a67f8f6e2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + /// + public partial class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_scheduler = If( json?.PropertyT("scheduler"), out var __jsonScheduler) ? (string)__jsonScheduler : (string)Scheduler;} + {_tcpTimeoutSecond = If( json?.PropertyT("tcpTimeoutSeconds"), out var __jsonTcpTimeoutSeconds) ? (int?)__jsonTcpTimeoutSeconds : TcpTimeoutSecond;} + {_tcpFinTimeoutSecond = If( json?.PropertyT("tcpFinTimeoutSeconds"), out var __jsonTcpFinTimeoutSeconds) ? (int?)__jsonTcpFinTimeoutSeconds : TcpFinTimeoutSecond;} + {_udpTimeoutSecond = If( json?.PropertyT("udpTimeoutSeconds"), out var __jsonUdpTimeoutSeconds) ? (int?)__jsonUdpTimeoutSeconds : UdpTimeoutSecond;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfileKubeProxyConfigIpvsConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._scheduler)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scheduler.ToString()) : null, "scheduler" ,container.Add ); + AddIf( null != this._tcpTimeoutSecond ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._tcpTimeoutSecond) : null, "tcpTimeoutSeconds" ,container.Add ); + AddIf( null != this._tcpFinTimeoutSecond ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._tcpFinTimeoutSecond) : null, "tcpFinTimeoutSeconds" ,container.Add ); + AddIf( null != this._udpTimeoutSecond ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._udpTimeoutSecond) : null, "udpTimeoutSeconds" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.PowerShell.cs new file mode 100644 index 000000000000..875831fa9369 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// SSH configuration for Linux-based VMs running on Azure. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceSshConfigurationTypeConverter))] + public partial class ContainerServiceSshConfiguration + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ContainerServiceSshConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfigurationInternal)this).PublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfigurationInternal)this).PublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKeyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ContainerServiceSshConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfigurationInternal)this).PublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfigurationInternal)this).PublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKeyTypeConverter.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.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerServiceSshConfiguration(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerServiceSshConfiguration(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// SSH configuration for Linux-based VMs running on Azure. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceSshConfigurationTypeConverter))] + public partial interface IContainerServiceSshConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..8e96abddd68d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerServiceSshConfigurationTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerServiceSshConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerServiceSshConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerServiceSshConfiguration.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.cs new file mode 100644 index 000000000000..63e4a7923218 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// SSH configuration for Linux-based VMs running on Azure. + public partial class ContainerServiceSshConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] _publicKey; + + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] PublicKey { get => this._publicKey; set => this._publicKey = value; } + + /// Creates an new instance. + public ContainerServiceSshConfiguration() + { + + } + } + /// SSH configuration for Linux-based VMs running on Azure. + public partial interface IContainerServiceSshConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified.", + SerializedName = @"publicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] PublicKey { get; set; } + + } + /// SSH configuration for Linux-based VMs running on Azure. + internal partial interface IContainerServiceSshConfigurationInternal + + { + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] PublicKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.json.cs new file mode 100644 index 000000000000..d2622bf708a2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshConfiguration.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// SSH configuration for Linux-based VMs running on Azure. + public partial class ContainerServiceSshConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerServiceSshConfiguration(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_publicKey = If( json?.PropertyT("publicKeys"), out var __jsonPublicKeys) ? If( __jsonPublicKeys as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKey.FromJson(__u) )) ))() : null : PublicKey;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ContainerServiceSshConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._publicKey) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._publicKey ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("publicKeys",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.PowerShell.cs new file mode 100644 index 000000000000..0e7d92b58035 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Contains information about SSH certificate public key data. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceSshPublicKeyTypeConverter))] + public partial class ContainerServiceSshPublicKey + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ContainerServiceSshPublicKey(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKeyInternal)this).KeyData = (string) content.GetValueForProperty("KeyData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKeyInternal)this).KeyData, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ContainerServiceSshPublicKey(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKeyInternal)this).KeyData = (string) content.GetValueForProperty("KeyData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKeyInternal)this).KeyData, 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.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerServiceSshPublicKey(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerServiceSshPublicKey(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Contains information about SSH certificate public key data. + [System.ComponentModel.TypeConverter(typeof(ContainerServiceSshPublicKeyTypeConverter))] + public partial interface IContainerServiceSshPublicKey + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.TypeConverter.cs new file mode 100644 index 000000000000..cd31b6beb4e3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerServiceSshPublicKeyTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerServiceSshPublicKey.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerServiceSshPublicKey.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerServiceSshPublicKey.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.cs new file mode 100644 index 000000000000..d080811d16db --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Contains information about SSH certificate public key data. + public partial class ContainerServiceSshPublicKey : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKeyInternal + { + + /// Backing field for property. + private string _keyData; + + /// + /// Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without + /// headers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KeyData { get => this._keyData; set => this._keyData = value; } + + /// Creates an new instance. + public ContainerServiceSshPublicKey() + { + + } + } + /// Contains information about SSH certificate public key data. + public partial interface IContainerServiceSshPublicKey : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without + /// headers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers.", + SerializedName = @"keyData", + PossibleTypes = new [] { typeof(string) })] + string KeyData { get; set; } + + } + /// Contains information about SSH certificate public key data. + internal partial interface IContainerServiceSshPublicKeyInternal + + { + /// + /// Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without + /// headers. + /// + string KeyData { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.json.cs new file mode 100644 index 000000000000..5fa82b018ad5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ContainerServiceSshPublicKey.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Contains information about SSH certificate public key data. + public partial class ContainerServiceSshPublicKey + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerServiceSshPublicKey(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyData = If( json?.PropertyT("keyData"), out var __jsonKeyData) ? (string)__jsonKeyData : (string)KeyData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ContainerServiceSshPublicKey(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._keyData.ToString()) : null, "keyData" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.PowerShell.cs new file mode 100644 index 000000000000..9e8288521ecb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Data used when creating a target resource from a source resource. + [System.ComponentModel.TypeConverter(typeof(CreationDataTypeConverter))] + public partial class CreationData + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CreationData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)this).SourceResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CreationData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)this).SourceResourceId, 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.ContainerService.Models.Api20240402Preview.ICreationData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CreationData(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CreationData(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Data used when creating a target resource from a source resource. + [System.ComponentModel.TypeConverter(typeof(CreationDataTypeConverter))] + public partial interface ICreationData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.TypeConverter.cs new file mode 100644 index 000000000000..55195196ba10 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CreationDataTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICreationData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CreationData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CreationData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CreationData.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.cs new file mode 100644 index 000000000000..ca61c23b263a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Data used when creating a target resource from a source resource. + public partial class CreationData : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal + { + + /// Backing field for property. + private string _sourceResourceId; + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Creates an new instance. + public CreationData() + { + + } + } + /// Data used when creating a target resource from a source resource. + public partial interface ICreationData : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + + } + /// Data used when creating a target resource from a source resource. + internal partial interface ICreationDataInternal + + { + /// This is the ARM ID of the source object to be used to create the target object. + string SourceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.json.cs new file mode 100644 index 000000000000..78fab2efef07 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CreationData.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Data used when creating a target resource from a source resource. + public partial class CreationData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal CreationData(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new CreationData(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.PowerShell.cs new file mode 100644 index 000000000000..dce30eb1b8f2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The credential result response. + [System.ComponentModel.TypeConverter(typeof(CredentialResultTypeConverter))] + public partial class CredentialResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CredentialResult(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.ContainerService.Models.Api20240402Preview.ICredentialResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultInternal)this).Value = (byte[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultInternal)this).Value, i => i); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CredentialResult(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.ContainerService.Models.Api20240402Preview.ICredentialResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultInternal)this).Value = (byte[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultInternal)this).Value, i => i); + } + 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.ContainerService.Models.Api20240402Preview.ICredentialResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CredentialResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CredentialResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The credential result response. + [System.ComponentModel.TypeConverter(typeof(CredentialResultTypeConverter))] + public partial interface ICredentialResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.TypeConverter.cs new file mode 100644 index 000000000000..f2fcc6f3573b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CredentialResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICredentialResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CredentialResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CredentialResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CredentialResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.cs new file mode 100644 index 000000000000..ffc8e55ff3d9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The credential result response. + public partial class CredentialResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + byte[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the credential. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private byte[] _value; + + /// Base64-encoded Kubernetes configuration file. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public byte[] Value { get => this._value; } + + /// Creates an new instance. + public CredentialResult() + { + + } + } + /// The credential result response. + public partial interface ICredentialResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The name of the credential. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the credential.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Base64-encoded Kubernetes configuration file. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Base64-encoded Kubernetes configuration file.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(byte[]) })] + byte[] Value { get; } + + } + /// The credential result response. + internal partial interface ICredentialResultInternal + + { + /// The name of the credential. + string Name { get; set; } + /// Base64-encoded Kubernetes configuration file. + byte[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.json.cs new file mode 100644 index 000000000000..9a87e334e97c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The credential result response. + public partial class CredentialResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal CredentialResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_value = If( json?.PropertyT("value"), out var __w) ? System.Convert.FromBase64String( ((string)__w).Replace("_","/").Replace("-","+").PadRight( ((string)__w).Length + ((string)__w).Length * 3 % 4, '=') ) : null;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new CredentialResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._value ? global::System.Convert.ToBase64String( this._value) : null ,(v)=> container.Add( "value",v) ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.PowerShell.cs new file mode 100644 index 000000000000..4eb6db97bc95 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The list credential result response. + [System.ComponentModel.TypeConverter(typeof(CredentialResultsTypeConverter))] + public partial class CredentialResults + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CredentialResults(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kubeconfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultsInternal)this).Kubeconfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult[]) content.GetValueForProperty("Kubeconfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultsInternal)this).Kubeconfig, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CredentialResultTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CredentialResults(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Kubeconfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultsInternal)this).Kubeconfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult[]) content.GetValueForProperty("Kubeconfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultsInternal)this).Kubeconfig, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CredentialResultTypeConverter.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.ContainerService.Models.Api20240402Preview.ICredentialResults DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CredentialResults(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CredentialResults(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list credential result response. + [System.ComponentModel.TypeConverter(typeof(CredentialResultsTypeConverter))] + public partial interface ICredentialResults + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.TypeConverter.cs new file mode 100644 index 000000000000..c06714a0c538 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CredentialResultsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICredentialResults ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CredentialResults.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CredentialResults.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CredentialResults.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.cs new file mode 100644 index 000000000000..9db301d25cc6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list credential result response. + public partial class CredentialResults : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult[] _kubeconfig; + + /// Base64-encoded Kubernetes configuration file. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult[] Kubeconfig { get => this._kubeconfig; } + + /// Internal Acessors for Kubeconfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResultsInternal.Kubeconfig { get => this._kubeconfig; set { {_kubeconfig = value;} } } + + /// Creates an new instance. + public CredentialResults() + { + + } + } + /// The list credential result response. + public partial interface ICredentialResults : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Base64-encoded Kubernetes configuration file. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Base64-encoded Kubernetes configuration file.", + SerializedName = @"kubeconfigs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult[] Kubeconfig { get; } + + } + /// The list credential result response. + internal partial interface ICredentialResultsInternal + + { + /// Base64-encoded Kubernetes configuration file. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult[] Kubeconfig { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.json.cs new file mode 100644 index 000000000000..0c3c3ba7f96d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/CredentialResults.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list credential result response. + public partial class CredentialResults + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal CredentialResults(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kubeconfig = If( json?.PropertyT("kubeconfigs"), out var __jsonKubeconfigs) ? If( __jsonKubeconfigs as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICredentialResult) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CredentialResult.FromJson(__u) )) ))() : null : Kubeconfig;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new CredentialResults(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._kubeconfig) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._kubeconfig ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("kubeconfigs",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.PowerShell.cs new file mode 100644 index 000000000000..2fbb6a8a2c5f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// For schedules like: 'recur every day' or 'recur every 3 days'. + [System.ComponentModel.TypeConverter(typeof(DailyScheduleTypeConverter))] + public partial class DailySchedule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DailySchedule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailyScheduleInternal)this).IntervalDay = (int) content.GetValueForProperty("IntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailyScheduleInternal)this).IntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DailySchedule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailyScheduleInternal)this).IntervalDay = (int) content.GetValueForProperty("IntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailyScheduleInternal)this).IntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Models.Api20240402Preview.IDailySchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DailySchedule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DailySchedule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// For schedules like: 'recur every day' or 'recur every 3 days'. + [System.ComponentModel.TypeConverter(typeof(DailyScheduleTypeConverter))] + public partial interface IDailySchedule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.TypeConverter.cs new file mode 100644 index 000000000000..dbdbc55b961f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DailyScheduleTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IDailySchedule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DailySchedule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DailySchedule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DailySchedule.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.cs new file mode 100644 index 000000000000..073a77e30372 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// For schedules like: 'recur every day' or 'recur every 3 days'. + public partial class DailySchedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailyScheduleInternal + { + + /// Backing field for property. + private int _intervalDay; + + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int IntervalDay { get => this._intervalDay; set => this._intervalDay = value; } + + /// Creates an new instance. + public DailySchedule() + { + + } + } + /// For schedules like: 'recur every day' or 'recur every 3 days'. + public partial interface IDailySchedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the number of days between each set of occurrences.", + SerializedName = @"intervalDays", + PossibleTypes = new [] { typeof(int) })] + int IntervalDay { get; set; } + + } + /// For schedules like: 'recur every day' or 'recur every 3 days'. + internal partial interface IDailyScheduleInternal + + { + /// Specifies the number of days between each set of occurrences. + int IntervalDay { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.json.cs new file mode 100644 index 000000000000..3bdb3bf38f34 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DailySchedule.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// For schedules like: 'recur every day' or 'recur every 3 days'. + public partial class DailySchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal DailySchedule(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_intervalDay = If( json?.PropertyT("intervalDays"), out var __jsonIntervalDays) ? (int)__jsonIntervalDays : IntervalDay;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new DailySchedule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber(this._intervalDay), "intervalDays" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.PowerShell.cs new file mode 100644 index 000000000000..ebd9a831bac4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// For example, between '2022-12-23' and '2023-01-05'. + [System.ComponentModel.TypeConverter(typeof(DateSpanTypeConverter))] + public partial class DateSpan + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DateSpan(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpanInternal)this).Start = (global::System.DateTime) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpanInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("End")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpanInternal)this).End = (global::System.DateTime) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpanInternal)this).End, (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 DateSpan(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpanInternal)this).Start = (global::System.DateTime) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpanInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("End")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpanInternal)this).End = (global::System.DateTime) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpanInternal)this).End, (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.ContainerService.Models.Api20240402Preview.IDateSpan DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DateSpan(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DateSpan(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// For example, between '2022-12-23' and '2023-01-05'. + [System.ComponentModel.TypeConverter(typeof(DateSpanTypeConverter))] + public partial interface IDateSpan + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.TypeConverter.cs new file mode 100644 index 000000000000..eb0fb9390628 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DateSpanTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IDateSpan ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DateSpan.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DateSpan.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DateSpan.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.cs new file mode 100644 index 000000000000..0803452af665 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// For example, between '2022-12-23' and '2023-01-05'. + public partial class DateSpan : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpanInternal + { + + /// Backing field for property. + private global::System.DateTime _end; + + /// The end date of the date span. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime End { get => this._end; set => this._end = value; } + + /// Backing field for property. + private global::System.DateTime _start; + + /// The start date of the date span. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime Start { get => this._start; set => this._start = value; } + + /// Creates an new instance. + public DateSpan() + { + + } + } + /// For example, between '2022-12-23' and '2023-01-05'. + public partial interface IDateSpan : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The end date of the date span. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The end date of the date span.", + SerializedName = @"end", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime End { get; set; } + /// The start date of the date span. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start date of the date span.", + SerializedName = @"start", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime Start { get; set; } + + } + /// For example, between '2022-12-23' and '2023-01-05'. + internal partial interface IDateSpanInternal + + { + /// The end date of the date span. + global::System.DateTime End { get; set; } + /// The start date of the date span. + global::System.DateTime Start { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.json.cs new file mode 100644 index 000000000000..cfa2b0605608 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/DateSpan.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// For example, between '2022-12-23' and '2023-01-05'. + public partial class DateSpan + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal DateSpan(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_start = If( json?.PropertyT("start"), out var __jsonStart) ? global::System.DateTime.TryParse((string)__jsonStart, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartValue) ? __jsonStartValue : Start : Start;} + {_end = If( json?.PropertyT("end"), out var __jsonEnd) ? global::System.DateTime.TryParse((string)__jsonEnd, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndValue) ? __jsonEndValue : End : End;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new DateSpan(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._start.ToString(@"yyyy-MM-dd",global::System.Globalization.CultureInfo.InvariantCulture)), "start" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._end.ToString(@"yyyy-MM-dd",global::System.Globalization.CultureInfo.InvariantCulture)), "end" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.PowerShell.cs new file mode 100644 index 000000000000..97909fe65dc1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A domain name that AKS agent nodes are reaching at. + [System.ComponentModel.TypeConverter(typeof(EndpointDependencyTypeConverter))] + public partial class EndpointDependency + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EndpointDependency(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EndpointDependency(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EndpointDependency(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependencyInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependencyInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("EndpointDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependencyInternal)this).EndpointDetail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail[]) content.GetValueForProperty("EndpointDetail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependencyInternal)this).EndpointDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDetailTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EndpointDependency(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependencyInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependencyInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("EndpointDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependencyInternal)this).EndpointDetail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail[]) content.GetValueForProperty("EndpointDetail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependencyInternal)this).EndpointDetail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDetailTypeConverter.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.ContainerService.Models.Api20240402Preview.IEndpointDependency FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A domain name that AKS agent nodes are reaching at. + [System.ComponentModel.TypeConverter(typeof(EndpointDependencyTypeConverter))] + public partial interface IEndpointDependency + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.TypeConverter.cs new file mode 100644 index 000000000000..80dcf75463ab --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EndpointDependencyTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IEndpointDependency ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EndpointDependency.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EndpointDependency.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EndpointDependency.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.cs new file mode 100644 index 000000000000..e4bf3876a27f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A domain name that AKS agent nodes are reaching at. + public partial class EndpointDependency : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependencyInternal + { + + /// Backing field for property. + private string _domainName; + + /// The domain name of the dependency. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail[] _endpointDetail; + + /// The Ports and Protocols used when connecting to domainName. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail[] EndpointDetail { get => this._endpointDetail; set => this._endpointDetail = value; } + + /// Creates an new instance. + public EndpointDependency() + { + + } + } + /// A domain name that AKS agent nodes are reaching at. + public partial interface IEndpointDependency : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The domain name of the dependency. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The domain name of the dependency.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string DomainName { get; set; } + /// The Ports and Protocols used when connecting to domainName. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Ports and Protocols used when connecting to domainName.", + SerializedName = @"endpointDetails", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail[] EndpointDetail { get; set; } + + } + /// A domain name that AKS agent nodes are reaching at. + internal partial interface IEndpointDependencyInternal + + { + /// The domain name of the dependency. + string DomainName { get; set; } + /// The Ports and Protocols used when connecting to domainName. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail[] EndpointDetail { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.json.cs new file mode 100644 index 000000000000..0e3d22d3caec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDependency.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A domain name that AKS agent nodes are reaching at. + public partial class EndpointDependency + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal EndpointDependency(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_domainName = If( json?.PropertyT("domainName"), out var __jsonDomainName) ? (string)__jsonDomainName : (string)DomainName;} + {_endpointDetail = If( json?.PropertyT("endpointDetails"), out var __jsonEndpointDetails) ? If( __jsonEndpointDetails as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IEndpointDetail) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDetail.FromJson(__u) )) ))() : null : EndpointDetail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new EndpointDependency(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._domainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._domainName.ToString()) : null, "domainName" ,container.Add ); + if (null != this._endpointDetail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._endpointDetail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("endpointDetails",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.PowerShell.cs new file mode 100644 index 000000000000..cfe0ffb4f979 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// connect information from the AKS agent nodes to a single endpoint. + [System.ComponentModel.TypeConverter(typeof(EndpointDetailTypeConverter))] + public partial class EndpointDetail + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EndpointDetail(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EndpointDetail(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EndpointDetail(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).IPAddress, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Protocol = (string) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Protocol, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)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 EndpointDetail(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).IPAddress = (string) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).IPAddress, global::System.Convert.ToString); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Port = (int?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Port, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Protocol = (string) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Protocol, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal)this).Description, 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.ContainerService.Models.Api20240402Preview.IEndpointDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// connect information from the AKS agent nodes to a single endpoint. + [System.ComponentModel.TypeConverter(typeof(EndpointDetailTypeConverter))] + public partial interface IEndpointDetail + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.TypeConverter.cs new file mode 100644 index 000000000000..2f579e4b2869 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EndpointDetailTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IEndpointDetail ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EndpointDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EndpointDetail.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EndpointDetail.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.cs new file mode 100644 index 000000000000..28af12e5e527 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// connect information from the AKS agent nodes to a single endpoint. + public partial class EndpointDetail : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetailInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the detail + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _iPAddress; + + /// An IP Address that Domain Name currently resolves to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string IPAddress { get => this._iPAddress; set => this._iPAddress = value; } + + /// Backing field for property. + private int? _port; + + /// The port an endpoint is connected to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? Port { get => this._port; set => this._port = value; } + + /// Backing field for property. + private string _protocol; + + /// The protocol used for connection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Protocol { get => this._protocol; set => this._protocol = value; } + + /// Creates an new instance. + public EndpointDetail() + { + + } + } + /// connect information from the AKS agent nodes to a single endpoint. + public partial interface IEndpointDetail : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Description of the detail + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the detail", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// An IP Address that Domain Name currently resolves to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An IP Address that Domain Name currently resolves to.", + SerializedName = @"ipAddress", + PossibleTypes = new [] { typeof(string) })] + string IPAddress { get; set; } + /// The port an endpoint is connected to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The port an endpoint is connected to.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(int) })] + int? Port { get; set; } + /// The protocol used for connection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The protocol used for connection", + SerializedName = @"protocol", + PossibleTypes = new [] { typeof(string) })] + string Protocol { get; set; } + + } + /// connect information from the AKS agent nodes to a single endpoint. + internal partial interface IEndpointDetailInternal + + { + /// Description of the detail + string Description { get; set; } + /// An IP Address that Domain Name currently resolves to. + string IPAddress { get; set; } + /// The port an endpoint is connected to. + int? Port { get; set; } + /// The protocol used for connection + string Protocol { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.json.cs new file mode 100644 index 000000000000..89747e4b18fe --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/EndpointDetail.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// connect information from the AKS agent nodes to a single endpoint. + public partial class EndpointDetail + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal EndpointDetail(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_iPAddress = If( json?.PropertyT("ipAddress"), out var __jsonIPAddress) ? (string)__jsonIPAddress : (string)IPAddress;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (int?)__jsonPort : Port;} + {_protocol = If( json?.PropertyT("protocol"), out var __jsonProtocol) ? (string)__jsonProtocol : (string)Protocol;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new EndpointDetail(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._iPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._iPAddress.ToString()) : null, "ipAddress" ,container.Add ); + AddIf( null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._port) : null, "port" ,container.Add ); + AddIf( null != (((object)this._protocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._protocol.ToString()) : null, "protocol" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.PowerShell.cs new file mode 100644 index 000000000000..3cc7ef275b67 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The complex type of the extended location. + [System.ComponentModel.TypeConverter(typeof(ExtendedLocationTypeConverter))] + public partial class ExtendedLocation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExtendedLocation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExtendedLocation(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExtendedLocation(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.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExtendedLocation(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.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes.CreateFrom); + } + 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.ContainerService.Models.Api20240402Preview.IExtendedLocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The complex type of the extended location. + [System.ComponentModel.TypeConverter(typeof(ExtendedLocationTypeConverter))] + public partial interface IExtendedLocation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.TypeConverter.cs new file mode 100644 index 000000000000..c28e273d96ab --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExtendedLocationTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IExtendedLocation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExtendedLocation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExtendedLocation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExtendedLocation.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.cs new file mode 100644 index 000000000000..ef286cfa8a5e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The complex type of the extended location. + public partial class ExtendedLocation : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal + { + + /// Backing field for property. + private string _name; + + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes? _type; + + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ExtendedLocation() + { + + } + } + /// The complex type of the extended location. + public partial interface IExtendedLocation : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes? Type { get; set; } + + } + /// The complex type of the extended location. + internal partial interface IExtendedLocationInternal + + { + /// The name of the extended location. + string Name { get; set; } + /// The type of the extended location. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.json.cs new file mode 100644 index 000000000000..526f52b7e22b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ExtendedLocation.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The complex type of the extended location. + public partial class ExtendedLocation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ExtendedLocation(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ExtendedLocation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.PowerShell.cs new file mode 100644 index 000000000000..a94ced706aab --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Available Guardrails Version + [System.ComponentModel.TypeConverter(typeof(GuardrailsAvailableVersionTypeConverter))] + public partial class GuardrailsAvailableVersion + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GuardrailsAvailableVersion(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GuardrailsAvailableVersion(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GuardrailsAvailableVersion(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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("IsDefaultVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).IsDefaultVersion = (bool?) content.GetValueForProperty("IsDefaultVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).IsDefaultVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Support")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).Support = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport?) content.GetValueForProperty("Support",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).Support, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GuardrailsAvailableVersion(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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("IsDefaultVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).IsDefaultVersion = (bool?) content.GetValueForProperty("IsDefaultVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).IsDefaultVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Support")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).Support = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport?) content.GetValueForProperty("Support",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal)this).Support, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Available Guardrails Version + [System.ComponentModel.TypeConverter(typeof(GuardrailsAvailableVersionTypeConverter))] + public partial interface IGuardrailsAvailableVersion + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.TypeConverter.cs new file mode 100644 index 000000000000..c2f24b4a5c10 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GuardrailsAvailableVersionTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GuardrailsAvailableVersion.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GuardrailsAvailableVersion.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GuardrailsAvailableVersion.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.cs new file mode 100644 index 000000000000..9d2b96d0138a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Available Guardrails Version + public partial class GuardrailsAvailableVersion : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? IsDefaultVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)Property).IsDefaultVersion; } + + /// Internal Acessors for IsDefaultVersion + bool? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal.IsDefaultVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)Property).IsDefaultVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)Property).IsDefaultVersion = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsProperties()); set { {_property = value;} } } + + /// Internal Acessors for Support + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionInternal.Support { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)Property).Support; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)Property).Support = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties _property; + + /// Whether the version is default or not and support info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsProperties()); set => this._property = value; } + + /// Whether the version is preview or stable. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport? Support { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)Property).Support; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public GuardrailsAvailableVersion() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Available Guardrails Version + public partial interface IGuardrailsAvailableVersion : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"isDefaultVersion", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDefaultVersion { get; } + /// Whether the version is preview or stable. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether the version is preview or stable.", + SerializedName = @"support", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport? Support { get; } + + } + /// Available Guardrails Version + internal partial interface IGuardrailsAvailableVersionInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal + { + bool? IsDefaultVersion { get; set; } + /// Whether the version is default or not and support info. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties Property { get; set; } + /// Whether the version is preview or stable. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport? Support { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.json.cs new file mode 100644 index 000000000000..c08b2287860b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersion.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Available Guardrails Version + public partial class GuardrailsAvailableVersion + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new GuardrailsAvailableVersion(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal GuardrailsAvailableVersion(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.PowerShell.cs new file mode 100644 index 000000000000..ec4c982e6cdf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Hold values properties, which is array of GuardrailsVersions + [System.ComponentModel.TypeConverter(typeof(GuardrailsAvailableVersionsListTypeConverter))] + public partial class GuardrailsAvailableVersionsList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GuardrailsAvailableVersionsList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GuardrailsAvailableVersionsList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GuardrailsAvailableVersionsList(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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal)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 GuardrailsAvailableVersionsList(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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Hold values properties, which is array of GuardrailsVersions + [System.ComponentModel.TypeConverter(typeof(GuardrailsAvailableVersionsListTypeConverter))] + public partial interface IGuardrailsAvailableVersionsList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.TypeConverter.cs new file mode 100644 index 000000000000..5f3880bb8eb4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GuardrailsAvailableVersionsListTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GuardrailsAvailableVersionsList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GuardrailsAvailableVersionsList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GuardrailsAvailableVersionsList.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.cs new file mode 100644 index 000000000000..f0164853c004 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Hold values properties, which is array of GuardrailsVersions + public partial class GuardrailsAvailableVersionsList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next Guardrails available version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion[] _value; + + /// Array of AKS supported Guardrails versions. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public GuardrailsAvailableVersionsList() + { + + } + } + /// Hold values properties, which is array of GuardrailsVersions + public partial interface IGuardrailsAvailableVersionsList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next Guardrails available version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next Guardrails available version.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Array of AKS supported Guardrails versions. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of AKS supported Guardrails versions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion[] Value { get; set; } + + } + /// Hold values properties, which is array of GuardrailsVersions + internal partial interface IGuardrailsAvailableVersionsListInternal + + { + /// The URL to get the next Guardrails available version. + string NextLink { get; set; } + /// Array of AKS supported Guardrails versions. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.json.cs new file mode 100644 index 000000000000..31fe4eba0301 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsList.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Hold values properties, which is array of GuardrailsVersions + public partial class GuardrailsAvailableVersionsList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new GuardrailsAvailableVersionsList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal GuardrailsAvailableVersionsList(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.GuardrailsAvailableVersion.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.PowerShell.cs new file mode 100644 index 000000000000..327279762dea --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.PowerShell.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Whether the version is default or not and support info. + [System.ComponentModel.TypeConverter(typeof(GuardrailsAvailableVersionsPropertiesTypeConverter))] + public partial class GuardrailsAvailableVersionsProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GuardrailsAvailableVersionsProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GuardrailsAvailableVersionsProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GuardrailsAvailableVersionsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsDefaultVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)this).IsDefaultVersion = (bool?) content.GetValueForProperty("IsDefaultVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)this).IsDefaultVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Support")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)this).Support = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport?) content.GetValueForProperty("Support",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)this).Support, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GuardrailsAvailableVersionsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsDefaultVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)this).IsDefaultVersion = (bool?) content.GetValueForProperty("IsDefaultVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)this).IsDefaultVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Support")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)this).Support = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport?) content.GetValueForProperty("Support",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal)this).Support, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Whether the version is default or not and support info. + [System.ComponentModel.TypeConverter(typeof(GuardrailsAvailableVersionsPropertiesTypeConverter))] + public partial interface IGuardrailsAvailableVersionsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.TypeConverter.cs new file mode 100644 index 000000000000..b7db674583c8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GuardrailsAvailableVersionsPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GuardrailsAvailableVersionsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GuardrailsAvailableVersionsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GuardrailsAvailableVersionsProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.cs new file mode 100644 index 000000000000..7a5a36742a94 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Whether the version is default or not and support info. + public partial class GuardrailsAvailableVersionsProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal + { + + /// Backing field for property. + private bool? _isDefaultVersion; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? IsDefaultVersion { get => this._isDefaultVersion; } + + /// Internal Acessors for IsDefaultVersion + bool? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal.IsDefaultVersion { get => this._isDefaultVersion; set { {_isDefaultVersion = value;} } } + + /// Internal Acessors for Support + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsPropertiesInternal.Support { get => this._support; set { {_support = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport? _support; + + /// Whether the version is preview or stable. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport? Support { get => this._support; } + + /// Creates an new instance. + public GuardrailsAvailableVersionsProperties() + { + + } + } + /// Whether the version is default or not and support info. + public partial interface IGuardrailsAvailableVersionsProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"isDefaultVersion", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDefaultVersion { get; } + /// Whether the version is preview or stable. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether the version is preview or stable.", + SerializedName = @"support", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport? Support { get; } + + } + /// Whether the version is default or not and support info. + internal partial interface IGuardrailsAvailableVersionsPropertiesInternal + + { + bool? IsDefaultVersion { get; set; } + /// Whether the version is preview or stable. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport? Support { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.json.cs new file mode 100644 index 000000000000..67f066b4aedb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/GuardrailsAvailableVersionsProperties.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Whether the version is default or not and support info. + public partial class GuardrailsAvailableVersionsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new GuardrailsAvailableVersionsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal GuardrailsAvailableVersionsProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_isDefaultVersion = If( json?.PropertyT("isDefaultVersion"), out var __jsonIsDefaultVersion) ? (bool?)__jsonIsDefaultVersion : IsDefaultVersion;} + {_support = If( json?.PropertyT("support"), out var __jsonSupport) ? (string)__jsonSupport : (string)Support;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isDefaultVersion ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._isDefaultVersion) : null, "isDefaultVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._support)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._support.ToString()) : null, "support" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.PowerShell.cs new file mode 100644 index 000000000000..cfba4badfa03 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Contains the IPTag associated with the object. + [System.ComponentModel.TypeConverter(typeof(IPTagTypeConverter))] + public partial class IPTag + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IPTag(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IPTag(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IPTag(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTagInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTagInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTagInternal)this).Tag = (string) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTagInternal)this).Tag, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IPTag(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTagInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTagInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTagInternal)this).Tag = (string) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTagInternal)this).Tag, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Contains the IPTag associated with the object. + [System.ComponentModel.TypeConverter(typeof(IPTagTypeConverter))] + public partial interface IIPTag + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.TypeConverter.cs new file mode 100644 index 000000000000..e00b3251e9a6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IPTagTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIPTag ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IPTag.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IPTag.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IPTag.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.cs new file mode 100644 index 000000000000..d3e7ee0ce4c5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Contains the IPTag associated with the object. + public partial class IPTag : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTagInternal + { + + /// Backing field for property. + private string _tag; + + /// The value of the IP tag associated with the public IP. Example: Internet. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Tag { get => this._tag; set => this._tag = value; } + + /// Backing field for property. + private string _type; + + /// The IP tag type. Example: RoutingPreference. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public IPTag() + { + + } + } + /// Contains the IPTag associated with the object. + public partial interface IIPTag : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The value of the IP tag associated with the public IP. Example: Internet. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The value of the IP tag associated with the public IP. Example: Internet.", + SerializedName = @"tag", + PossibleTypes = new [] { typeof(string) })] + string Tag { get; set; } + /// The IP tag type. Example: RoutingPreference. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IP tag type. Example: RoutingPreference.", + SerializedName = @"ipTagType", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// Contains the IPTag associated with the object. + internal partial interface IIPTagInternal + + { + /// The value of the IP tag associated with the public IP. Example: Internet. + string Tag { get; set; } + /// The IP tag type. Example: RoutingPreference. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.json.cs new file mode 100644 index 000000000000..e80f6491340b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IPTag.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Contains the IPTag associated with the object. + public partial class IPTag + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new IPTag(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal IPTag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("ipTagType"), out var __jsonIPTagType) ? (string)__jsonIPTagType : (string)Type;} + {_tag = If( json?.PropertyT("tag"), out var __jsonTag) ? (string)__jsonTag : (string)Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "ipTagType" ,container.Add ); + AddIf( null != (((object)this._tag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._tag.ToString()) : null, "tag" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.PowerShell.cs new file mode 100644 index 000000000000..d25ca0bbee1e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + /// + [System.ComponentModel.TypeConverter(typeof(IstioCertificateAuthorityTypeConverter))] + public partial class IstioCertificateAuthority + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IstioCertificateAuthority(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IstioCertificateAuthority(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IstioCertificateAuthority(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Plugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).Plugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("Plugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).Plugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginCertChainObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IstioCertificateAuthority(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Plugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).Plugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("Plugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).Plugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)this).PluginCertChainObjectName, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + [System.ComponentModel.TypeConverter(typeof(IstioCertificateAuthorityTypeConverter))] + public partial interface IIstioCertificateAuthority + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.TypeConverter.cs new file mode 100644 index 000000000000..f47c0e6f79c2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IstioCertificateAuthorityTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IstioCertificateAuthority.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IstioCertificateAuthority.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IstioCertificateAuthority.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.cs new file mode 100644 index 000000000000..2b1ce53a2356 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + /// + public partial class IstioCertificateAuthority : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal + { + + /// Internal Acessors for Plugin + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal.Plugin { get => (this._plugin = this._plugin ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthority()); set { {_plugin = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority _plugin; + + /// Plugin certificates information for Service Mesh. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority Plugin { get => (this._plugin = this._plugin ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthority()); set => this._plugin = value; } + + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertChainObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).CertChainObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).CertChainObjectName = value ?? null; } + + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).CertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).CertObjectName = value ?? null; } + + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).KeyObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).KeyObjectName = value ?? null; } + + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).KeyVaultId = value ?? null; } + + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginRootCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).RootCertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)Plugin).RootCertObjectName = value ?? null; } + + /// Creates an new instance. + public IstioCertificateAuthority() + { + + } + } + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + public partial interface IIstioCertificateAuthority : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate chain object name in Azure Key Vault.", + SerializedName = @"certChainObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate object name in Azure Key Vault.", + SerializedName = @"certObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate private key object name in Azure Key Vault.", + SerializedName = @"keyObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the Key Vault.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Root certificate object name in Azure Key Vault.", + SerializedName = @"rootCertObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginRootCertObjectName { get; set; } + + } + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + internal partial interface IIstioCertificateAuthorityInternal + + { + /// Plugin certificates information for Service Mesh. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority Plugin { get; set; } + /// Certificate chain object name in Azure Key Vault. + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + string PluginRootCertObjectName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.json.cs new file mode 100644 index 000000000000..44e295594764 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioCertificateAuthority.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + /// + public partial class IstioCertificateAuthority + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new IstioCertificateAuthority(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal IstioCertificateAuthority(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_plugin = If( json?.PropertyT("plugin"), out var __jsonPlugin) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthority.FromJson(__jsonPlugin) : Plugin;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._plugin ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._plugin.ToJson(null,serializationMode) : null, "plugin" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.PowerShell.cs new file mode 100644 index 000000000000..e292477cacb3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Istio components configuration. + [System.ComponentModel.TypeConverter(typeof(IstioComponentsTypeConverter))] + public partial class IstioComponents + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IstioComponents(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IstioComponents(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IstioComponents(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)this).IngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("IngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)this).IngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("EgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)this).EgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("EgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)this).EgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IstioComponents(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)this).IngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("IngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)this).IngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("EgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)this).EgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("EgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)this).EgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Istio components configuration. + [System.ComponentModel.TypeConverter(typeof(IstioComponentsTypeConverter))] + public partial interface IIstioComponents + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.TypeConverter.cs new file mode 100644 index 000000000000..583111f9f9a7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IstioComponentsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIstioComponents ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IstioComponents.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IstioComponents.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IstioComponents.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.cs new file mode 100644 index 000000000000..a2df7800496d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Istio components configuration. + public partial class IstioComponents : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] _egressGateway; + + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] EgressGateway { get => this._egressGateway; set => this._egressGateway = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] _ingressGateway; + + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] IngressGateway { get => this._ingressGateway; set => this._ingressGateway = value; } + + /// Creates an new instance. + public IstioComponents() + { + + } + } + /// Istio components configuration. + public partial interface IIstioComponents : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio egress gateways.", + SerializedName = @"egressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] EgressGateway { get; set; } + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio ingress gateways.", + SerializedName = @"ingressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] IngressGateway { get; set; } + + } + /// Istio components configuration. + internal partial interface IIstioComponentsInternal + + { + /// Istio egress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] EgressGateway { get; set; } + /// Istio ingress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] IngressGateway { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.json.cs new file mode 100644 index 000000000000..25f4dd8182a3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioComponents.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Istio components configuration. + public partial class IstioComponents + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new IstioComponents(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal IstioComponents(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_ingressGateway = If( json?.PropertyT("ingressGateways"), out var __jsonIngressGateways) ? If( __jsonIngressGateways as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIstioIngressGateway) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGateway.FromJson(__u) )) ))() : null : IngressGateway;} + {_egressGateway = If( json?.PropertyT("egressGateways"), out var __jsonEgressGateways) ? If( __jsonEgressGateways as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIstioEgressGateway) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGateway.FromJson(__p) )) ))() : null : EgressGateway;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._ingressGateway) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._ingressGateway ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("ingressGateways",__w); + } + if (null != this._egressGateway) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._egressGateway ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("egressGateways",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.PowerShell.cs new file mode 100644 index 000000000000..27ee61acb32d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Istio egress gateway configuration. + [System.ComponentModel.TypeConverter(typeof(IstioEgressGatewayTypeConverter))] + public partial class IstioEgressGateway + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IstioEgressGateway(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IstioEgressGateway(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IstioEgressGateway(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGatewayInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGatewayInternal)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 IstioEgressGateway(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGatewayInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGatewayInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Istio egress gateway configuration. + [System.ComponentModel.TypeConverter(typeof(IstioEgressGatewayTypeConverter))] + public partial interface IIstioEgressGateway + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.TypeConverter.cs new file mode 100644 index 000000000000..4f6b61f18f61 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IstioEgressGatewayTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIstioEgressGateway ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IstioEgressGateway.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IstioEgressGateway.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IstioEgressGateway.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.cs new file mode 100644 index 000000000000..2d4948c04e7e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Istio egress gateway configuration. + public partial class IstioEgressGateway : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGatewayInternal + { + + /// Backing field for property. + private bool _enabled; + + /// Whether to enable the egress gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// Creates an new instance. + public IstioEgressGateway() + { + + } + } + /// Istio egress gateway configuration. + public partial interface IIstioEgressGateway : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable the egress gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether to enable the egress gateway.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + + } + /// Istio egress gateway configuration. + internal partial interface IIstioEgressGatewayInternal + + { + /// Whether to enable the egress gateway. + bool Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.json.cs new file mode 100644 index 000000000000..32b2bdaa85a3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioEgressGateway.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Istio egress gateway configuration. + public partial class IstioEgressGateway + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new IstioEgressGateway(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal IstioEgressGateway(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.PowerShell.cs new file mode 100644 index 000000000000..e77bbdd625d2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Istio ingress gateway configuration. For now, we support up to one external ingress gateway named `aks-istio-ingressgateway-external` + /// and one internal ingress gateway named `aks-istio-ingressgateway-internal`. + /// + [System.ComponentModel.TypeConverter(typeof(IstioIngressGatewayTypeConverter))] + public partial class IstioIngressGateway + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IstioIngressGateway(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IstioIngressGateway(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IstioIngressGateway(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGatewayInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGatewayInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode.CreateFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGatewayInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGatewayInternal)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 IstioIngressGateway(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGatewayInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGatewayInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode.CreateFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGatewayInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGatewayInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Istio ingress gateway configuration. For now, we support up to one external ingress gateway named `aks-istio-ingressgateway-external` + /// and one internal ingress gateway named `aks-istio-ingressgateway-internal`. + [System.ComponentModel.TypeConverter(typeof(IstioIngressGatewayTypeConverter))] + public partial interface IIstioIngressGateway + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.TypeConverter.cs new file mode 100644 index 000000000000..f99e8164d21c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IstioIngressGatewayTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIstioIngressGateway ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IstioIngressGateway.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IstioIngressGateway.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IstioIngressGateway.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.cs new file mode 100644 index 000000000000..f60ef3f2f282 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Istio ingress gateway configuration. For now, we support up to one external ingress gateway named `aks-istio-ingressgateway-external` + /// and one internal ingress gateway named `aks-istio-ingressgateway-internal`. + /// + public partial class IstioIngressGateway : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGatewayInternal + { + + /// Backing field for property. + private bool _enabled; + + /// Whether to enable the ingress gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode _mode; + + /// Mode of an ingress gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode Mode { get => this._mode; set => this._mode = value; } + + /// Creates an new instance. + public IstioIngressGateway() + { + + } + } + /// Istio ingress gateway configuration. For now, we support up to one external ingress gateway named `aks-istio-ingressgateway-external` + /// and one internal ingress gateway named `aks-istio-ingressgateway-internal`. + public partial interface IIstioIngressGateway : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable the ingress gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether to enable the ingress gateway.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + /// Mode of an ingress gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Mode of an ingress gateway.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode Mode { get; set; } + + } + /// Istio ingress gateway configuration. For now, we support up to one external ingress gateway named `aks-istio-ingressgateway-external` + /// and one internal ingress gateway named `aks-istio-ingressgateway-internal`. + internal partial interface IIstioIngressGatewayInternal + + { + /// Whether to enable the ingress gateway. + bool Enabled { get; set; } + /// Mode of an ingress gateway. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode Mode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.json.cs new file mode 100644 index 000000000000..a3009f27c3ea --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioIngressGateway.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Istio ingress gateway configuration. For now, we support up to one external ingress gateway named `aks-istio-ingressgateway-external` + /// and one internal ingress gateway named `aks-istio-ingressgateway-internal`. + /// + public partial class IstioIngressGateway + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new IstioIngressGateway(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal IstioIngressGateway(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.PowerShell.cs new file mode 100644 index 000000000000..f34c652e394d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Plugin certificates information for Service Mesh. + [System.ComponentModel.TypeConverter(typeof(IstioPluginCertificateAuthorityTypeConverter))] + public partial class IstioPluginCertificateAuthority + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IstioPluginCertificateAuthority(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IstioPluginCertificateAuthority(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IstioPluginCertificateAuthority(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).KeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("CertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).CertObjectName = (string) content.GetValueForProperty("CertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).CertObjectName, global::System.Convert.ToString); + } + if (content.Contains("KeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).KeyObjectName = (string) content.GetValueForProperty("KeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).KeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("RootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).RootCertObjectName = (string) content.GetValueForProperty("RootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).RootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("CertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).CertChainObjectName = (string) content.GetValueForProperty("CertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).CertChainObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IstioPluginCertificateAuthority(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).KeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("CertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).CertObjectName = (string) content.GetValueForProperty("CertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).CertObjectName, global::System.Convert.ToString); + } + if (content.Contains("KeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).KeyObjectName = (string) content.GetValueForProperty("KeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).KeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("RootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).RootCertObjectName = (string) content.GetValueForProperty("RootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).RootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("CertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).CertChainObjectName = (string) content.GetValueForProperty("CertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal)this).CertChainObjectName, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Plugin certificates information for Service Mesh. + [System.ComponentModel.TypeConverter(typeof(IstioPluginCertificateAuthorityTypeConverter))] + public partial interface IIstioPluginCertificateAuthority + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.TypeConverter.cs new file mode 100644 index 000000000000..23d9f94cd3e8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IstioPluginCertificateAuthorityTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IstioPluginCertificateAuthority.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IstioPluginCertificateAuthority.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IstioPluginCertificateAuthority.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.cs new file mode 100644 index 000000000000..d44b946b282d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Plugin certificates information for Service Mesh. + public partial class IstioPluginCertificateAuthority : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthorityInternal + { + + /// Backing field for property. + private string _certChainObjectName; + + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string CertChainObjectName { get => this._certChainObjectName; set => this._certChainObjectName = value; } + + /// Backing field for property. + private string _certObjectName; + + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string CertObjectName { get => this._certObjectName; set => this._certObjectName = value; } + + /// Backing field for property. + private string _keyObjectName; + + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KeyObjectName { get => this._keyObjectName; set => this._keyObjectName = value; } + + /// Backing field for property. + private string _keyVaultId; + + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KeyVaultId { get => this._keyVaultId; set => this._keyVaultId = value; } + + /// Backing field for property. + private string _rootCertObjectName; + + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string RootCertObjectName { get => this._rootCertObjectName; set => this._rootCertObjectName = value; } + + /// Creates an new instance. + public IstioPluginCertificateAuthority() + { + + } + } + /// Plugin certificates information for Service Mesh. + public partial interface IIstioPluginCertificateAuthority : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate chain object name in Azure Key Vault.", + SerializedName = @"certChainObjectName", + PossibleTypes = new [] { typeof(string) })] + string CertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate object name in Azure Key Vault.", + SerializedName = @"certObjectName", + PossibleTypes = new [] { typeof(string) })] + string CertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate private key object name in Azure Key Vault.", + SerializedName = @"keyObjectName", + PossibleTypes = new [] { typeof(string) })] + string KeyObjectName { get; set; } + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the Key Vault.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Root certificate object name in Azure Key Vault.", + SerializedName = @"rootCertObjectName", + PossibleTypes = new [] { typeof(string) })] + string RootCertObjectName { get; set; } + + } + /// Plugin certificates information for Service Mesh. + internal partial interface IIstioPluginCertificateAuthorityInternal + + { + /// Certificate chain object name in Azure Key Vault. + string CertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + string CertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + string KeyObjectName { get; set; } + /// The resource ID of the Key Vault. + string KeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + string RootCertObjectName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.json.cs new file mode 100644 index 000000000000..bef68f2b6cd4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioPluginCertificateAuthority.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Plugin certificates information for Service Mesh. + public partial class IstioPluginCertificateAuthority + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new IstioPluginCertificateAuthority(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal IstioPluginCertificateAuthority(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)KeyVaultId;} + {_certObjectName = If( json?.PropertyT("certObjectName"), out var __jsonCertObjectName) ? (string)__jsonCertObjectName : (string)CertObjectName;} + {_keyObjectName = If( json?.PropertyT("keyObjectName"), out var __jsonKeyObjectName) ? (string)__jsonKeyObjectName : (string)KeyObjectName;} + {_rootCertObjectName = If( json?.PropertyT("rootCertObjectName"), out var __jsonRootCertObjectName) ? (string)__jsonRootCertObjectName : (string)RootCertObjectName;} + {_certChainObjectName = If( json?.PropertyT("certChainObjectName"), out var __jsonCertChainObjectName) ? (string)__jsonCertChainObjectName : (string)CertChainObjectName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyVaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._keyVaultId.ToString()) : null, "keyVaultId" ,container.Add ); + AddIf( null != (((object)this._certObjectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._certObjectName.ToString()) : null, "certObjectName" ,container.Add ); + AddIf( null != (((object)this._keyObjectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._keyObjectName.ToString()) : null, "keyObjectName" ,container.Add ); + AddIf( null != (((object)this._rootCertObjectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._rootCertObjectName.ToString()) : null, "rootCertObjectName" ,container.Add ); + AddIf( null != (((object)this._certChainObjectName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._certChainObjectName.ToString()) : null, "certChainObjectName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.PowerShell.cs new file mode 100644 index 000000000000..0a5b44650f84 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.PowerShell.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Istio service mesh configuration. + [System.ComponentModel.TypeConverter(typeof(IstioServiceMeshTypeConverter))] + public partial class IstioServiceMesh + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IstioServiceMesh(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IstioServiceMesh(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IstioServiceMesh(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Component")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).Component = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents) content.GetValueForProperty("Component",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).Component, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponentsTypeConverter.ConvertFrom); + } + if (content.Contains("CertificateAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).CertificateAuthority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority) content.GetValueForProperty("CertificateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).CertificateAuthority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).Revision = (string[]) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).Revision, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ComponentIngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).ComponentIngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("ComponentIngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).ComponentIngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("ComponentEgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).ComponentEgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("ComponentEgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).ComponentEgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("CertificateAuthorityPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).CertificateAuthorityPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("CertificateAuthorityPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).CertificateAuthorityPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginCertChainObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IstioServiceMesh(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Component")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).Component = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents) content.GetValueForProperty("Component",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).Component, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponentsTypeConverter.ConvertFrom); + } + if (content.Contains("CertificateAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).CertificateAuthority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority) content.GetValueForProperty("CertificateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).CertificateAuthority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).Revision = (string[]) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).Revision, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ComponentIngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).ComponentIngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("ComponentIngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).ComponentIngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("ComponentEgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).ComponentEgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("ComponentEgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).ComponentEgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("CertificateAuthorityPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).CertificateAuthorityPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("CertificateAuthorityPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).CertificateAuthorityPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)this).PluginCertChainObjectName, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Istio service mesh configuration. + [System.ComponentModel.TypeConverter(typeof(IstioServiceMeshTypeConverter))] + public partial interface IIstioServiceMesh + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.TypeConverter.cs new file mode 100644 index 000000000000..912598b33e8a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IstioServiceMeshTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IIstioServiceMesh ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IstioServiceMesh.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IstioServiceMesh.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IstioServiceMesh.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.cs new file mode 100644 index 000000000000..51a6dd3994bb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Istio service mesh configuration. + public partial class IstioServiceMesh : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority _certificateAuthority; + + /// + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority CertificateAuthority { get => (this._certificateAuthority = this._certificateAuthority ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthority()); set => this._certificateAuthority = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents _component; + + /// Istio components configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents Component { get => (this._component = this._component ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponents()); set => this._component = value; } + + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)Component).EgressGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)Component).EgressGateway = value ?? null /* arrayOf */; } + + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)Component).IngressGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponentsInternal)Component).IngressGateway = value ?? null /* arrayOf */; } + + /// Internal Acessors for CertificateAuthority + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal.CertificateAuthority { get => (this._certificateAuthority = this._certificateAuthority ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthority()); set { {_certificateAuthority = value;} } } + + /// Internal Acessors for CertificateAuthorityPlugin + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal.CertificateAuthorityPlugin { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).Plugin; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).Plugin = value; } + + /// Internal Acessors for Component + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal.Component { get => (this._component = this._component ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponents()); set { {_component = value;} } } + + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertChainObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginCertChainObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginCertChainObjectName = value ?? null; } + + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginCertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginCertObjectName = value ?? null; } + + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginKeyObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginKeyObjectName = value ?? null; } + + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginKeyVaultId = value ?? null; } + + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginRootCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginRootCertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthorityInternal)CertificateAuthority).PluginRootCertObjectName = value ?? null; } + + /// Backing field for property. + private string[] _revision; + + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Revision { get => this._revision; set => this._revision = value; } + + /// Creates an new instance. + public IstioServiceMesh() + { + + } + } + /// Istio service mesh configuration. + public partial interface IIstioServiceMesh : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio egress gateways.", + SerializedName = @"egressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get; set; } + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio ingress gateways.", + SerializedName = @"ingressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get; set; } + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate chain object name in Azure Key Vault.", + SerializedName = @"certChainObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate object name in Azure Key Vault.", + SerializedName = @"certObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate private key object name in Azure Key Vault.", + SerializedName = @"keyObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the Key Vault.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Root certificate object name in Azure Key Vault.", + SerializedName = @"rootCertObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginRootCertObjectName { get; set; } + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade", + SerializedName = @"revisions", + PossibleTypes = new [] { typeof(string) })] + string[] Revision { get; set; } + + } + /// Istio service mesh configuration. + internal partial interface IIstioServiceMeshInternal + + { + /// + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority CertificateAuthority { get; set; } + /// Plugin certificates information for Service Mesh. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority CertificateAuthorityPlugin { get; set; } + /// Istio components configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents Component { get; set; } + /// Istio egress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get; set; } + /// Istio ingress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get; set; } + /// Certificate chain object name in Azure Key Vault. + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + string PluginRootCertObjectName { get; set; } + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + string[] Revision { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.json.cs new file mode 100644 index 000000000000..3ac93fc3a4f7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/IstioServiceMesh.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Istio service mesh configuration. + public partial class IstioServiceMesh + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new IstioServiceMesh(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal IstioServiceMesh(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_component = If( json?.PropertyT("components"), out var __jsonComponents) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponents.FromJson(__jsonComponents) : Component;} + {_certificateAuthority = If( json?.PropertyT("certificateAuthority"), out var __jsonCertificateAuthority) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthority.FromJson(__jsonCertificateAuthority) : CertificateAuthority;} + {_revision = If( json?.PropertyT("revisions"), out var __jsonRevisions) ? If( __jsonRevisions as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Revision;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._component ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._component.ToJson(null,serializationMode) : null, "components" ,container.Add ); + AddIf( null != this._certificateAuthority ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._certificateAuthority.ToJson(null,serializationMode) : null, "certificateAuthority" ,container.Add ); + if (null != this._revision) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._revision ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("revisions",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.PowerShell.cs new file mode 100644 index 000000000000..40a39eb6a8f0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + /// + [System.ComponentModel.TypeConverter(typeof(KubeletConfigTypeConverter))] + public partial class KubeletConfig + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubeletConfig(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubeletConfig(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubeletConfig(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CpuManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuManagerPolicy = (string) content.GetValueForProperty("CpuManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("CpuCfsQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuCfsQuota = (bool?) content.GetValueForProperty("CpuCfsQuota",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuCfsQuota, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CpuCfsQuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuCfsQuotaPeriod = (string) content.GetValueForProperty("CpuCfsQuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuCfsQuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("ImageGcHighThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ImageGcHighThreshold = (int?) content.GetValueForProperty("ImageGcHighThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ImageGcHighThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImageGcLowThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ImageGcLowThreshold = (int?) content.GetValueForProperty("ImageGcLowThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ImageGcLowThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TopologyManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).TopologyManagerPolicy = (string) content.GetValueForProperty("TopologyManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).TopologyManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("AllowedUnsafeSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).AllowedUnsafeSysctl = (string[]) content.GetValueForProperty("AllowedUnsafeSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).AllowedUnsafeSysctl, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FailSwapOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).FailSwapOn = (bool?) content.GetValueForProperty("FailSwapOn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).FailSwapOn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerLogMaxSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ContainerLogMaxSizeMb = (int?) content.GetValueForProperty("ContainerLogMaxSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ContainerLogMaxSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ContainerLogMaxFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ContainerLogMaxFile = (int?) content.GetValueForProperty("ContainerLogMaxFile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ContainerLogMaxFile, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PodMaxPid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).PodMaxPid = (int?) content.GetValueForProperty("PodMaxPid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).PodMaxPid, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubeletConfig(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CpuManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuManagerPolicy = (string) content.GetValueForProperty("CpuManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("CpuCfsQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuCfsQuota = (bool?) content.GetValueForProperty("CpuCfsQuota",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuCfsQuota, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CpuCfsQuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuCfsQuotaPeriod = (string) content.GetValueForProperty("CpuCfsQuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).CpuCfsQuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("ImageGcHighThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ImageGcHighThreshold = (int?) content.GetValueForProperty("ImageGcHighThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ImageGcHighThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImageGcLowThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ImageGcLowThreshold = (int?) content.GetValueForProperty("ImageGcLowThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ImageGcLowThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("TopologyManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).TopologyManagerPolicy = (string) content.GetValueForProperty("TopologyManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).TopologyManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("AllowedUnsafeSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).AllowedUnsafeSysctl = (string[]) content.GetValueForProperty("AllowedUnsafeSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).AllowedUnsafeSysctl, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FailSwapOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).FailSwapOn = (bool?) content.GetValueForProperty("FailSwapOn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).FailSwapOn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerLogMaxSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ContainerLogMaxSizeMb = (int?) content.GetValueForProperty("ContainerLogMaxSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ContainerLogMaxSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ContainerLogMaxFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ContainerLogMaxFile = (int?) content.GetValueForProperty("ContainerLogMaxFile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).ContainerLogMaxFile, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PodMaxPid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).PodMaxPid = (int?) content.GetValueForProperty("PodMaxPid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)this).PodMaxPid, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + [System.ComponentModel.TypeConverter(typeof(KubeletConfigTypeConverter))] + public partial interface IKubeletConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.TypeConverter.cs new file mode 100644 index 000000000000..e82bead1f993 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubeletConfigTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IKubeletConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubeletConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubeletConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubeletConfig.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.cs new file mode 100644 index 000000000000..fa54ed73d288 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + /// + public partial class KubeletConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal + { + + /// Backing field for property. + private string[] _allowedUnsafeSysctl; + + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] AllowedUnsafeSysctl { get => this._allowedUnsafeSysctl; set => this._allowedUnsafeSysctl = value; } + + /// Backing field for property. + private int? _containerLogMaxFile; + + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? ContainerLogMaxFile { get => this._containerLogMaxFile; set => this._containerLogMaxFile = value; } + + /// Backing field for property. + private int? _containerLogMaxSizeMb; + + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? ContainerLogMaxSizeMb { get => this._containerLogMaxSizeMb; set => this._containerLogMaxSizeMb = value; } + + /// Backing field for property. + private bool? _cpuCfsQuota; + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? CpuCfsQuota { get => this._cpuCfsQuota; set => this._cpuCfsQuota = value; } + + /// Backing field for property. + private string _cpuCfsQuotaPeriod; + + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string CpuCfsQuotaPeriod { get => this._cpuCfsQuotaPeriod; set => this._cpuCfsQuotaPeriod = value; } + + /// Backing field for property. + private string _cpuManagerPolicy; + + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string CpuManagerPolicy { get => this._cpuManagerPolicy; set => this._cpuManagerPolicy = value; } + + /// Backing field for property. + private bool? _failSwapOn; + + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? FailSwapOn { get => this._failSwapOn; set => this._failSwapOn = value; } + + /// Backing field for property. + private int? _imageGcHighThreshold; + + /// To disable image garbage collection, set to 100. The default is 85% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? ImageGcHighThreshold { get => this._imageGcHighThreshold; set => this._imageGcHighThreshold = value; } + + /// Backing field for property. + private int? _imageGcLowThreshold; + + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? ImageGcLowThreshold { get => this._imageGcLowThreshold; set => this._imageGcLowThreshold = value; } + + /// Backing field for property. + private int? _podMaxPid; + + /// The maximum number of processes per pod. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? PodMaxPid { get => this._podMaxPid; set => this._podMaxPid = value; } + + /// Backing field for property. + private string _topologyManagerPolicy; + + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string TopologyManagerPolicy { get => this._topologyManagerPolicy; set => this._topologyManagerPolicy = value; } + + /// Creates an new instance. + public KubeletConfig() + { + + } + } + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + public partial interface IKubeletConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`).", + SerializedName = @"allowedUnsafeSysctls", + PossibleTypes = new [] { typeof(string) })] + string[] AllowedUnsafeSysctl { get; set; } + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of container log files that can be present for a container. The number must be ≥ 2.", + SerializedName = @"containerLogMaxFiles", + PossibleTypes = new [] { typeof(int) })] + int? ContainerLogMaxFile { get; set; } + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size (e.g. 10Mi) of container log file before it is rotated.", + SerializedName = @"containerLogMaxSizeMB", + PossibleTypes = new [] { typeof(int) })] + int? ContainerLogMaxSizeMb { get; set; } + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"cpuCfsQuota", + PossibleTypes = new [] { typeof(bool) })] + bool? CpuCfsQuota { get; set; } + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'.", + SerializedName = @"cpuCfsQuotaPeriod", + PossibleTypes = new [] { typeof(string) })] + string CpuCfsQuotaPeriod { get; set; } + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'.", + SerializedName = @"cpuManagerPolicy", + PossibleTypes = new [] { typeof(string) })] + string CpuManagerPolicy { get; set; } + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true it will make the Kubelet fail to start if swap is enabled on the node.", + SerializedName = @"failSwapOn", + PossibleTypes = new [] { typeof(bool) })] + bool? FailSwapOn { get; set; } + /// To disable image garbage collection, set to 100. The default is 85% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To disable image garbage collection, set to 100. The default is 85%", + SerializedName = @"imageGcHighThreshold", + PossibleTypes = new [] { typeof(int) })] + int? ImageGcHighThreshold { get; set; } + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be set higher than imageGcHighThreshold. The default is 80%", + SerializedName = @"imageGcLowThreshold", + PossibleTypes = new [] { typeof(int) })] + int? ImageGcLowThreshold { get; set; } + /// The maximum number of processes per pod. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of processes per pod.", + SerializedName = @"podMaxPids", + PossibleTypes = new [] { typeof(int) })] + int? PodMaxPid { get; set; } + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'.", + SerializedName = @"topologyManagerPolicy", + PossibleTypes = new [] { typeof(string) })] + string TopologyManagerPolicy { get; set; } + + } + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + internal partial interface IKubeletConfigInternal + + { + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + string[] AllowedUnsafeSysctl { get; set; } + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + int? ContainerLogMaxFile { get; set; } + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + int? ContainerLogMaxSizeMb { get; set; } + /// The default is true. + bool? CpuCfsQuota { get; set; } + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + string CpuCfsQuotaPeriod { get; set; } + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + string CpuManagerPolicy { get; set; } + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + bool? FailSwapOn { get; set; } + /// To disable image garbage collection, set to 100. The default is 85% + int? ImageGcHighThreshold { get; set; } + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + int? ImageGcLowThreshold { get; set; } + /// The maximum number of processes per pod. + int? PodMaxPid { get; set; } + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + string TopologyManagerPolicy { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.json.cs new file mode 100644 index 000000000000..9a55e0879119 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubeletConfig.json.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + /// + public partial class KubeletConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new KubeletConfig(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal KubeletConfig(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_cpuManagerPolicy = If( json?.PropertyT("cpuManagerPolicy"), out var __jsonCpuManagerPolicy) ? (string)__jsonCpuManagerPolicy : (string)CpuManagerPolicy;} + {_cpuCfsQuota = If( json?.PropertyT("cpuCfsQuota"), out var __jsonCpuCfsQuota) ? (bool?)__jsonCpuCfsQuota : CpuCfsQuota;} + {_cpuCfsQuotaPeriod = If( json?.PropertyT("cpuCfsQuotaPeriod"), out var __jsonCpuCfsQuotaPeriod) ? (string)__jsonCpuCfsQuotaPeriod : (string)CpuCfsQuotaPeriod;} + {_imageGcHighThreshold = If( json?.PropertyT("imageGcHighThreshold"), out var __jsonImageGcHighThreshold) ? (int?)__jsonImageGcHighThreshold : ImageGcHighThreshold;} + {_imageGcLowThreshold = If( json?.PropertyT("imageGcLowThreshold"), out var __jsonImageGcLowThreshold) ? (int?)__jsonImageGcLowThreshold : ImageGcLowThreshold;} + {_topologyManagerPolicy = If( json?.PropertyT("topologyManagerPolicy"), out var __jsonTopologyManagerPolicy) ? (string)__jsonTopologyManagerPolicy : (string)TopologyManagerPolicy;} + {_allowedUnsafeSysctl = If( json?.PropertyT("allowedUnsafeSysctls"), out var __jsonAllowedUnsafeSysctls) ? If( __jsonAllowedUnsafeSysctls as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AllowedUnsafeSysctl;} + {_failSwapOn = If( json?.PropertyT("failSwapOn"), out var __jsonFailSwapOn) ? (bool?)__jsonFailSwapOn : FailSwapOn;} + {_containerLogMaxSizeMb = If( json?.PropertyT("containerLogMaxSizeMB"), out var __jsonContainerLogMaxSizeMb) ? (int?)__jsonContainerLogMaxSizeMb : ContainerLogMaxSizeMb;} + {_containerLogMaxFile = If( json?.PropertyT("containerLogMaxFiles"), out var __jsonContainerLogMaxFiles) ? (int?)__jsonContainerLogMaxFiles : ContainerLogMaxFile;} + {_podMaxPid = If( json?.PropertyT("podMaxPids"), out var __jsonPodMaxPids) ? (int?)__jsonPodMaxPids : PodMaxPid;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._cpuManagerPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._cpuManagerPolicy.ToString()) : null, "cpuManagerPolicy" ,container.Add ); + AddIf( null != this._cpuCfsQuota ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._cpuCfsQuota) : null, "cpuCfsQuota" ,container.Add ); + AddIf( null != (((object)this._cpuCfsQuotaPeriod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._cpuCfsQuotaPeriod.ToString()) : null, "cpuCfsQuotaPeriod" ,container.Add ); + AddIf( null != this._imageGcHighThreshold ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._imageGcHighThreshold) : null, "imageGcHighThreshold" ,container.Add ); + AddIf( null != this._imageGcLowThreshold ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._imageGcLowThreshold) : null, "imageGcLowThreshold" ,container.Add ); + AddIf( null != (((object)this._topologyManagerPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._topologyManagerPolicy.ToString()) : null, "topologyManagerPolicy" ,container.Add ); + if (null != this._allowedUnsafeSysctl) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._allowedUnsafeSysctl ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("allowedUnsafeSysctls",__w); + } + AddIf( null != this._failSwapOn ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._failSwapOn) : null, "failSwapOn" ,container.Add ); + AddIf( null != this._containerLogMaxSizeMb ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._containerLogMaxSizeMb) : null, "containerLogMaxSizeMB" ,container.Add ); + AddIf( null != this._containerLogMaxFile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._containerLogMaxFile) : null, "containerLogMaxFiles" ,container.Add ); + AddIf( null != this._podMaxPid ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._podMaxPid) : null, "podMaxPids" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.PowerShell.cs new file mode 100644 index 000000000000..28a9fd95fc5d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Kubernetes patch version profile + [System.ComponentModel.TypeConverter(typeof(KubernetesPatchVersionTypeConverter))] + public partial class KubernetesPatchVersion + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesPatchVersion(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesPatchVersion(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesPatchVersion(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersionInternal)this).Upgrade = (string[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersionInternal)this).Upgrade, __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 KubernetesPatchVersion(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersionInternal)this).Upgrade = (string[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersionInternal)this).Upgrade, __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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes patch version profile + [System.ComponentModel.TypeConverter(typeof(KubernetesPatchVersionTypeConverter))] + public partial interface IKubernetesPatchVersion + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.TypeConverter.cs new file mode 100644 index 000000000000..6917bbceca17 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesPatchVersionTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesPatchVersion.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesPatchVersion.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesPatchVersion.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.cs new file mode 100644 index 000000000000..290a830493ea --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Kubernetes patch version profile + public partial class KubernetesPatchVersion : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersionInternal + { + + /// Backing field for property. + private string[] _upgrade; + + /// Possible upgrade path for given patch version + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Upgrade { get => this._upgrade; set => this._upgrade = value; } + + /// Creates an new instance. + public KubernetesPatchVersion() + { + + } + } + /// Kubernetes patch version profile + public partial interface IKubernetesPatchVersion : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Possible upgrade path for given patch version + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Possible upgrade path for given patch version", + SerializedName = @"upgrades", + PossibleTypes = new [] { typeof(string) })] + string[] Upgrade { get; set; } + + } + /// Kubernetes patch version profile + internal partial interface IKubernetesPatchVersionInternal + + { + /// Possible upgrade path for given patch version + string[] Upgrade { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.json.cs new file mode 100644 index 000000000000..d6782e2e3676 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesPatchVersion.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Kubernetes patch version profile + public partial class KubernetesPatchVersion + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new KubernetesPatchVersion(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesPatchVersion(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_upgrade = If( json?.PropertyT("upgrades"), out var __jsonUpgrades) ? If( __jsonUpgrades as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Upgrade;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._upgrade) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._upgrade ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("upgrades",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.PowerShell.cs new file mode 100644 index 000000000000..072289691a0e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Kubernetes version profile for given major.minor release. + [System.ComponentModel.TypeConverter(typeof(KubernetesVersionTypeConverter))] + public partial class KubernetesVersion + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesVersion(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesVersion(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesVersion(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).Capability, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionCapabilitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("IsDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).IsDefault = (bool?) content.GetValueForProperty("IsDefault",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).IsDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).IsPreview = (bool?) content.GetValueForProperty("IsPreview",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).IsPreview, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PatchVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).PatchVersion = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions) content.GetValueForProperty("PatchVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).PatchVersion, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionPatchVersionsTypeConverter.ConvertFrom); + } + if (content.Contains("CapabilitySupportPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).CapabilitySupportPlan = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[]) content.GetValueForProperty("CapabilitySupportPlan",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).CapabilitySupportPlan, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan.CreateFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesVersion(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).Capability, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionCapabilitiesTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("IsDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).IsDefault = (bool?) content.GetValueForProperty("IsDefault",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).IsDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).IsPreview = (bool?) content.GetValueForProperty("IsPreview",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).IsPreview, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PatchVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).PatchVersion = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions) content.GetValueForProperty("PatchVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).PatchVersion, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionPatchVersionsTypeConverter.ConvertFrom); + } + if (content.Contains("CapabilitySupportPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).CapabilitySupportPlan = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[]) content.GetValueForProperty("CapabilitySupportPlan",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal)this).CapabilitySupportPlan, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kubernetes version profile for given major.minor release. + [System.ComponentModel.TypeConverter(typeof(KubernetesVersionTypeConverter))] + public partial interface IKubernetesVersion + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.TypeConverter.cs new file mode 100644 index 000000000000..4fefedf03e1a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesVersionTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IKubernetesVersion ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesVersion.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesVersion.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesVersion.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.cs new file mode 100644 index 000000000000..61d83b70f815 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Kubernetes version profile for given major.minor release. + public partial class KubernetesVersion : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities _capability; + + /// Capabilities on this Kubernetes version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities Capability { get => (this._capability = this._capability ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionCapabilities()); set => this._capability = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[] CapabilitySupportPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilitiesInternal)Capability).SupportPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilitiesInternal)Capability).SupportPlan = value ?? null /* arrayOf */; } + + /// Backing field for property. + private bool? _isDefault; + + /// Whether this version is default. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? IsDefault { get => this._isDefault; set => this._isDefault = value; } + + /// Backing field for property. + private bool? _isPreview; + + /// Whether this version is in preview mode. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? IsPreview { get => this._isPreview; set => this._isPreview = value; } + + /// Internal Acessors for Capability + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionInternal.Capability { get => (this._capability = this._capability ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionCapabilities()); set { {_capability = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions _patchVersion; + + /// Patch versions of Kubernetes release + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions PatchVersion { get => (this._patchVersion = this._patchVersion ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionPatchVersions()); set => this._patchVersion = value; } + + /// Backing field for property. + private string _version; + + /// major.minor version of Kubernetes release + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public KubernetesVersion() + { + + } + } + /// Kubernetes version profile for given major.minor release. + public partial interface IKubernetesVersion : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"supportPlan", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[] CapabilitySupportPlan { get; set; } + /// Whether this version is default. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether this version is default.", + SerializedName = @"isDefault", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDefault { get; set; } + /// Whether this version is in preview mode. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether this version is in preview mode.", + SerializedName = @"isPreview", + PossibleTypes = new [] { typeof(bool) })] + bool? IsPreview { get; set; } + /// Patch versions of Kubernetes release + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Patch versions of Kubernetes release", + SerializedName = @"patchVersions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions PatchVersion { get; set; } + /// major.minor version of Kubernetes release + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"major.minor version of Kubernetes release", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// Kubernetes version profile for given major.minor release. + internal partial interface IKubernetesVersionInternal + + { + /// Capabilities on this Kubernetes version. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities Capability { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[] CapabilitySupportPlan { get; set; } + /// Whether this version is default. + bool? IsDefault { get; set; } + /// Whether this version is in preview mode. + bool? IsPreview { get; set; } + /// Patch versions of Kubernetes release + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions PatchVersion { get; set; } + /// major.minor version of Kubernetes release + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.json.cs new file mode 100644 index 000000000000..405f0fed2818 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersion.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Kubernetes version profile for given major.minor release. + public partial class KubernetesVersion + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new KubernetesVersion(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesVersion(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionCapabilities.FromJson(__jsonCapabilities) : Capability;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_isDefault = If( json?.PropertyT("isDefault"), out var __jsonIsDefault) ? (bool?)__jsonIsDefault : IsDefault;} + {_isPreview = If( json?.PropertyT("isPreview"), out var __jsonIsPreview) ? (bool?)__jsonIsPreview : IsPreview;} + {_patchVersion = If( json?.PropertyT("patchVersions"), out var __jsonPatchVersions) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionPatchVersions.FromJson(__jsonPatchVersions) : PatchVersion;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._capability ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._capability.ToJson(null,serializationMode) : null, "capabilities" ,container.Add ); + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + AddIf( null != this._isDefault ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._isDefault) : null, "isDefault" ,container.Add ); + AddIf( null != this._isPreview ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._isPreview) : null, "isPreview" ,container.Add ); + AddIf( null != this._patchVersion ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._patchVersion.ToJson(null,serializationMode) : null, "patchVersions" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.PowerShell.cs new file mode 100644 index 000000000000..f16aa48028cf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Capabilities on this Kubernetes version. + [System.ComponentModel.TypeConverter(typeof(KubernetesVersionCapabilitiesTypeConverter))] + public partial class KubernetesVersionCapabilities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesVersionCapabilities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesVersionCapabilities(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesVersionCapabilities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SupportPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilitiesInternal)this).SupportPlan = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[]) content.GetValueForProperty("SupportPlan",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilitiesInternal)this).SupportPlan, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan.CreateFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesVersionCapabilities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SupportPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilitiesInternal)this).SupportPlan = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[]) content.GetValueForProperty("SupportPlan",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilitiesInternal)this).SupportPlan, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Capabilities on this Kubernetes version. + [System.ComponentModel.TypeConverter(typeof(KubernetesVersionCapabilitiesTypeConverter))] + public partial interface IKubernetesVersionCapabilities + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.TypeConverter.cs new file mode 100644 index 000000000000..719e38651ea9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesVersionCapabilitiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesVersionCapabilities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesVersionCapabilities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesVersionCapabilities.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.cs new file mode 100644 index 000000000000..2a783881ac18 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Capabilities on this Kubernetes version. + public partial class KubernetesVersionCapabilities : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilitiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[] _supportPlan; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[] SupportPlan { get => this._supportPlan; set => this._supportPlan = value; } + + /// Creates an new instance. + public KubernetesVersionCapabilities() + { + + } + } + /// Capabilities on this Kubernetes version. + public partial interface IKubernetesVersionCapabilities : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"supportPlan", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[] SupportPlan { get; set; } + + } + /// Capabilities on this Kubernetes version. + internal partial interface IKubernetesVersionCapabilitiesInternal + + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan[] SupportPlan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.json.cs new file mode 100644 index 000000000000..7db1bc3efc06 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionCapabilities.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Capabilities on this Kubernetes version. + public partial class KubernetesVersionCapabilities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionCapabilities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new KubernetesVersionCapabilities(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesVersionCapabilities(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_supportPlan = If( json?.PropertyT("supportPlan"), out var __jsonSupportPlan) ? If( __jsonSupportPlan as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Support.KubernetesSupportPlan) (__u is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan)""))) ))() : null : SupportPlan;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._supportPlan) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._supportPlan ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("supportPlan",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.PowerShell.cs new file mode 100644 index 000000000000..13b8955de4b2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Hold values properties, which is array of KubernetesVersion + [System.ComponentModel.TypeConverter(typeof(KubernetesVersionListResultTypeConverter))] + public partial class KubernetesVersionListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesVersionListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesVersionListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesVersionListResult(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.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesVersionListResult(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.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Hold values properties, which is array of KubernetesVersion + [System.ComponentModel.TypeConverter(typeof(KubernetesVersionListResultTypeConverter))] + public partial interface IKubernetesVersionListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.TypeConverter.cs new file mode 100644 index 000000000000..4f33666e7af3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesVersionListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesVersionListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesVersionListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesVersionListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.cs new file mode 100644 index 000000000000..3b9f2e99fdb9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Hold values properties, which is array of KubernetesVersion + public partial class KubernetesVersionListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion[] _value; + + /// Array of AKS supported Kubernetes versions. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public KubernetesVersionListResult() + { + + } + } + /// Hold values properties, which is array of KubernetesVersion + public partial interface IKubernetesVersionListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Array of AKS supported Kubernetes versions. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of AKS supported Kubernetes versions.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion[] Value { get; set; } + + } + /// Hold values properties, which is array of KubernetesVersion + internal partial interface IKubernetesVersionListResultInternal + + { + /// Array of AKS supported Kubernetes versions. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.json.cs new file mode 100644 index 000000000000..9b5c70857c57 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Hold values properties, which is array of KubernetesVersion + public partial class KubernetesVersionListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new KubernetesVersionListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesVersionListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IKubernetesVersion) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersion.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.PowerShell.cs new file mode 100644 index 000000000000..39d1c6e4a170 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Patch versions of Kubernetes release + [System.ComponentModel.TypeConverter(typeof(KubernetesVersionPatchVersionsTypeConverter))] + public partial class KubernetesVersionPatchVersions + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesVersionPatchVersions(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesVersionPatchVersions(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesVersionPatchVersions(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 KubernetesVersionPatchVersions(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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Patch versions of Kubernetes release + [System.ComponentModel.TypeConverter(typeof(KubernetesVersionPatchVersionsTypeConverter))] + public partial interface IKubernetesVersionPatchVersions + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.TypeConverter.cs new file mode 100644 index 000000000000..351b754ac972 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KubernetesVersionPatchVersionsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KubernetesVersionPatchVersions.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KubernetesVersionPatchVersions.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KubernetesVersionPatchVersions.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.cs new file mode 100644 index 000000000000..d2300d1f44b9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Patch versions of Kubernetes release + public partial class KubernetesVersionPatchVersions : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersionsInternal + { + + /// Creates an new instance. + public KubernetesVersionPatchVersions() + { + + } + } + /// Patch versions of Kubernetes release + public partial interface IKubernetesVersionPatchVersions : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// Patch versions of Kubernetes release + internal partial interface IKubernetesVersionPatchVersionsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.dictionary.cs new file mode 100644 index 000000000000..5ae131f89a02 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class KubernetesVersionPatchVersions : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion 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.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IKubernetesPatchVersion value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesVersionPatchVersions source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.json.cs new file mode 100644 index 000000000000..f16d87e8225b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/KubernetesVersionPatchVersions.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Patch versions of Kubernetes release + public partial class KubernetesVersionPatchVersions + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionPatchVersions FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new KubernetesVersionPatchVersions(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal KubernetesVersionPatchVersions(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubernetesPatchVersion.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.PowerShell.cs new file mode 100644 index 000000000000..a66fcb7c78e8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An + /// empty label selector matches all objects. A null label selector matches no objects. + /// + [System.ComponentModel.TypeConverter(typeof(LabelSelectorTypeConverter))] + public partial class LabelSelector + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LabelSelector(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LabelSelector(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LabelSelector(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)this).MatchLabel = (string[]) content.GetValueForProperty("MatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)this).MatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)this).MatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("MatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)this).MatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LabelSelector(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)this).MatchLabel = (string[]) content.GetValueForProperty("MatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)this).MatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)this).MatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("MatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)this).MatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An + /// empty label selector matches all objects. A null label selector matches no objects. + [System.ComponentModel.TypeConverter(typeof(LabelSelectorTypeConverter))] + public partial interface ILabelSelector + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.TypeConverter.cs new file mode 100644 index 000000000000..f930bf1296b6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LabelSelectorTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ILabelSelector ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LabelSelector.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LabelSelector.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LabelSelector.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.cs new file mode 100644 index 000000000000..a0fa9c7944e2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An + /// empty label selector matches all objects. A null label selector matches no objects. + /// + public partial class LabelSelector : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] _matchExpression; + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] MatchExpression { get => this._matchExpression; set => this._matchExpression = value; } + + /// Backing field for property. + private string[] _matchLabel; + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] MatchLabel { get => this._matchLabel; set => this._matchLabel = value; } + + /// Creates an new instance. + public LabelSelector() + { + + } + } + /// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An + /// empty label selector matches all objects. A null label selector matches no objects. + public partial interface ILabelSelector : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] MatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + string[] MatchLabel { get; set; } + + } + /// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An + /// empty label selector matches all objects. A null label selector matches no objects. + internal partial interface ILabelSelectorInternal + + { + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] MatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + string[] MatchLabel { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.json.cs new file mode 100644 index 000000000000..26f822d024ed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelector.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An + /// empty label selector matches all objects. A null label selector matches no objects. + /// + public partial class LabelSelector + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new LabelSelector(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal LabelSelector(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_matchLabel = If( json?.PropertyT("matchLabels"), out var __jsonMatchLabels) ? If( __jsonMatchLabels as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : MatchLabel;} + {_matchExpression = If( json?.PropertyT("matchExpressions"), out var __jsonMatchExpressions) ? If( __jsonMatchExpressions as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirement.FromJson(__p) )) ))() : null : MatchExpression;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._matchLabel) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._matchLabel ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("matchLabels",__w); + } + if (null != this._matchExpression) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._matchExpression ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("matchExpressions",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.PowerShell.cs new file mode 100644 index 000000000000..b108b819d1ed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + /// + [System.ComponentModel.TypeConverter(typeof(LabelSelectorRequirementTypeConverter))] + public partial class LabelSelectorRequirement + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LabelSelectorRequirement(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LabelSelectorRequirement(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LabelSelectorRequirement(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Key, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator?) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator.CreateFrom); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Value, __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 LabelSelectorRequirement(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Key, global::System.Convert.ToString); + } + if (content.Contains("Operator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator?) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator.CreateFrom); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal)this).Value, __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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + [System.ComponentModel.TypeConverter(typeof(LabelSelectorRequirementTypeConverter))] + public partial interface ILabelSelectorRequirement + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.TypeConverter.cs new file mode 100644 index 000000000000..bf16abfeb7e5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LabelSelectorRequirementTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LabelSelectorRequirement.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LabelSelectorRequirement.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LabelSelectorRequirement.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.cs new file mode 100644 index 000000000000..3d2e3adfbde1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + /// + public partial class LabelSelectorRequirement : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirementInternal + { + + /// Backing field for property. + private string _key; + + /// key is the label key that the selector applies to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Key { get => this._key; set => this._key = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator? _operator; + + /// + /// operator represents a key's relationship to a set of values. Valid operators are In and NotIn + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator? Operator { get => this._operator; set => this._operator = value; } + + /// Backing field for property. + private string[] _value; + + /// values is an array of string values, the values array must be non-empty. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public LabelSelectorRequirement() + { + + } + } + /// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + public partial interface ILabelSelectorRequirement : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// key is the label key that the selector applies to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"key is the label key that the selector applies to.", + SerializedName = @"key", + PossibleTypes = new [] { typeof(string) })] + string Key { get; set; } + /// + /// operator represents a key's relationship to a set of values. Valid operators are In and NotIn + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"operator represents a key's relationship to a set of values. Valid operators are In and NotIn", + SerializedName = @"operator", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator? Operator { get; set; } + /// values is an array of string values, the values array must be non-empty. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"values is an array of string values, the values array must be non-empty.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; set; } + + } + /// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + internal partial interface ILabelSelectorRequirementInternal + + { + /// key is the label key that the selector applies to. + string Key { get; set; } + /// + /// operator represents a key's relationship to a set of values. Valid operators are In and NotIn + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator? Operator { get; set; } + /// values is an array of string values, the values array must be non-empty. + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.json.cs new file mode 100644 index 000000000000..daf75faa8fc1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LabelSelectorRequirement.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + /// + public partial class LabelSelectorRequirement + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new LabelSelectorRequirement(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal LabelSelectorRequirement(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); + AddIf( null != (((object)this._operator)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._operator.ToString()) : null, "operator" ,container.Add ); + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.PowerShell.cs new file mode 100644 index 000000000000..123c9743bfc7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + /// + [System.ComponentModel.TypeConverter(typeof(LinuxOSConfigTypeConverter))] + public partial class LinuxOSConfig + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LinuxOSConfig(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LinuxOSConfig(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LinuxOSConfig(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TransparentHugePageEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).TransparentHugePageEnabled = (string) content.GetValueForProperty("TransparentHugePageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).TransparentHugePageEnabled, global::System.Convert.ToString); + } + if (content.Contains("TransparentHugePageDefrag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).TransparentHugePageDefrag = (string) content.GetValueForProperty("TransparentHugePageDefrag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).TransparentHugePageDefrag, global::System.Convert.ToString); + } + if (content.Contains("SwapFileSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).SwapFileSizeMb = (int?) content.GetValueForProperty("SwapFileSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).SwapFileSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Sysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).Sysctl = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) content.GetValueForProperty("Sysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).Sysctl, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfigTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LinuxOSConfig(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TransparentHugePageEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).TransparentHugePageEnabled = (string) content.GetValueForProperty("TransparentHugePageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).TransparentHugePageEnabled, global::System.Convert.ToString); + } + if (content.Contains("TransparentHugePageDefrag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).TransparentHugePageDefrag = (string) content.GetValueForProperty("TransparentHugePageDefrag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).TransparentHugePageDefrag, global::System.Convert.ToString); + } + if (content.Contains("SwapFileSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).SwapFileSizeMb = (int?) content.GetValueForProperty("SwapFileSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).SwapFileSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Sysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).Sysctl = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) content.GetValueForProperty("Sysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)this).Sysctl, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfigTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + [System.ComponentModel.TypeConverter(typeof(LinuxOSConfigTypeConverter))] + public partial interface ILinuxOSConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.TypeConverter.cs new file mode 100644 index 000000000000..1bbaf81ea770 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LinuxOSConfigTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ILinuxOSConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LinuxOSConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LinuxOSConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LinuxOSConfig.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.cs new file mode 100644 index 000000000000..d62f49919ce9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + /// + public partial class LinuxOSConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal + { + + /// Backing field for property. + private int? _swapFileSizeMb; + + /// The size in MB of a swap file that will be created on each node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? SwapFileSizeMb { get => this._swapFileSizeMb; set => this._swapFileSizeMb = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig _sysctl; + + /// Sysctl settings for Linux agent nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig Sysctl { get => (this._sysctl = this._sysctl ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfig()); set => this._sysctl = value; } + + /// Backing field for property. + private string _transparentHugePageDefrag; + + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string TransparentHugePageDefrag { get => this._transparentHugePageDefrag; set => this._transparentHugePageDefrag = value; } + + /// Backing field for property. + private string _transparentHugePageEnabled; + + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string TransparentHugePageEnabled { get => this._transparentHugePageEnabled; set => this._transparentHugePageEnabled = value; } + + /// Creates an new instance. + public LinuxOSConfig() + { + + } + } + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + public partial interface ILinuxOSConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The size in MB of a swap file that will be created on each node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size in MB of a swap file that will be created on each node.", + SerializedName = @"swapFileSizeMB", + PossibleTypes = new [] { typeof(int) })] + int? SwapFileSizeMb { get; set; } + /// Sysctl settings for Linux agent nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl settings for Linux agent nodes.", + SerializedName = @"sysctls", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig Sysctl { get; set; } + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).", + SerializedName = @"transparentHugePageDefrag", + PossibleTypes = new [] { typeof(string) })] + string TransparentHugePageDefrag { get; set; } + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).", + SerializedName = @"transparentHugePageEnabled", + PossibleTypes = new [] { typeof(string) })] + string TransparentHugePageEnabled { get; set; } + + } + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + internal partial interface ILinuxOSConfigInternal + + { + /// The size in MB of a swap file that will be created on each node. + int? SwapFileSizeMb { get; set; } + /// Sysctl settings for Linux agent nodes. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig Sysctl { get; set; } + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + string TransparentHugePageDefrag { get; set; } + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + string TransparentHugePageEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.json.cs new file mode 100644 index 000000000000..3c9561df2935 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LinuxOSConfig.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + /// + public partial class LinuxOSConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new LinuxOSConfig(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal LinuxOSConfig(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_transparentHugePageEnabled = If( json?.PropertyT("transparentHugePageEnabled"), out var __jsonTransparentHugePageEnabled) ? (string)__jsonTransparentHugePageEnabled : (string)TransparentHugePageEnabled;} + {_transparentHugePageDefrag = If( json?.PropertyT("transparentHugePageDefrag"), out var __jsonTransparentHugePageDefrag) ? (string)__jsonTransparentHugePageDefrag : (string)TransparentHugePageDefrag;} + {_swapFileSizeMb = If( json?.PropertyT("swapFileSizeMB"), out var __jsonSwapFileSizeMb) ? (int?)__jsonSwapFileSizeMb : SwapFileSizeMb;} + {_sysctl = If( json?.PropertyT("sysctls"), out var __jsonSysctls) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfig.FromJson(__jsonSysctls) : Sysctl;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._transparentHugePageEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._transparentHugePageEnabled.ToString()) : null, "transparentHugePageEnabled" ,container.Add ); + AddIf( null != (((object)this._transparentHugePageDefrag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._transparentHugePageDefrag.ToString()) : null, "transparentHugePageDefrag" ,container.Add ); + AddIf( null != this._swapFileSizeMb ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._swapFileSizeMb) : null, "swapFileSizeMB" ,container.Add ); + AddIf( null != this._sysctl ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._sysctl.ToJson(null,serializationMode) : null, "sysctls" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.PowerShell.cs new file mode 100644 index 000000000000..53b52bbd0b1e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.PowerShell.cs @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + /// Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + /// named `kubernetes`. + /// + [System.ComponentModel.TypeConverter(typeof(LoadBalancerTypeConverter))] + public partial class LoadBalancer + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LoadBalancer(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LoadBalancer(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LoadBalancer(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.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ServiceLabelSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("ServiceLabelSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceNamespaceSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("ServiceNamespaceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("NodeSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("NodeSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("PrimaryAgentPoolName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).PrimaryAgentPoolName = (string) content.GetValueForProperty("PrimaryAgentPoolName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).PrimaryAgentPoolName, global::System.Convert.ToString); + } + if (content.Contains("AllowServicePlacement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).AllowServicePlacement = (bool?) content.GetValueForProperty("AllowServicePlacement",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).AllowServicePlacement, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ServiceLabelSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelectorMatchLabel = (string[]) content.GetValueForProperty("ServiceLabelSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceLabelSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("ServiceLabelSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + if (content.Contains("ServiceNamespaceSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelectorMatchLabel = (string[]) content.GetValueForProperty("ServiceNamespaceSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceNamespaceSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("ServiceNamespaceSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + if (content.Contains("NodeSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelectorMatchLabel = (string[]) content.GetValueForProperty("NodeSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("NodeSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LoadBalancer(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.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ServiceLabelSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("ServiceLabelSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceNamespaceSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("ServiceNamespaceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("NodeSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("NodeSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("PrimaryAgentPoolName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).PrimaryAgentPoolName = (string) content.GetValueForProperty("PrimaryAgentPoolName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).PrimaryAgentPoolName, global::System.Convert.ToString); + } + if (content.Contains("AllowServicePlacement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).AllowServicePlacement = (bool?) content.GetValueForProperty("AllowServicePlacement",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).AllowServicePlacement, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ServiceLabelSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelectorMatchLabel = (string[]) content.GetValueForProperty("ServiceLabelSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceLabelSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("ServiceLabelSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceLabelSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + if (content.Contains("ServiceNamespaceSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelectorMatchLabel = (string[]) content.GetValueForProperty("ServiceNamespaceSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceNamespaceSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("ServiceNamespaceSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).ServiceNamespaceSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + if (content.Contains("NodeSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelectorMatchLabel = (string[]) content.GetValueForProperty("NodeSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("NodeSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal)this).NodeSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + /// Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + /// named `kubernetes`. + [System.ComponentModel.TypeConverter(typeof(LoadBalancerTypeConverter))] + public partial interface ILoadBalancer + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.TypeConverter.cs new file mode 100644 index 000000000000..4e0047d2fcae --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LoadBalancerTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ILoadBalancer ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LoadBalancer.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LoadBalancer.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LoadBalancer.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.cs new file mode 100644 index 000000000000..fa449a99d450 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + /// Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + /// named `kubernetes`. + /// + public partial class LoadBalancer : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(); + + /// + /// Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false + /// manually, both of the external and the internal load balancer will not be selected for services unless they explicitly + /// target it. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AllowServicePlacement { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).AllowServicePlacement; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).AllowServicePlacement = value ?? default(bool); } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; } + + /// Internal Acessors for NodeSelector + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal.NodeSelector { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).NodeSelector; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).NodeSelector = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for ServiceLabelSelector + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal.ServiceLabelSelector { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceLabelSelector; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceLabelSelector = value; } + + /// Internal Acessors for ServiceNamespaceSelector + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerInternal.ServiceNamespaceSelector { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceNamespaceSelector; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceNamespaceSelector = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; } + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] NodeSelectorMatchExpression { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).NodeSelectorMatchExpression; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).NodeSelectorMatchExpression = value ?? null /* arrayOf */; } + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] NodeSelectorMatchLabel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).NodeSelectorMatchLabel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).NodeSelectorMatchLabel = value ?? null /* arrayOf */; } + + /// + /// Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always + /// be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. + /// An agent pool can only be the primary pool for a single load balancer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PrimaryAgentPoolName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).PrimaryAgentPoolName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).PrimaryAgentPoolName = value ?? null; } + + /// + /// Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. + /// The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in + /// LoadBalancer list. There must be a name of kubernetes in the list. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).Name = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties _property; + + /// The properties of the load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerProperties()); set => this._property = value; } + + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ProvisioningState; } + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceLabelSelectorMatchExpression { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceLabelSelectorMatchExpression; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceLabelSelectorMatchExpression = value ?? null /* arrayOf */; } + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] ServiceLabelSelectorMatchLabel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceLabelSelectorMatchLabel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceLabelSelectorMatchLabel = value ?? null /* arrayOf */; } + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceNamespaceSelectorMatchExpression { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceNamespaceSelectorMatchExpression; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceNamespaceSelectorMatchExpression = value ?? null /* arrayOf */; } + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] ServiceNamespaceSelectorMatchLabel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceNamespaceSelectorMatchLabel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)Property).ServiceNamespaceSelectorMatchLabel = value ?? null /* arrayOf */; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public LoadBalancer() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + /// Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + /// named `kubernetes`. + public partial interface ILoadBalancer : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource + { + /// + /// Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false + /// manually, both of the external and the internal load balancer will not be selected for services unless they explicitly + /// target it. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false manually, both of the external and the internal load balancer will not be selected for services unless they explicitly target it.", + SerializedName = @"allowServicePlacement", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowServicePlacement { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] NodeSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + string[] NodeSelectorMatchLabel { get; set; } + /// + /// Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always + /// be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. + /// An agent pool can only be the primary pool for a single load balancer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. An agent pool can only be the primary pool for a single load balancer.", + SerializedName = @"primaryAgentPoolName", + PossibleTypes = new [] { typeof(string) })] + string PrimaryAgentPoolName { get; set; } + /// + /// Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. + /// The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in + /// LoadBalancer list. There must be a name of kubernetes in the list. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in LoadBalancer list. There must be a name of kubernetes in the list.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string PropertiesName { get; set; } + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceLabelSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceLabelSelectorMatchLabel { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceNamespaceSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceNamespaceSelectorMatchLabel { get; set; } + + } + /// The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + /// Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + /// named `kubernetes`. + internal partial interface ILoadBalancerInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal + { + /// + /// Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false + /// manually, both of the external and the internal load balancer will not be selected for services unless they explicitly + /// target it. + /// + bool? AllowServicePlacement { get; set; } + /// Nodes that match this selector will be possible members of this load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector NodeSelector { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] NodeSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + string[] NodeSelectorMatchLabel { get; set; } + /// + /// Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always + /// be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. + /// An agent pool can only be the primary pool for a single load balancer. + /// + string PrimaryAgentPoolName { get; set; } + /// + /// Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. + /// The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in + /// LoadBalancer list. There must be a name of kubernetes in the list. + /// + string PropertiesName { get; set; } + /// The properties of the load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties Property { get; set; } + /// The current provisioning state. + string ProvisioningState { get; set; } + /// + /// Only services that must match this selector can be placed on this load balancer. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector ServiceLabelSelector { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceLabelSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + string[] ServiceLabelSelectorMatchLabel { get; set; } + /// + /// Services created in namespaces that match the selector can be placed on this load balancer. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector ServiceNamespaceSelector { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceNamespaceSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + string[] ServiceNamespaceSelectorMatchLabel { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.json.cs new file mode 100644 index 000000000000..06298e556038 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancer.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + /// Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + /// named `kubernetes`. + /// + public partial class LoadBalancer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new LoadBalancer(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal LoadBalancer(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.PowerShell.cs new file mode 100644 index 000000000000..5ec03edfbe11 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The response from the List Load Balancers operation. + [System.ComponentModel.TypeConverter(typeof(LoadBalancerListResultTypeConverter))] + public partial class LoadBalancerListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LoadBalancerListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LoadBalancerListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LoadBalancerListResult(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.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal)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 LoadBalancerListResult(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.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancerTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List Load Balancers operation. + [System.ComponentModel.TypeConverter(typeof(LoadBalancerListResultTypeConverter))] + public partial interface ILoadBalancerListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.TypeConverter.cs new file mode 100644 index 000000000000..190d55fa8a3b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LoadBalancerListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LoadBalancerListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LoadBalancerListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LoadBalancerListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.cs new file mode 100644 index 000000000000..888153d74ce8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Load Balancers operation. + public partial class LoadBalancerListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next set of load balancer results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer[] _value; + + /// The list of Load Balancers. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public LoadBalancerListResult() + { + + } + } + /// The response from the List Load Balancers operation. + public partial interface ILoadBalancerListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next set of load balancer results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next set of load balancer results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of Load Balancers. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Load Balancers.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer[] Value { get; set; } + + } + /// The response from the List Load Balancers operation. + internal partial interface ILoadBalancerListResultInternal + + { + /// The URL to get the next set of load balancer results. + string NextLink { get; set; } + /// The list of Load Balancers. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.json.cs new file mode 100644 index 000000000000..5d4a82b10ddf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Load Balancers operation. + public partial class LoadBalancerListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new LoadBalancerListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal LoadBalancerListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.ILoadBalancer) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancer.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.PowerShell.cs new file mode 100644 index 000000000000..bea6da94af60 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(LoadBalancerPropertiesTypeConverter))] + public partial class LoadBalancerProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LoadBalancerProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LoadBalancerProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LoadBalancerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServiceLabelSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("ServiceLabelSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceNamespaceSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("ServiceNamespaceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("NodeSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("NodeSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("PrimaryAgentPoolName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).PrimaryAgentPoolName = (string) content.GetValueForProperty("PrimaryAgentPoolName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).PrimaryAgentPoolName, global::System.Convert.ToString); + } + if (content.Contains("AllowServicePlacement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).AllowServicePlacement = (bool?) content.GetValueForProperty("AllowServicePlacement",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).AllowServicePlacement, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ServiceLabelSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelectorMatchLabel = (string[]) content.GetValueForProperty("ServiceLabelSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceLabelSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("ServiceLabelSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + if (content.Contains("ServiceNamespaceSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelectorMatchLabel = (string[]) content.GetValueForProperty("ServiceNamespaceSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceNamespaceSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("ServiceNamespaceSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + if (content.Contains("NodeSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelectorMatchLabel = (string[]) content.GetValueForProperty("NodeSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("NodeSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LoadBalancerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServiceLabelSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("ServiceLabelSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceNamespaceSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("ServiceNamespaceSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("NodeSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelector = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector) content.GetValueForProperty("NodeSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelector, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("PrimaryAgentPoolName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).PrimaryAgentPoolName = (string) content.GetValueForProperty("PrimaryAgentPoolName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).PrimaryAgentPoolName, global::System.Convert.ToString); + } + if (content.Contains("AllowServicePlacement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).AllowServicePlacement = (bool?) content.GetValueForProperty("AllowServicePlacement",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).AllowServicePlacement, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ServiceLabelSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelectorMatchLabel = (string[]) content.GetValueForProperty("ServiceLabelSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceLabelSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("ServiceLabelSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceLabelSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + if (content.Contains("ServiceNamespaceSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelectorMatchLabel = (string[]) content.GetValueForProperty("ServiceNamespaceSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceNamespaceSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("ServiceNamespaceSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).ServiceNamespaceSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.ConvertFrom)); + } + if (content.Contains("NodeSelectorMatchLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelectorMatchLabel = (string[]) content.GetValueForProperty("NodeSelectorMatchLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelectorMatchLabel, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeSelectorMatchExpression")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelectorMatchExpression = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[]) content.GetValueForProperty("NodeSelectorMatchExpression",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal)this).NodeSelectorMatchExpression, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelectorRequirementTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(LoadBalancerPropertiesTypeConverter))] + public partial interface ILoadBalancerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.TypeConverter.cs new file mode 100644 index 000000000000..ad1397634422 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LoadBalancerPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LoadBalancerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LoadBalancerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LoadBalancerProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.cs new file mode 100644 index 000000000000..bb5b81059683 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.cs @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class LoadBalancerProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal + { + + /// Backing field for property. + private bool? _allowServicePlacement; + + /// + /// Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false + /// manually, both of the external and the internal load balancer will not be selected for services unless they explicitly + /// target it. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? AllowServicePlacement { get => this._allowServicePlacement; set => this._allowServicePlacement = value; } + + /// Internal Acessors for NodeSelector + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal.NodeSelector { get => (this._nodeSelector = this._nodeSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector()); set { {_nodeSelector = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for ServiceLabelSelector + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal.ServiceLabelSelector { get => (this._serviceLabelSelector = this._serviceLabelSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector()); set { {_serviceLabelSelector = value;} } } + + /// Internal Acessors for ServiceNamespaceSelector + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerPropertiesInternal.ServiceNamespaceSelector { get => (this._serviceNamespaceSelector = this._serviceNamespaceSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector()); set { {_serviceNamespaceSelector = value;} } } + + /// Backing field for property. + private string _name; + + /// + /// Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. + /// The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in + /// LoadBalancer list. There must be a name of kubernetes in the list. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector _nodeSelector; + + /// Nodes that match this selector will be possible members of this load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector NodeSelector { get => (this._nodeSelector = this._nodeSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector()); set => this._nodeSelector = value; } + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] NodeSelectorMatchExpression { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)NodeSelector).MatchExpression; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)NodeSelector).MatchExpression = value ?? null /* arrayOf */; } + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] NodeSelectorMatchLabel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)NodeSelector).MatchLabel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)NodeSelector).MatchLabel = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _primaryAgentPoolName; + + /// + /// Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always + /// be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. + /// An agent pool can only be the primary pool for a single load balancer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string PrimaryAgentPoolName { get => this._primaryAgentPoolName; set => this._primaryAgentPoolName = value; } + + /// Backing field for property. + private string _provisioningState; + + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector _serviceLabelSelector; + + /// + /// Only services that must match this selector can be placed on this load balancer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector ServiceLabelSelector { get => (this._serviceLabelSelector = this._serviceLabelSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector()); set => this._serviceLabelSelector = value; } + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceLabelSelectorMatchExpression { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)ServiceLabelSelector).MatchExpression; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)ServiceLabelSelector).MatchExpression = value ?? null /* arrayOf */; } + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] ServiceLabelSelectorMatchLabel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)ServiceLabelSelector).MatchLabel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)ServiceLabelSelector).MatchLabel = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector _serviceNamespaceSelector; + + /// + /// Services created in namespaces that match the selector can be placed on this load balancer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector ServiceNamespaceSelector { get => (this._serviceNamespaceSelector = this._serviceNamespaceSelector ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector()); set => this._serviceNamespaceSelector = value; } + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceNamespaceSelectorMatchExpression { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)ServiceNamespaceSelector).MatchExpression; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)ServiceNamespaceSelector).MatchExpression = value ?? null /* arrayOf */; } + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] ServiceNamespaceSelectorMatchLabel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)ServiceNamespaceSelector).MatchLabel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorInternal)ServiceNamespaceSelector).MatchLabel = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public LoadBalancerProperties() + { + + } + } + public partial interface ILoadBalancerProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false + /// manually, both of the external and the internal load balancer will not be selected for services unless they explicitly + /// target it. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false manually, both of the external and the internal load balancer will not be selected for services unless they explicitly target it.", + SerializedName = @"allowServicePlacement", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowServicePlacement { get; set; } + /// + /// Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. + /// The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in + /// LoadBalancer list. There must be a name of kubernetes in the list. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in LoadBalancer list. There must be a name of kubernetes in the list.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] NodeSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + string[] NodeSelectorMatchLabel { get; set; } + /// + /// Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always + /// be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. + /// An agent pool can only be the primary pool for a single load balancer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. An agent pool can only be the primary pool for a single load balancer.", + SerializedName = @"primaryAgentPoolName", + PossibleTypes = new [] { typeof(string) })] + string PrimaryAgentPoolName { get; set; } + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceLabelSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceLabelSelectorMatchLabel { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceNamespaceSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + string[] ServiceNamespaceSelectorMatchLabel { get; set; } + + } + internal partial interface ILoadBalancerPropertiesInternal + + { + /// + /// Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false + /// manually, both of the external and the internal load balancer will not be selected for services unless they explicitly + /// target it. + /// + bool? AllowServicePlacement { get; set; } + /// + /// Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. + /// The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in + /// LoadBalancer list. There must be a name of kubernetes in the list. + /// + string Name { get; set; } + /// Nodes that match this selector will be possible members of this load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector NodeSelector { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] NodeSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + string[] NodeSelectorMatchLabel { get; set; } + /// + /// Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always + /// be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. + /// An agent pool can only be the primary pool for a single load balancer. + /// + string PrimaryAgentPoolName { get; set; } + /// The current provisioning state. + string ProvisioningState { get; set; } + /// + /// Only services that must match this selector can be placed on this load balancer. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector ServiceLabelSelector { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceLabelSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + string[] ServiceLabelSelectorMatchLabel { get; set; } + /// + /// Services created in namespaces that match the selector can be placed on this load balancer. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelector ServiceNamespaceSelector { get; set; } + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceNamespaceSelectorMatchExpression { get; set; } + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + string[] ServiceNamespaceSelectorMatchLabel { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.json.cs new file mode 100644 index 000000000000..15056487752c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/LoadBalancerProperties.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class LoadBalancerProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new LoadBalancerProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal LoadBalancerProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serviceLabelSelector = If( json?.PropertyT("serviceLabelSelector"), out var __jsonServiceLabelSelector) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector.FromJson(__jsonServiceLabelSelector) : ServiceLabelSelector;} + {_serviceNamespaceSelector = If( json?.PropertyT("serviceNamespaceSelector"), out var __jsonServiceNamespaceSelector) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector.FromJson(__jsonServiceNamespaceSelector) : ServiceNamespaceSelector;} + {_nodeSelector = If( json?.PropertyT("nodeSelector"), out var __jsonNodeSelector) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LabelSelector.FromJson(__jsonNodeSelector) : NodeSelector;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_primaryAgentPoolName = If( json?.PropertyT("primaryAgentPoolName"), out var __jsonPrimaryAgentPoolName) ? (string)__jsonPrimaryAgentPoolName : (string)PrimaryAgentPoolName;} + {_allowServicePlacement = If( json?.PropertyT("allowServicePlacement"), out var __jsonAllowServicePlacement) ? (bool?)__jsonAllowServicePlacement : AllowServicePlacement;} + {_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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._serviceLabelSelector ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._serviceLabelSelector.ToJson(null,serializationMode) : null, "serviceLabelSelector" ,container.Add ); + AddIf( null != this._serviceNamespaceSelector ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._serviceNamespaceSelector.ToJson(null,serializationMode) : null, "serviceNamespaceSelector" ,container.Add ); + AddIf( null != this._nodeSelector ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._nodeSelector.ToJson(null,serializationMode) : null, "nodeSelector" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._primaryAgentPoolName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._primaryAgentPoolName.ToString()) : null, "primaryAgentPoolName" ,container.Add ); + AddIf( null != this._allowServicePlacement ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._allowServicePlacement) : null, "allowServicePlacement" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.PowerShell.cs new file mode 100644 index 000000000000..97c0e6d3d33e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get + /// nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. + /// + [System.ComponentModel.TypeConverter(typeof(MachineTypeConverter))] + public partial class Machine + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Machine(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Machine(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Machine(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.ContainerService.Models.Api20240402Preview.IMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachinePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).Network = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties) content.GetValueForProperty("Network",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).Network, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineNetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("NetworkIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).NetworkIPAddress = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[]) content.GetValueForProperty("NetworkIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).NetworkIPAddress, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineIPAddressTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Machine(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.ContainerService.Models.Api20240402Preview.IMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachinePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).Network = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties) content.GetValueForProperty("Network",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).Network, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineNetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("NetworkIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).NetworkIPAddress = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[]) content.GetValueForProperty("NetworkIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal)this).NetworkIPAddress, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineIPAddressTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get + /// nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. + [System.ComponentModel.TypeConverter(typeof(MachineTypeConverter))] + public partial interface IMachine + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.TypeConverter.cs new file mode 100644 index 000000000000..67761cb659c7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MachineTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMachine ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Machine.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Machine.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Machine.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.cs new file mode 100644 index 000000000000..56f3bc933774 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get + /// nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. + /// + public partial class Machine : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource __subResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SubResource(); + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Id; } + + /// Internal Acessors for Network + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal.Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)Property).Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)Property).Network = value; } + + /// Internal Acessors for NetworkIPAddress + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal.NetworkIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)Property).NetworkIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)Property).NetworkIPAddress = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineProperties()); set { {_property = value;} } } + + /// Internal Acessors for ResourceId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineInternal.ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)Property).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)Property).ResourceId = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Type = value; } + + /// + /// The name of the resource that is unique within a resource group. This name can be used to access the resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Name; } + + /// IPv4, IPv6 addresses of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] NetworkIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)Property).NetworkIPAddress; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties _property; + + /// The properties of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineProperties()); } + + /// Arm resource id of the machine. It can be used to GET underlying VM Instance + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)Property).ResourceId; } + + /// Resource type + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Type; } + + /// Creates an new instance. + public Machine() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__subResource), __subResource); + await eventListener.AssertObjectIsValid(nameof(__subResource), __subResource); + } + } + /// A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get + /// nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. + public partial interface IMachine : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource + { + /// IPv4, IPv6 addresses of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"IPv4, IPv6 addresses of the machine", + SerializedName = @"ipAddresses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] NetworkIPAddress { get; } + /// Arm resource id of the machine. It can be used to GET underlying VM Instance + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Arm resource id of the machine. It can be used to GET underlying VM Instance", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; } + + } + /// A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get + /// nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. + internal partial interface IMachineInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal + { + /// network properties of the machine + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties Network { get; set; } + /// IPv4, IPv6 addresses of the machine + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] NetworkIPAddress { get; set; } + /// The properties of the machine + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties Property { get; set; } + /// Arm resource id of the machine. It can be used to GET underlying VM Instance + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.json.cs new file mode 100644 index 000000000000..5122b60fd8cc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Machine.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get + /// nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. + /// + public partial class Machine + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new Machine(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal Machine(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __subResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SubResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __subResource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.PowerShell.cs new file mode 100644 index 000000000000..7da30e5acb50 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The machine IP address details. + [System.ComponentModel.TypeConverter(typeof(MachineIPAddressTypeConverter))] + public partial class MachineIPAddress + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MachineIPAddress(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MachineIPAddress(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MachineIPAddress(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal)this).IP = (string) content.GetValueForProperty("IP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal)this).IP, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal)this).Family = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily?) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal)this).Family, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MachineIPAddress(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal)this).IP = (string) content.GetValueForProperty("IP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal)this).IP, global::System.Convert.ToString); + } + if (content.Contains("Family")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal)this).Family = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily?) content.GetValueForProperty("Family",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal)this).Family, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The machine IP address details. + [System.ComponentModel.TypeConverter(typeof(MachineIPAddressTypeConverter))] + public partial interface IMachineIPAddress + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.TypeConverter.cs new file mode 100644 index 000000000000..4e7cbf454f96 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MachineIPAddressTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMachineIPAddress ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MachineIPAddress.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MachineIPAddress.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MachineIPAddress.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.cs new file mode 100644 index 000000000000..aeb5d8bd78cd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The machine IP address details. + public partial class MachineIPAddress : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily? _family; + + /// To determine if address belongs IPv4 or IPv6 family. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily? Family { get => this._family; } + + /// Backing field for property. + private string _iP; + + /// IPv4 or IPv6 address of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string IP { get => this._iP; } + + /// Internal Acessors for Family + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal.Family { get => this._family; set { {_family = value;} } } + + /// Internal Acessors for IP + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddressInternal.IP { get => this._iP; set { {_iP = value;} } } + + /// Creates an new instance. + public MachineIPAddress() + { + + } + } + /// The machine IP address details. + public partial interface IMachineIPAddress : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// To determine if address belongs IPv4 or IPv6 family. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"To determine if address belongs IPv4 or IPv6 family.", + SerializedName = @"family", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily? Family { get; } + /// IPv4 or IPv6 address of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"IPv4 or IPv6 address of the machine", + SerializedName = @"ip", + PossibleTypes = new [] { typeof(string) })] + string IP { get; } + + } + /// The machine IP address details. + internal partial interface IMachineIPAddressInternal + + { + /// To determine if address belongs IPv4 or IPv6 family. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily? Family { get; set; } + /// IPv4 or IPv6 address of the machine + string IP { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.json.cs new file mode 100644 index 000000000000..f70acd3db2a0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineIPAddress.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The machine IP address details. + public partial class MachineIPAddress + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MachineIPAddress(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MachineIPAddress(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_iP = If( json?.PropertyT("ip"), out var __jsonIP) ? (string)__jsonIP : (string)IP;} + {_family = If( json?.PropertyT("family"), out var __jsonFamily) ? (string)__jsonFamily : (string)Family;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._iP)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._iP.ToString()) : null, "ip" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._family)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._family.ToString()) : null, "family" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.PowerShell.cs new file mode 100644 index 000000000000..8219ff5d8854 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The response from the List Machines operation. + [System.ComponentModel.TypeConverter(typeof(MachineListResultTypeConverter))] + public partial class MachineListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MachineListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MachineListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MachineListResult(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.ContainerService.Models.Api20240402Preview.IMachineListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResultInternal)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 MachineListResult(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.ContainerService.Models.Api20240402Preview.IMachineListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResultInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List Machines operation. + [System.ComponentModel.TypeConverter(typeof(MachineListResultTypeConverter))] + public partial interface IMachineListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.TypeConverter.cs new file mode 100644 index 000000000000..276c596b379f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MachineListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMachineListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MachineListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MachineListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MachineListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.cs new file mode 100644 index 000000000000..5683a52e6ab1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Machines operation. + public partial class MachineListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next set of machine results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine[] _value; + + /// The list of Machines in cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public MachineListResult() + { + + } + } + /// The response from the List Machines operation. + public partial interface IMachineListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next set of machine results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next set of machine results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of Machines in cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Machines in cluster.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine[] Value { get; set; } + + } + /// The response from the List Machines operation. + internal partial interface IMachineListResultInternal + + { + /// The URL to get the next set of machine results. + string NextLink { get; set; } + /// The list of Machines in cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.json.cs new file mode 100644 index 000000000000..12aa7b7df39b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Machines operation. + public partial class MachineListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MachineListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MachineListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IMachine) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Machine.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.PowerShell.cs new file mode 100644 index 000000000000..5d7349bbf9d8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// network properties of the machine + [System.ComponentModel.TypeConverter(typeof(MachineNetworkPropertiesTypeConverter))] + public partial class MachineNetworkProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MachineNetworkProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MachineNetworkProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MachineNetworkProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkPropertiesInternal)this).IPAddress = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[]) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkPropertiesInternal)this).IPAddress, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineIPAddressTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MachineNetworkProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkPropertiesInternal)this).IPAddress = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[]) content.GetValueForProperty("IPAddress",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkPropertiesInternal)this).IPAddress, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineIPAddressTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// network properties of the machine + [System.ComponentModel.TypeConverter(typeof(MachineNetworkPropertiesTypeConverter))] + public partial interface IMachineNetworkProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.TypeConverter.cs new file mode 100644 index 000000000000..c9a029b7977c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MachineNetworkPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MachineNetworkProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MachineNetworkProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MachineNetworkProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.cs new file mode 100644 index 000000000000..ef2d24928e4e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// network properties of the machine + public partial class MachineNetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] _iPAddress; + + /// IPv4, IPv6 addresses of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] IPAddress { get => this._iPAddress; } + + /// Internal Acessors for IPAddress + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkPropertiesInternal.IPAddress { get => this._iPAddress; set { {_iPAddress = value;} } } + + /// Creates an new instance. + public MachineNetworkProperties() + { + + } + } + /// network properties of the machine + public partial interface IMachineNetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// IPv4, IPv6 addresses of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"IPv4, IPv6 addresses of the machine", + SerializedName = @"ipAddresses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] IPAddress { get; } + + } + /// network properties of the machine + internal partial interface IMachineNetworkPropertiesInternal + + { + /// IPv4, IPv6 addresses of the machine + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] IPAddress { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.json.cs new file mode 100644 index 000000000000..4b6998af0e9b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineNetworkProperties.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// network properties of the machine + public partial class MachineNetworkProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MachineNetworkProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MachineNetworkProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_iPAddress = If( json?.PropertyT("ipAddresses"), out var __jsonIPAddresses) ? If( __jsonIPAddresses as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMachineIPAddress) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineIPAddress.FromJson(__u) )) ))() : null : IPAddress;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._iPAddress) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._iPAddress ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("ipAddresses",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.PowerShell.cs new file mode 100644 index 000000000000..d111b831883d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The properties of the machine + [System.ComponentModel.TypeConverter(typeof(MachinePropertiesTypeConverter))] + public partial class MachineProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MachineProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MachineProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MachineProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).Network = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties) content.GetValueForProperty("Network",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).Network, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineNetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("NetworkIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).NetworkIPAddress = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[]) content.GetValueForProperty("NetworkIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).NetworkIPAddress, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineIPAddressTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MachineProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).Network = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties) content.GetValueForProperty("Network",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).Network, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineNetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("NetworkIPAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).NetworkIPAddress = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[]) content.GetValueForProperty("NetworkIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal)this).NetworkIPAddress, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineIPAddressTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the machine + [System.ComponentModel.TypeConverter(typeof(MachinePropertiesTypeConverter))] + public partial interface IMachineProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.TypeConverter.cs new file mode 100644 index 000000000000..eb55ea68f99f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MachinePropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMachineProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MachineProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MachineProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MachineProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.cs new file mode 100644 index 000000000000..0404e056add8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The properties of the machine + public partial class MachineProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal + { + + /// Internal Acessors for Network + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal.Network { get => (this._network = this._network ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineNetworkProperties()); set { {_network = value;} } } + + /// Internal Acessors for NetworkIPAddress + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal.NetworkIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkPropertiesInternal)Network).IPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkPropertiesInternal)Network).IPAddress = value; } + + /// Internal Acessors for ResourceId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachinePropertiesInternal.ResourceId { get => this._resourceId; set { {_resourceId = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties _network; + + /// network properties of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties Network { get => (this._network = this._network ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineNetworkProperties()); } + + /// IPv4, IPv6 addresses of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] NetworkIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkPropertiesInternal)Network).IPAddress; } + + /// Backing field for property. + private string _resourceId; + + /// Arm resource id of the machine. It can be used to GET underlying VM Instance + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; } + + /// Creates an new instance. + public MachineProperties() + { + + } + } + /// The properties of the machine + public partial interface IMachineProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// IPv4, IPv6 addresses of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"IPv4, IPv6 addresses of the machine", + SerializedName = @"ipAddresses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] NetworkIPAddress { get; } + /// Arm resource id of the machine. It can be used to GET underlying VM Instance + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Arm resource id of the machine. It can be used to GET underlying VM Instance", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; } + + } + /// The properties of the machine + internal partial interface IMachinePropertiesInternal + + { + /// network properties of the machine + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineNetworkProperties Network { get; set; } + /// IPv4, IPv6 addresses of the machine + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineIPAddress[] NetworkIPAddress { get; set; } + /// Arm resource id of the machine. It can be used to GET underlying VM Instance + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.json.cs new file mode 100644 index 000000000000..7fb9621c0af6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MachineProperties.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The properties of the machine + public partial class MachineProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MachineProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MachineProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_network = If( json?.PropertyT("network"), out var __jsonNetwork) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MachineNetworkProperties.FromJson(__jsonNetwork) : Network;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._network ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._network.ToJson(null,serializationMode) : null, "network" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.PowerShell.cs new file mode 100644 index 000000000000..dbcee4978ced --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.PowerShell.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + /// maintenance. + /// + [System.ComponentModel.TypeConverter(typeof(MaintenanceConfigurationTypeConverter))] + public partial class MaintenanceConfiguration + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MaintenanceConfiguration(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MaintenanceConfiguration(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MaintenanceConfiguration(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.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)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("MaintenanceWindow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindow = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow) content.GetValueForProperty("MaintenanceWindow",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindow, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceWindowTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)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("TimeInWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).TimeInWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[]) content.GetValueForProperty("TimeInWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).TimeInWeek, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeInWeekTypeConverter.ConvertFrom)); + } + if (content.Contains("NotAllowedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).NotAllowedTime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[]) content.GetValueForProperty("NotAllowedTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).NotAllowedTime, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("MaintenanceWindowSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowSchedule = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule) content.GetValueForProperty("MaintenanceWindowSchedule",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowSchedule, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("MaintenanceWindowDurationHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowDurationHour = (int) content.GetValueForProperty("MaintenanceWindowDurationHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowDurationHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaintenanceWindowUtcOffset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowUtcOffset = (string) content.GetValueForProperty("MaintenanceWindowUtcOffset",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowUtcOffset, global::System.Convert.ToString); + } + if (content.Contains("MaintenanceWindowStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowStartDate = (global::System.DateTime?) content.GetValueForProperty("MaintenanceWindowStartDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MaintenanceWindowStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowStartTime = (string) content.GetValueForProperty("MaintenanceWindowStartTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowStartTime, global::System.Convert.ToString); + } + if (content.Contains("MaintenanceWindowNotAllowedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowNotAllowedDate = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[]) content.GetValueForProperty("MaintenanceWindowNotAllowedDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowNotAllowedDate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DateSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleDaily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleDaily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule) content.GetValueForProperty("ScheduleDaily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleDaily, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleWeekly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleWeekly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule) content.GetValueForProperty("ScheduleWeekly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleWeekly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleAbsoluteMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleAbsoluteMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule) content.GetValueForProperty("ScheduleAbsoluteMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleAbsoluteMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleRelativeMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleRelativeMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule) content.GetValueForProperty("ScheduleRelativeMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleRelativeMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DailyIntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).DailyIntervalDay = (int) content.GetValueForProperty("DailyIntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).DailyIntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyIntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).WeeklyIntervalWeek = (int) content.GetValueForProperty("WeeklyIntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).WeeklyIntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).WeeklyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("WeeklyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).WeeklyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("AbsoluteMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).AbsoluteMonthlyIntervalMonth = (int) content.GetValueForProperty("AbsoluteMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).AbsoluteMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AbsoluteMonthlyDayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).AbsoluteMonthlyDayOfMonth = (int) content.GetValueForProperty("AbsoluteMonthlyDayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).AbsoluteMonthlyDayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyIntervalMonth = (int) content.GetValueForProperty("RelativeMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyWeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyWeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("RelativeMonthlyWeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyWeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("RelativeMonthlyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("RelativeMonthlyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MaintenanceConfiguration(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.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)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("MaintenanceWindow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindow = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow) content.GetValueForProperty("MaintenanceWindow",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindow, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceWindowTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)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("TimeInWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).TimeInWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[]) content.GetValueForProperty("TimeInWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).TimeInWeek, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeInWeekTypeConverter.ConvertFrom)); + } + if (content.Contains("NotAllowedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).NotAllowedTime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[]) content.GetValueForProperty("NotAllowedTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).NotAllowedTime, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("MaintenanceWindowSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowSchedule = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule) content.GetValueForProperty("MaintenanceWindowSchedule",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowSchedule, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("MaintenanceWindowDurationHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowDurationHour = (int) content.GetValueForProperty("MaintenanceWindowDurationHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowDurationHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaintenanceWindowUtcOffset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowUtcOffset = (string) content.GetValueForProperty("MaintenanceWindowUtcOffset",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowUtcOffset, global::System.Convert.ToString); + } + if (content.Contains("MaintenanceWindowStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowStartDate = (global::System.DateTime?) content.GetValueForProperty("MaintenanceWindowStartDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MaintenanceWindowStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowStartTime = (string) content.GetValueForProperty("MaintenanceWindowStartTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowStartTime, global::System.Convert.ToString); + } + if (content.Contains("MaintenanceWindowNotAllowedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowNotAllowedDate = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[]) content.GetValueForProperty("MaintenanceWindowNotAllowedDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).MaintenanceWindowNotAllowedDate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DateSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleDaily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleDaily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule) content.GetValueForProperty("ScheduleDaily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleDaily, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleWeekly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleWeekly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule) content.GetValueForProperty("ScheduleWeekly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleWeekly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleAbsoluteMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleAbsoluteMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule) content.GetValueForProperty("ScheduleAbsoluteMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleAbsoluteMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleRelativeMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleRelativeMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule) content.GetValueForProperty("ScheduleRelativeMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).ScheduleRelativeMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DailyIntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).DailyIntervalDay = (int) content.GetValueForProperty("DailyIntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).DailyIntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyIntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).WeeklyIntervalWeek = (int) content.GetValueForProperty("WeeklyIntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).WeeklyIntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).WeeklyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("WeeklyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).WeeklyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("AbsoluteMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).AbsoluteMonthlyIntervalMonth = (int) content.GetValueForProperty("AbsoluteMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).AbsoluteMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AbsoluteMonthlyDayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).AbsoluteMonthlyDayOfMonth = (int) content.GetValueForProperty("AbsoluteMonthlyDayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).AbsoluteMonthlyDayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyIntervalMonth = (int) content.GetValueForProperty("RelativeMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyWeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyWeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("RelativeMonthlyWeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyWeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("RelativeMonthlyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("RelativeMonthlyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal)this).RelativeMonthlyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + /// maintenance. + [System.ComponentModel.TypeConverter(typeof(MaintenanceConfigurationTypeConverter))] + public partial interface IMaintenanceConfiguration + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.TypeConverter.cs new file mode 100644 index 000000000000..0b4153b1afac --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MaintenanceConfigurationTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MaintenanceConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MaintenanceConfiguration.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MaintenanceConfiguration.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.cs new file mode 100644 index 000000000000..79dad570c52b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + /// maintenance. + /// + public partial class MaintenanceConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource __subResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SubResource(); + + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? AbsoluteMonthlyDayOfMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).AbsoluteMonthlyDayOfMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).AbsoluteMonthlyDayOfMonth = value ?? default(int); } + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? AbsoluteMonthlyIntervalMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).AbsoluteMonthlyIntervalMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).AbsoluteMonthlyIntervalMonth = value ?? default(int); } + + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? DailyIntervalDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).DailyIntervalDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).DailyIntervalDay = value ?? default(int); } + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Id; } + + /// Length of maintenance window range from 4 to 24 hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? MaintenanceWindowDurationHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowDurationHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowDurationHour = value ?? default(int); } + + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] MaintenanceWindowNotAllowedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowNotAllowedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowNotAllowedDate = value ?? null /* arrayOf */; } + + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? MaintenanceWindowStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowStartDate = value ?? default(global::System.DateTime); } + + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string MaintenanceWindowStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowStartTime = value ?? null; } + + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string MaintenanceWindowUtcOffset { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowUtcOffset; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowUtcOffset = value ?? null; } + + /// Internal Acessors for MaintenanceWindow + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal.MaintenanceWindow { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindow; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindow = value; } + + /// Internal Acessors for MaintenanceWindowSchedule + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal.MaintenanceWindowSchedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowSchedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).MaintenanceWindowSchedule = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationProperties()); set { {_property = value;} } } + + /// Internal Acessors for ScheduleAbsoluteMonthly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal.ScheduleAbsoluteMonthly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).ScheduleAbsoluteMonthly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).ScheduleAbsoluteMonthly = value; } + + /// Internal Acessors for ScheduleDaily + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal.ScheduleDaily { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).ScheduleDaily; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).ScheduleDaily = value; } + + /// Internal Acessors for ScheduleRelativeMonthly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal.ScheduleRelativeMonthly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).ScheduleRelativeMonthly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).ScheduleRelativeMonthly = value; } + + /// Internal Acessors for ScheduleWeekly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal.ScheduleWeekly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).ScheduleWeekly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).ScheduleWeekly = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Type = value; } + + /// + /// The name of the resource that is unique within a resource group. This name can be used to access the resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Name; } + + /// Time slots on which upgrade is not allowed. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[] NotAllowedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).NotAllowedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).NotAllowedTime = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties _property; + + /// Properties of a default maintenance configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationProperties()); set => this._property = value; } + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).RelativeMonthlyDayOfWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).RelativeMonthlyDayOfWeek = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); } + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? RelativeMonthlyIntervalMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).RelativeMonthlyIntervalMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).RelativeMonthlyIntervalMonth = value ?? default(int); } + + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).RelativeMonthlyWeekIndex; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).RelativeMonthlyWeekIndex = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData _systemData; + + /// The system metadata relating to this resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// + /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[] TimeInWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).TimeInWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).TimeInWeek = value ?? null /* arrayOf */; } + + /// Resource type + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)__subResource).Type; } + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).WeeklyDayOfWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).WeeklyDayOfWeek = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); } + + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? WeeklyIntervalWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).WeeklyIntervalWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)Property).WeeklyIntervalWeek = value ?? default(int); } + + /// Creates an new instance. + public MaintenanceConfiguration() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__subResource), __subResource); + await eventListener.AssertObjectIsValid(nameof(__subResource), __subResource); + } + } + /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + /// maintenance. + public partial interface IMaintenanceConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource + { + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date of the month.", + SerializedName = @"dayOfMonth", + PossibleTypes = new [] { typeof(int) })] + int? AbsoluteMonthlyDayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int? AbsoluteMonthlyIntervalMonth { get; set; } + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of days between each set of occurrences.", + SerializedName = @"intervalDays", + PossibleTypes = new [] { typeof(int) })] + int? DailyIntervalDay { get; set; } + /// Length of maintenance window range from 4 to 24 hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Length of maintenance window range from 4 to 24 hours.", + SerializedName = @"durationHours", + PossibleTypes = new [] { typeof(int) })] + int? MaintenanceWindowDurationHour { get; set; } + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time.", + SerializedName = @"notAllowedDates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] MaintenanceWindowNotAllowedDate { get; set; } + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? MaintenanceWindowStartDate { get; set; } + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string MaintenanceWindowStartTime { get; set; } + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'.", + SerializedName = @"utcOffset", + PossibleTypes = new [] { typeof(string) })] + string MaintenanceWindowUtcOffset { get; set; } + /// Time slots on which upgrade is not allowed. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time slots on which upgrade is not allowed.", + SerializedName = @"notAllowedTime", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[] NotAllowedTime { get; set; } + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int? RelativeMonthlyIntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.", + SerializedName = @"weekIndex", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.", + SerializedName = @"timeInWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[] TimeInWeek { get; set; } + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of weeks between each set of occurrences.", + SerializedName = @"intervalWeeks", + PossibleTypes = new [] { typeof(int) })] + int? WeeklyIntervalWeek { get; set; } + + } + /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + /// maintenance. + internal partial interface IMaintenanceConfigurationInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal + { + /// The date of the month. + int? AbsoluteMonthlyDayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + int? AbsoluteMonthlyIntervalMonth { get; set; } + /// Specifies the number of days between each set of occurrences. + int? DailyIntervalDay { get; set; } + /// Maintenance window for the maintenance configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow MaintenanceWindow { get; set; } + /// Length of maintenance window range from 4 to 24 hours. + int? MaintenanceWindowDurationHour { get; set; } + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] MaintenanceWindowNotAllowedDate { get; set; } + /// Recurrence schedule for the maintenance window. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule MaintenanceWindowSchedule { get; set; } + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + global::System.DateTime? MaintenanceWindowStartDate { get; set; } + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + string MaintenanceWindowStartTime { get; set; } + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + string MaintenanceWindowUtcOffset { get; set; } + /// Time slots on which upgrade is not allowed. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[] NotAllowedTime { get; set; } + /// Properties of a default maintenance configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties Property { get; set; } + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + int? RelativeMonthlyIntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get; set; } + /// + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule ScheduleAbsoluteMonthly { get; set; } + /// For schedules like: 'recur every day' or 'recur every 3 days'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule ScheduleDaily { get; set; } + /// + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule ScheduleRelativeMonthly { get; set; } + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule ScheduleWeekly { get; set; } + /// The system metadata relating to this resource. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.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.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[] TimeInWeek { get; set; } + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + int? WeeklyIntervalWeek { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.json.cs new file mode 100644 index 000000000000..107ebfc08c7f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfiguration.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + /// maintenance. + /// + public partial class MaintenanceConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MaintenanceConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MaintenanceConfiguration(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __subResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SubResource(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __subResource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.PowerShell.cs new file mode 100644 index 000000000000..83d5c4118a70 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The response from the List maintenance configurations operation. + [System.ComponentModel.TypeConverter(typeof(MaintenanceConfigurationListResultTypeConverter))] + public partial class MaintenanceConfigurationListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MaintenanceConfigurationListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MaintenanceConfigurationListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MaintenanceConfigurationListResult(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.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal)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 MaintenanceConfigurationListResult(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.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List maintenance configurations operation. + [System.ComponentModel.TypeConverter(typeof(MaintenanceConfigurationListResultTypeConverter))] + public partial interface IMaintenanceConfigurationListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.TypeConverter.cs new file mode 100644 index 000000000000..85a2c758b142 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MaintenanceConfigurationListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MaintenanceConfigurationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MaintenanceConfigurationListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MaintenanceConfigurationListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.cs new file mode 100644 index 000000000000..7792c68785f0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List maintenance configurations operation. + public partial class MaintenanceConfigurationListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next set of maintenance configuration results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration[] _value; + + /// The list of maintenance configurations. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public MaintenanceConfigurationListResult() + { + + } + } + /// The response from the List maintenance configurations operation. + public partial interface IMaintenanceConfigurationListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next set of maintenance configuration results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next set of maintenance configuration results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of maintenance configurations. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of maintenance configurations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration[] Value { get; set; } + + } + /// The response from the List maintenance configurations operation. + internal partial interface IMaintenanceConfigurationListResultInternal + + { + /// The URL to get the next set of maintenance configuration results. + string NextLink { get; set; } + /// The list of maintenance configurations. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.json.cs new file mode 100644 index 000000000000..e1dcbd571943 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationListResult.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List maintenance configurations operation. + public partial class MaintenanceConfigurationListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MaintenanceConfigurationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MaintenanceConfigurationListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfiguration.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.PowerShell.cs new file mode 100644 index 000000000000..5bc69ac989d0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Properties used to configure planned maintenance for a Managed Cluster. + [System.ComponentModel.TypeConverter(typeof(MaintenanceConfigurationPropertiesTypeConverter))] + public partial class MaintenanceConfigurationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MaintenanceConfigurationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MaintenanceConfigurationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MaintenanceConfigurationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MaintenanceWindow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindow = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow) content.GetValueForProperty("MaintenanceWindow",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindow, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceWindowTypeConverter.ConvertFrom); + } + if (content.Contains("TimeInWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).TimeInWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[]) content.GetValueForProperty("TimeInWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).TimeInWeek, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeInWeekTypeConverter.ConvertFrom)); + } + if (content.Contains("NotAllowedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).NotAllowedTime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[]) content.GetValueForProperty("NotAllowedTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).NotAllowedTime, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("MaintenanceWindowSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowSchedule = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule) content.GetValueForProperty("MaintenanceWindowSchedule",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowSchedule, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("MaintenanceWindowDurationHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowDurationHour = (int) content.GetValueForProperty("MaintenanceWindowDurationHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowDurationHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaintenanceWindowUtcOffset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowUtcOffset = (string) content.GetValueForProperty("MaintenanceWindowUtcOffset",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowUtcOffset, global::System.Convert.ToString); + } + if (content.Contains("MaintenanceWindowStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowStartDate = (global::System.DateTime?) content.GetValueForProperty("MaintenanceWindowStartDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MaintenanceWindowStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowStartTime = (string) content.GetValueForProperty("MaintenanceWindowStartTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowStartTime, global::System.Convert.ToString); + } + if (content.Contains("MaintenanceWindowNotAllowedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowNotAllowedDate = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[]) content.GetValueForProperty("MaintenanceWindowNotAllowedDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowNotAllowedDate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DateSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleDaily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleDaily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule) content.GetValueForProperty("ScheduleDaily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleDaily, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleWeekly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleWeekly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule) content.GetValueForProperty("ScheduleWeekly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleWeekly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleAbsoluteMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleAbsoluteMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule) content.GetValueForProperty("ScheduleAbsoluteMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleAbsoluteMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleRelativeMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleRelativeMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule) content.GetValueForProperty("ScheduleRelativeMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleRelativeMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DailyIntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).DailyIntervalDay = (int) content.GetValueForProperty("DailyIntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).DailyIntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyIntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).WeeklyIntervalWeek = (int) content.GetValueForProperty("WeeklyIntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).WeeklyIntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).WeeklyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("WeeklyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).WeeklyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("AbsoluteMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).AbsoluteMonthlyIntervalMonth = (int) content.GetValueForProperty("AbsoluteMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).AbsoluteMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AbsoluteMonthlyDayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).AbsoluteMonthlyDayOfMonth = (int) content.GetValueForProperty("AbsoluteMonthlyDayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).AbsoluteMonthlyDayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyIntervalMonth = (int) content.GetValueForProperty("RelativeMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyWeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyWeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("RelativeMonthlyWeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyWeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("RelativeMonthlyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("RelativeMonthlyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MaintenanceConfigurationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MaintenanceWindow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindow = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow) content.GetValueForProperty("MaintenanceWindow",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindow, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceWindowTypeConverter.ConvertFrom); + } + if (content.Contains("TimeInWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).TimeInWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[]) content.GetValueForProperty("TimeInWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).TimeInWeek, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeInWeekTypeConverter.ConvertFrom)); + } + if (content.Contains("NotAllowedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).NotAllowedTime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[]) content.GetValueForProperty("NotAllowedTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).NotAllowedTime, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("MaintenanceWindowSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowSchedule = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule) content.GetValueForProperty("MaintenanceWindowSchedule",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowSchedule, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("MaintenanceWindowDurationHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowDurationHour = (int) content.GetValueForProperty("MaintenanceWindowDurationHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowDurationHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MaintenanceWindowUtcOffset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowUtcOffset = (string) content.GetValueForProperty("MaintenanceWindowUtcOffset",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowUtcOffset, global::System.Convert.ToString); + } + if (content.Contains("MaintenanceWindowStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowStartDate = (global::System.DateTime?) content.GetValueForProperty("MaintenanceWindowStartDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MaintenanceWindowStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowStartTime = (string) content.GetValueForProperty("MaintenanceWindowStartTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowStartTime, global::System.Convert.ToString); + } + if (content.Contains("MaintenanceWindowNotAllowedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowNotAllowedDate = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[]) content.GetValueForProperty("MaintenanceWindowNotAllowedDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).MaintenanceWindowNotAllowedDate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DateSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleDaily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleDaily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule) content.GetValueForProperty("ScheduleDaily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleDaily, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleWeekly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleWeekly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule) content.GetValueForProperty("ScheduleWeekly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleWeekly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleAbsoluteMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleAbsoluteMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule) content.GetValueForProperty("ScheduleAbsoluteMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleAbsoluteMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleRelativeMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleRelativeMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule) content.GetValueForProperty("ScheduleRelativeMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).ScheduleRelativeMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DailyIntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).DailyIntervalDay = (int) content.GetValueForProperty("DailyIntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).DailyIntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyIntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).WeeklyIntervalWeek = (int) content.GetValueForProperty("WeeklyIntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).WeeklyIntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).WeeklyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("WeeklyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).WeeklyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("AbsoluteMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).AbsoluteMonthlyIntervalMonth = (int) content.GetValueForProperty("AbsoluteMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).AbsoluteMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AbsoluteMonthlyDayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).AbsoluteMonthlyDayOfMonth = (int) content.GetValueForProperty("AbsoluteMonthlyDayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).AbsoluteMonthlyDayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyIntervalMonth = (int) content.GetValueForProperty("RelativeMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyWeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyWeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("RelativeMonthlyWeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyWeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("RelativeMonthlyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("RelativeMonthlyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal)this).RelativeMonthlyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties used to configure planned maintenance for a Managed Cluster. + [System.ComponentModel.TypeConverter(typeof(MaintenanceConfigurationPropertiesTypeConverter))] + public partial interface IMaintenanceConfigurationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.TypeConverter.cs new file mode 100644 index 000000000000..7ee37e5f2177 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MaintenanceConfigurationPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MaintenanceConfigurationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MaintenanceConfigurationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MaintenanceConfigurationProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.cs new file mode 100644 index 000000000000..85e9e1dc4151 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties used to configure planned maintenance for a Managed Cluster. + public partial class MaintenanceConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal + { + + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? AbsoluteMonthlyDayOfMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).AbsoluteMonthlyDayOfMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).AbsoluteMonthlyDayOfMonth = value ?? default(int); } + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? AbsoluteMonthlyIntervalMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).AbsoluteMonthlyIntervalMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).AbsoluteMonthlyIntervalMonth = value ?? default(int); } + + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? DailyIntervalDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).DailyIntervalDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).DailyIntervalDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow _maintenanceWindow; + + /// Maintenance window for the maintenance configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow MaintenanceWindow { get => (this._maintenanceWindow = this._maintenanceWindow ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceWindow()); set => this._maintenanceWindow = value; } + + /// Length of maintenance window range from 4 to 24 hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? MaintenanceWindowDurationHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).DurationHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).DurationHour = value ?? default(int); } + + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] MaintenanceWindowNotAllowedDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).NotAllowedDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).NotAllowedDate = value ?? null /* arrayOf */; } + + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? MaintenanceWindowStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).StartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).StartDate = value ?? default(global::System.DateTime); } + + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string MaintenanceWindowStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).StartTime = value ?? null; } + + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string MaintenanceWindowUtcOffset { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).UtcOffset; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).UtcOffset = value ?? null; } + + /// Internal Acessors for MaintenanceWindow + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal.MaintenanceWindow { get => (this._maintenanceWindow = this._maintenanceWindow ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceWindow()); set { {_maintenanceWindow = value;} } } + + /// Internal Acessors for MaintenanceWindowSchedule + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal.MaintenanceWindowSchedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).Schedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).Schedule = value; } + + /// Internal Acessors for ScheduleAbsoluteMonthly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal.ScheduleAbsoluteMonthly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).ScheduleAbsoluteMonthly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).ScheduleAbsoluteMonthly = value; } + + /// Internal Acessors for ScheduleDaily + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal.ScheduleDaily { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).ScheduleDaily; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).ScheduleDaily = value; } + + /// Internal Acessors for ScheduleRelativeMonthly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal.ScheduleRelativeMonthly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).ScheduleRelativeMonthly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).ScheduleRelativeMonthly = value; } + + /// Internal Acessors for ScheduleWeekly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationPropertiesInternal.ScheduleWeekly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).ScheduleWeekly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).ScheduleWeekly = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[] _notAllowedTime; + + /// Time slots on which upgrade is not allowed. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[] NotAllowedTime { get => this._notAllowedTime; set => this._notAllowedTime = value; } + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).RelativeMonthlyDayOfWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).RelativeMonthlyDayOfWeek = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); } + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? RelativeMonthlyIntervalMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).RelativeMonthlyIntervalMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).RelativeMonthlyIntervalMonth = value ?? default(int); } + + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).RelativeMonthlyWeekIndex; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).RelativeMonthlyWeekIndex = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[] _timeInWeek; + + /// + /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[] TimeInWeek { get => this._timeInWeek; set => this._timeInWeek = value; } + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).WeeklyDayOfWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).WeeklyDayOfWeek = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); } + + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? WeeklyIntervalWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).WeeklyIntervalWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)MaintenanceWindow).WeeklyIntervalWeek = value ?? default(int); } + + /// Creates an new instance. + public MaintenanceConfigurationProperties() + { + + } + } + /// Properties used to configure planned maintenance for a Managed Cluster. + public partial interface IMaintenanceConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date of the month.", + SerializedName = @"dayOfMonth", + PossibleTypes = new [] { typeof(int) })] + int? AbsoluteMonthlyDayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int? AbsoluteMonthlyIntervalMonth { get; set; } + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of days between each set of occurrences.", + SerializedName = @"intervalDays", + PossibleTypes = new [] { typeof(int) })] + int? DailyIntervalDay { get; set; } + /// Length of maintenance window range from 4 to 24 hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Length of maintenance window range from 4 to 24 hours.", + SerializedName = @"durationHours", + PossibleTypes = new [] { typeof(int) })] + int? MaintenanceWindowDurationHour { get; set; } + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time.", + SerializedName = @"notAllowedDates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] MaintenanceWindowNotAllowedDate { get; set; } + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? MaintenanceWindowStartDate { get; set; } + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string MaintenanceWindowStartTime { get; set; } + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'.", + SerializedName = @"utcOffset", + PossibleTypes = new [] { typeof(string) })] + string MaintenanceWindowUtcOffset { get; set; } + /// Time slots on which upgrade is not allowed. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time slots on which upgrade is not allowed.", + SerializedName = @"notAllowedTime", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[] NotAllowedTime { get; set; } + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int? RelativeMonthlyIntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.", + SerializedName = @"weekIndex", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get; set; } + /// + /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.", + SerializedName = @"timeInWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[] TimeInWeek { get; set; } + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of weeks between each set of occurrences.", + SerializedName = @"intervalWeeks", + PossibleTypes = new [] { typeof(int) })] + int? WeeklyIntervalWeek { get; set; } + + } + /// Properties used to configure planned maintenance for a Managed Cluster. + internal partial interface IMaintenanceConfigurationPropertiesInternal + + { + /// The date of the month. + int? AbsoluteMonthlyDayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + int? AbsoluteMonthlyIntervalMonth { get; set; } + /// Specifies the number of days between each set of occurrences. + int? DailyIntervalDay { get; set; } + /// Maintenance window for the maintenance configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow MaintenanceWindow { get; set; } + /// Length of maintenance window range from 4 to 24 hours. + int? MaintenanceWindowDurationHour { get; set; } + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] MaintenanceWindowNotAllowedDate { get; set; } + /// Recurrence schedule for the maintenance window. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule MaintenanceWindowSchedule { get; set; } + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + global::System.DateTime? MaintenanceWindowStartDate { get; set; } + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + string MaintenanceWindowStartTime { get; set; } + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + string MaintenanceWindowUtcOffset { get; set; } + /// Time slots on which upgrade is not allowed. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[] NotAllowedTime { get; set; } + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + int? RelativeMonthlyIntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get; set; } + /// + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule ScheduleAbsoluteMonthly { get; set; } + /// For schedules like: 'recur every day' or 'recur every 3 days'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule ScheduleDaily { get; set; } + /// + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule ScheduleRelativeMonthly { get; set; } + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule ScheduleWeekly { get; set; } + /// + /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[] TimeInWeek { get; set; } + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + int? WeeklyIntervalWeek { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.json.cs new file mode 100644 index 000000000000..1931035d4316 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceConfigurationProperties.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties used to configure planned maintenance for a Managed Cluster. + public partial class MaintenanceConfigurationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MaintenanceConfigurationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MaintenanceConfigurationProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_maintenanceWindow = If( json?.PropertyT("maintenanceWindow"), out var __jsonMaintenanceWindow) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceWindow.FromJson(__jsonMaintenanceWindow) : MaintenanceWindow;} + {_timeInWeek = If( json?.PropertyT("timeInWeek"), out var __jsonTimeInWeek) ? If( __jsonTimeInWeek as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITimeInWeek) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeInWeek.FromJson(__u) )) ))() : null : TimeInWeek;} + {_notAllowedTime = If( json?.PropertyT("notAllowedTime"), out var __jsonNotAllowedTime) ? If( __jsonNotAllowedTime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITimeSpan) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TimeSpan.FromJson(__p) )) ))() : null : NotAllowedTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._maintenanceWindow ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._maintenanceWindow.ToJson(null,serializationMode) : null, "maintenanceWindow" ,container.Add ); + if (null != this._timeInWeek) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._timeInWeek ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("timeInWeek",__w); + } + if (null != this._notAllowedTime) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._notAllowedTime ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("notAllowedTime",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.PowerShell.cs new file mode 100644 index 000000000000..b9ccc6bf138c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.PowerShell.cs @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + /// + [System.ComponentModel.TypeConverter(typeof(MaintenanceWindowTypeConverter))] + public partial class MaintenanceWindow + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MaintenanceWindow(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MaintenanceWindow(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MaintenanceWindow(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DurationHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).DurationHour = (int) content.GetValueForProperty("DurationHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).DurationHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UtcOffset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).UtcOffset = (string) content.GetValueForProperty("UtcOffset",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).UtcOffset, global::System.Convert.ToString); + } + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("NotAllowedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).NotAllowedDate = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[]) content.GetValueForProperty("NotAllowedDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).NotAllowedDate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DateSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleDaily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleDaily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule) content.GetValueForProperty("ScheduleDaily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleDaily, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleWeekly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleWeekly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule) content.GetValueForProperty("ScheduleWeekly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleWeekly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleAbsoluteMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleAbsoluteMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule) content.GetValueForProperty("ScheduleAbsoluteMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleAbsoluteMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleRelativeMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleRelativeMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule) content.GetValueForProperty("ScheduleRelativeMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleRelativeMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DailyIntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).DailyIntervalDay = (int) content.GetValueForProperty("DailyIntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).DailyIntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyIntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).WeeklyIntervalWeek = (int) content.GetValueForProperty("WeeklyIntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).WeeklyIntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).WeeklyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("WeeklyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).WeeklyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("AbsoluteMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).AbsoluteMonthlyIntervalMonth = (int) content.GetValueForProperty("AbsoluteMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).AbsoluteMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AbsoluteMonthlyDayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).AbsoluteMonthlyDayOfMonth = (int) content.GetValueForProperty("AbsoluteMonthlyDayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).AbsoluteMonthlyDayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyIntervalMonth = (int) content.GetValueForProperty("RelativeMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyWeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyWeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("RelativeMonthlyWeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyWeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("RelativeMonthlyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("RelativeMonthlyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MaintenanceWindow(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DurationHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).DurationHour = (int) content.GetValueForProperty("DurationHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).DurationHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UtcOffset")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).UtcOffset = (string) content.GetValueForProperty("UtcOffset",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).UtcOffset, global::System.Convert.ToString); + } + if (content.Contains("StartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("NotAllowedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).NotAllowedDate = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[]) content.GetValueForProperty("NotAllowedDate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).NotAllowedDate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DateSpanTypeConverter.ConvertFrom)); + } + if (content.Contains("ScheduleDaily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleDaily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule) content.GetValueForProperty("ScheduleDaily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleDaily, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleWeekly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleWeekly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule) content.GetValueForProperty("ScheduleWeekly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleWeekly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleAbsoluteMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleAbsoluteMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule) content.GetValueForProperty("ScheduleAbsoluteMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleAbsoluteMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleRelativeMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleRelativeMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule) content.GetValueForProperty("ScheduleRelativeMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).ScheduleRelativeMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DailyIntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).DailyIntervalDay = (int) content.GetValueForProperty("DailyIntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).DailyIntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyIntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).WeeklyIntervalWeek = (int) content.GetValueForProperty("WeeklyIntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).WeeklyIntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).WeeklyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("WeeklyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).WeeklyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("AbsoluteMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).AbsoluteMonthlyIntervalMonth = (int) content.GetValueForProperty("AbsoluteMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).AbsoluteMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AbsoluteMonthlyDayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).AbsoluteMonthlyDayOfMonth = (int) content.GetValueForProperty("AbsoluteMonthlyDayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).AbsoluteMonthlyDayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyIntervalMonth = (int) content.GetValueForProperty("RelativeMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyWeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyWeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("RelativeMonthlyWeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyWeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("RelativeMonthlyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("RelativeMonthlyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal)this).RelativeMonthlyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + [System.ComponentModel.TypeConverter(typeof(MaintenanceWindowTypeConverter))] + public partial interface IMaintenanceWindow + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.TypeConverter.cs new file mode 100644 index 000000000000..e01760ffeb33 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MaintenanceWindowTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMaintenanceWindow ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MaintenanceWindow.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MaintenanceWindow.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MaintenanceWindow.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.cs new file mode 100644 index 000000000000..5abed6ebc380 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.cs @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + /// + public partial class MaintenanceWindow : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal + { + + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? AbsoluteMonthlyDayOfMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).AbsoluteMonthlyDayOfMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).AbsoluteMonthlyDayOfMonth = value ?? default(int); } + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? AbsoluteMonthlyIntervalMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).AbsoluteMonthlyIntervalMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).AbsoluteMonthlyIntervalMonth = value ?? default(int); } + + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? DailyIntervalDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).DailyIntervalDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).DailyIntervalDay = value ?? default(int); } + + /// Backing field for property. + private int _durationHour; + + /// Length of maintenance window range from 4 to 24 hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int DurationHour { get => this._durationHour; set => this._durationHour = value; } + + /// Internal Acessors for Schedule + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal.Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Schedule()); set { {_schedule = value;} } } + + /// Internal Acessors for ScheduleAbsoluteMonthly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal.ScheduleAbsoluteMonthly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).AbsoluteMonthly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).AbsoluteMonthly = value; } + + /// Internal Acessors for ScheduleDaily + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal.ScheduleDaily { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).Daily; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).Daily = value; } + + /// Internal Acessors for ScheduleRelativeMonthly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal.ScheduleRelativeMonthly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).RelativeMonthly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).RelativeMonthly = value; } + + /// Internal Acessors for ScheduleWeekly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindowInternal.ScheduleWeekly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).Weekly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).Weekly = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] _notAllowedDate; + + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] NotAllowedDate { get => this._notAllowedDate; set => this._notAllowedDate = value; } + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).RelativeMonthlyDayOfWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).RelativeMonthlyDayOfWeek = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); } + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? RelativeMonthlyIntervalMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).RelativeMonthlyIntervalMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).RelativeMonthlyIntervalMonth = value ?? default(int); } + + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).RelativeMonthlyWeekIndex; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).RelativeMonthlyWeekIndex = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule _schedule; + + /// Recurrence schedule for the maintenance window. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Schedule()); set => this._schedule = value; } + + /// Backing field for property. + private global::System.DateTime? _startDate; + + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime? StartDate { get => this._startDate; set => this._startDate = value; } + + /// Backing field for property. + private string _startTime; + + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private string _utcOffset; + + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string UtcOffset { get => this._utcOffset; set => this._utcOffset = value; } + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).WeeklyDayOfWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).WeeklyDayOfWeek = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); } + + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? WeeklyIntervalWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).WeeklyIntervalWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)Schedule).WeeklyIntervalWeek = value ?? default(int); } + + /// Creates an new instance. + public MaintenanceWindow() + { + + } + } + /// Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + public partial interface IMaintenanceWindow : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date of the month.", + SerializedName = @"dayOfMonth", + PossibleTypes = new [] { typeof(int) })] + int? AbsoluteMonthlyDayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int? AbsoluteMonthlyIntervalMonth { get; set; } + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of days between each set of occurrences.", + SerializedName = @"intervalDays", + PossibleTypes = new [] { typeof(int) })] + int? DailyIntervalDay { get; set; } + /// Length of maintenance window range from 4 to 24 hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Length of maintenance window range from 4 to 24 hours.", + SerializedName = @"durationHours", + PossibleTypes = new [] { typeof(int) })] + int DurationHour { get; set; } + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time.", + SerializedName = @"notAllowedDates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] NotAllowedDate { get; set; } + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int? RelativeMonthlyIntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.", + SerializedName = @"weekIndex", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get; set; } + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartDate { get; set; } + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string StartTime { get; set; } + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'.", + SerializedName = @"utcOffset", + PossibleTypes = new [] { typeof(string) })] + string UtcOffset { get; set; } + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of weeks between each set of occurrences.", + SerializedName = @"intervalWeeks", + PossibleTypes = new [] { typeof(int) })] + int? WeeklyIntervalWeek { get; set; } + + } + /// Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + internal partial interface IMaintenanceWindowInternal + + { + /// The date of the month. + int? AbsoluteMonthlyDayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + int? AbsoluteMonthlyIntervalMonth { get; set; } + /// Specifies the number of days between each set of occurrences. + int? DailyIntervalDay { get; set; } + /// Length of maintenance window range from 4 to 24 hours. + int DurationHour { get; set; } + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] NotAllowedDate { get; set; } + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + int? RelativeMonthlyIntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get; set; } + /// Recurrence schedule for the maintenance window. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule Schedule { get; set; } + /// + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule ScheduleAbsoluteMonthly { get; set; } + /// For schedules like: 'recur every day' or 'recur every 3 days'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule ScheduleDaily { get; set; } + /// + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule ScheduleRelativeMonthly { get; set; } + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule ScheduleWeekly { get; set; } + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + global::System.DateTime? StartDate { get; set; } + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + string StartTime { get; set; } + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + string UtcOffset { get; set; } + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + int? WeeklyIntervalWeek { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.json.cs new file mode 100644 index 000000000000..41ef40a1f268 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MaintenanceWindow.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + /// + public partial class MaintenanceWindow + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceWindow FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MaintenanceWindow(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MaintenanceWindow(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_schedule = If( json?.PropertyT("schedule"), out var __jsonSchedule) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Schedule.FromJson(__jsonSchedule) : Schedule;} + {_durationHour = If( json?.PropertyT("durationHours"), out var __jsonDurationHours) ? (int)__jsonDurationHours : DurationHour;} + {_utcOffset = If( json?.PropertyT("utcOffset"), out var __jsonUtcOffset) ? (string)__jsonUtcOffset : (string)UtcOffset;} + {_startDate = If( json?.PropertyT("startDate"), out var __jsonStartDate) ? global::System.DateTime.TryParse((string)__jsonStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateValue) ? __jsonStartDateValue : StartDate : StartDate;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? (string)__jsonStartTime : (string)StartTime;} + {_notAllowedDate = If( json?.PropertyT("notAllowedDates"), out var __jsonNotAllowedDates) ? If( __jsonNotAllowedDates as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IDateSpan) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DateSpan.FromJson(__u) )) ))() : null : NotAllowedDate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._schedule ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._schedule.ToJson(null,serializationMode) : null, "schedule" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber(this._durationHour), "durationHours" ,container.Add ); + AddIf( null != (((object)this._utcOffset)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._utcOffset.ToString()) : null, "utcOffset" ,container.Add ); + AddIf( null != this._startDate ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._startDate?.ToString(@"yyyy-MM-dd",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startDate" ,container.Add ); + AddIf( null != (((object)this._startTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._startTime.ToString()) : null, "startTime" ,container.Add ); + if (null != this._notAllowedDate) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._notAllowedDate ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("notAllowedDates",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.PowerShell.cs new file mode 100644 index 000000000000..7167d0a0409a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.PowerShell.cs @@ -0,0 +1,1930 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterTypeConverter))] + public partial class ManagedCluster + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedCluster(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedCluster(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedCluster(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("IdentityDelegatedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityDelegatedResource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources) content.GetValueForProperty("IdentityDelegatedResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityDelegatedResource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResourcesTypeConverter.ConvertFrom); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("SafeguardsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile) content.GetValueForProperty("SafeguardsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.CreateFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile) content.GetValueForProperty("LinuxProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceLinuxProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ServicePrincipalProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile) content.GetValueForProperty("ServicePrincipalProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PodIdentityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile) content.GetValueForProperty("PodIdentityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("OidcIssuerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile) content.GetValueForProperty("OidcIssuerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterOidcIssuerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NodeResourceGroupProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroupProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile) content.GetValueForProperty("NodeResourceGroupProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroupProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeResourceGroupProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AadProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile) content.GetValueForProperty("AadProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AutoUpgradeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile) content.GetValueForProperty("AutoUpgradeProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAutoUpgradeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ClusterUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoScalerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile) content.GetValueForProperty("AutoScalerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAutoScalerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ApiServerAccessProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile) content.GetValueForProperty("ApiServerAccessProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterApiServerAccessProfileTypeConverter.ConvertFrom); + } + if (content.Contains("HttpProxyConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig) content.GetValueForProperty("HttpProxyConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterHttpProxyConfigTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("IngressProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IngressProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile) content.GetValueForProperty("IngressProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IngressProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile) content.GetValueForProperty("WorkloadAutoScalerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile) content.GetValueForProperty("AzureMonitorProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceMeshProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile) content.GetValueForProperty("ServiceMeshProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ServiceMeshProfileTypeConverter.ConvertFrom); + } + if (content.Contains("MetricsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile) content.GetValueForProperty("MetricsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterMetricsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AiToolchainOperatorProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AiToolchainOperatorProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile) content.GetValueForProperty("AiToolchainOperatorProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AiToolchainOperatorProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAiToolchainOperatorProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NodeProvisioningProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeProvisioningProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile) content.GetValueForProperty("NodeProvisioningProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeProvisioningProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeProvisioningProfileTypeConverter.ConvertFrom); + } + if (content.Contains("BootstrapProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile) content.GetValueForProperty("BootstrapProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterBootstrapProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MaxAgentPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MaxAgentPool = (int?) content.GetValueForProperty("MaxAgentPool",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MaxAgentPool, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CurrentKubernetesVersion = (string) content.GetValueForProperty("CurrentKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CurrentKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("DnsPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DnsPrefix = (string) content.GetValueForProperty("DnsPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DnsPrefix, global::System.Convert.ToString); + } + if (content.Contains("FqdnSubdomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).FqdnSubdomain = (string) content.GetValueForProperty("FqdnSubdomain",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).FqdnSubdomain, global::System.Convert.ToString); + } + if (content.Contains("Fqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Fqdn = (string) content.GetValueForProperty("Fqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Fqdn, global::System.Convert.ToString); + } + if (content.Contains("PrivateFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PrivateFqdn = (string) content.GetValueForProperty("PrivateFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PrivateFqdn, global::System.Convert.ToString); + } + if (content.Contains("AzurePortalFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzurePortalFqdn = (string) content.GetValueForProperty("AzurePortalFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzurePortalFqdn, global::System.Convert.ToString); + } + if (content.Contains("AgentPoolProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AgentPoolProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[]) content.GetValueForProperty("AgentPoolProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AgentPoolProfile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("AddonProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AddonProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles) content.GetValueForProperty("AddonProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AddonProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAddonProfilesTypeConverter.ConvertFrom); + } + if (content.Contains("NodeResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroup = (string) content.GetValueForProperty("NodeResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("EnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnableRbac = (bool?) content.GetValueForProperty("EnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SupportPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SupportPlan = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan?) content.GetValueForProperty("SupportPlan",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SupportPlan, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan.CreateFrom); + } + if (content.Contains("EnablePodSecurityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnablePodSecurityPolicy = (bool?) content.GetValueForProperty("EnablePodSecurityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnablePodSecurityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNamespaceResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnableNamespaceResource = (bool?) content.GetValueForProperty("EnableNamespaceResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnableNamespaceResource, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskEncryptionSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskEncryptionSetId = (string) content.GetValueForProperty("DiskEncryptionSetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskEncryptionSetId, global::System.Convert.ToString); + } + if (content.Contains("IdentityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile) content.GetValueForProperty("IdentityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesIdentityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PrivateLinkResource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[]) content.GetValueForProperty("PrivateLinkResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PrivateLinkResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DisableLocalAccount = (bool?) content.GetValueForProperty("DisableLocalAccount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DisableLocalAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("ResourceUid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ResourceUid = (string) content.GetValueForProperty("ResourceUid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ResourceUid, global::System.Convert.ToString); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("WindowProfileLicenseType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileLicenseType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType?) content.GetValueForProperty("WindowProfileLicenseType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileLicenseType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType.CreateFrom); + } + if (content.Contains("NodeResourceGroupProfileRestrictionLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroupProfileRestrictionLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel?) content.GetValueForProperty("NodeResourceGroupProfileRestrictionLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroupProfileRestrictionLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel.CreateFrom); + } + if (content.Contains("AutoUpgradeProfileUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfileUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel?) content.GetValueForProperty("AutoUpgradeProfileUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfileUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel.CreateFrom); + } + if (content.Contains("AutoScalerProfileExpander")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileExpander = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander?) content.GetValueForProperty("AutoScalerProfileExpander",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileExpander, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander.CreateFrom); + } + if (content.Contains("SafeguardProfileVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileVersion = (string) content.GetValueForProperty("SafeguardProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileVersion, global::System.Convert.ToString); + } + if (content.Contains("SafeguardProfileLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) content.GetValueForProperty("SafeguardProfileLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level.CreateFrom); + } + if (content.Contains("SafeguardProfileExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileExcludedNamespace = (string[]) content.GetValueForProperty("SafeguardProfileExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BootstrapProfileArtifactSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfileArtifactSource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource?) content.GetValueForProperty("BootstrapProfileArtifactSource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfileArtifactSource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource.CreateFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LinuxProfileSsh")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfileSsh = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration) content.GetValueForProperty("LinuxProfileSsh",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfileSsh, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxProfileAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfileAdminUsername = (string) content.GetValueForProperty("LinuxProfileAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfileAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileGmsaProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileGmsaProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile) content.GetValueForProperty("WindowProfileGmsaProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileGmsaProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WindowProfileAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileAdminUsername = (string) content.GetValueForProperty("WindowProfileAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileAdminPassword = (string) content.GetValueForProperty("WindowProfileAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileAdminPassword, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileEnableCsiProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileEnableCsiProxy = (bool?) content.GetValueForProperty("WindowProfileEnableCsiProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileEnableCsiProxy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServicePrincipalProfileClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfileClientId = (string) content.GetValueForProperty("ServicePrincipalProfileClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfileClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalProfileSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfileSecret = (string) content.GetValueForProperty("ServicePrincipalProfileSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfileSecret, global::System.Convert.ToString); + } + if (content.Contains("PodIdentityProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileEnabled = (bool?) content.GetValueForProperty("PodIdentityProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PodIdentityProfileAllowNetworkPluginKubenet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileAllowNetworkPluginKubenet = (bool?) content.GetValueForProperty("PodIdentityProfileAllowNetworkPluginKubenet",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileAllowNetworkPluginKubenet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PodIdentityProfileUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[]) content.GetValueForProperty("PodIdentityProfileUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileUserAssignedIdentity, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityTypeConverter.ConvertFrom)); + } + if (content.Contains("PodIdentityProfileUserAssignedIdentityException")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileUserAssignedIdentityException = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[]) content.GetValueForProperty("PodIdentityProfileUserAssignedIdentityException",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileUserAssignedIdentityException, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("OidcIssuerProfileIssuerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfileIssuerUrl = (string) content.GetValueForProperty("OidcIssuerProfileIssuerUrl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfileIssuerUrl, global::System.Convert.ToString); + } + if (content.Contains("OidcIssuerProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfileEnabled = (bool?) content.GetValueForProperty("OidcIssuerProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileManaged")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileManaged = (bool?) content.GetValueForProperty("AadProfileManaged",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileEnableAzureRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileEnableAzureRbac = (bool?) content.GetValueForProperty("AadProfileEnableAzureRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileEnableAzureRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileAdminGroupObjectID")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileAdminGroupObjectID = (string[]) content.GetValueForProperty("AadProfileAdminGroupObjectID",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileAdminGroupObjectID, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AadProfileClientAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileClientAppId = (string) content.GetValueForProperty("AadProfileClientAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileClientAppId, global::System.Convert.ToString); + } + if (content.Contains("AadProfileServerAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileServerAppId = (string) content.GetValueForProperty("AadProfileServerAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileServerAppId, global::System.Convert.ToString); + } + if (content.Contains("AadProfileServerAppSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileServerAppSecret = (string) content.GetValueForProperty("AadProfileServerAppSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileServerAppSecret, global::System.Convert.ToString); + } + if (content.Contains("AadProfileTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileTenantId = (string) content.GetValueForProperty("AadProfileTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileTenantId, global::System.Convert.ToString); + } + if (content.Contains("AutoUpgradeProfileNodeOSUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfileNodeOSUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel?) content.GetValueForProperty("AutoUpgradeProfileNodeOSUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfileNodeOSUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel.CreateFrom); + } + if (content.Contains("UpgradeSettingOverrideSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).UpgradeSettingOverrideSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings) content.GetValueForProperty("UpgradeSettingOverrideSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).UpgradeSettingOverrideSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoScalerProfileBalanceSimilarNodeGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileBalanceSimilarNodeGroup = (string) content.GetValueForProperty("AutoScalerProfileBalanceSimilarNodeGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileBalanceSimilarNodeGroup, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileDaemonsetEvictionForEmptyNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileDaemonsetEvictionForEmptyNode = (bool?) content.GetValueForProperty("AutoScalerProfileDaemonsetEvictionForEmptyNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileDaemonsetEvictionForEmptyNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileDaemonsetEvictionForOccupiedNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileDaemonsetEvictionForOccupiedNode = (bool?) content.GetValueForProperty("AutoScalerProfileDaemonsetEvictionForOccupiedNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileDaemonsetEvictionForOccupiedNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileIgnoreDaemonsetsUtilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileIgnoreDaemonsetsUtilization = (bool?) content.GetValueForProperty("AutoScalerProfileIgnoreDaemonsetsUtilization",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileIgnoreDaemonsetsUtilization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileMaxEmptyBulkDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxEmptyBulkDelete = (string) content.GetValueForProperty("AutoScalerProfileMaxEmptyBulkDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxEmptyBulkDelete, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxGracefulTerminationSec")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxGracefulTerminationSec = (string) content.GetValueForProperty("AutoScalerProfileMaxGracefulTerminationSec",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxGracefulTerminationSec, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxNodeProvisionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxNodeProvisionTime = (string) content.GetValueForProperty("AutoScalerProfileMaxNodeProvisionTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxNodeProvisionTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxTotalUnreadyPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxTotalUnreadyPercentage = (string) content.GetValueForProperty("AutoScalerProfileMaxTotalUnreadyPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxTotalUnreadyPercentage, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileNewPodScaleUpDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileNewPodScaleUpDelay = (string) content.GetValueForProperty("AutoScalerProfileNewPodScaleUpDelay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileNewPodScaleUpDelay, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileOkTotalUnreadyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileOkTotalUnreadyCount = (string) content.GetValueForProperty("AutoScalerProfileOkTotalUnreadyCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileOkTotalUnreadyCount, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScanInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScanInterval = (string) content.GetValueForProperty("AutoScalerProfileScanInterval",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScanInterval, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterAdd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterAdd = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterAdd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterAdd, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterDelete = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterDelete, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterFailure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterFailure = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterFailure",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterFailure, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUnneededTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUnneededTime = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUnneededTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUnneededTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUnreadyTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUnreadyTime = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUnreadyTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUnreadyTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUtilizationThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUtilizationThreshold = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUtilizationThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUtilizationThreshold, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileSkipNodesWithLocalStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileSkipNodesWithLocalStorage = (string) content.GetValueForProperty("AutoScalerProfileSkipNodesWithLocalStorage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileSkipNodesWithLocalStorage, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileSkipNodesWithSystemPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileSkipNodesWithSystemPod = (string) content.GetValueForProperty("AutoScalerProfileSkipNodesWithSystemPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileSkipNodesWithSystemPod, global::System.Convert.ToString); + } + if (content.Contains("ApiServerAccessProfileAuthorizedIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileAuthorizedIPRange = (string[]) content.GetValueForProperty("ApiServerAccessProfileAuthorizedIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileAuthorizedIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiServerAccessProfileEnablePrivateCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnablePrivateCluster = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnablePrivateCluster",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnablePrivateCluster, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfilePrivateDnsZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfilePrivateDnsZone = (string) content.GetValueForProperty("ApiServerAccessProfilePrivateDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfilePrivateDnsZone, global::System.Convert.ToString); + } + if (content.Contains("ApiServerAccessProfileEnablePrivateClusterPublicFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnablePrivateClusterPublicFqdn = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnablePrivateClusterPublicFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnablePrivateClusterPublicFqdn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileDisableRunCommand")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileDisableRunCommand = (bool?) content.GetValueForProperty("ApiServerAccessProfileDisableRunCommand",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileDisableRunCommand, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileEnableVnetIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnableVnetIntegration = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnableVnetIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnableVnetIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileSubnetId = (string) content.GetValueForProperty("ApiServerAccessProfileSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileSubnetId, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigHttpProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigHttpProxy = (string) content.GetValueForProperty("HttpProxyConfigHttpProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigHttpProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigHttpsProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigHttpsProxy = (string) content.GetValueForProperty("HttpProxyConfigHttpsProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigHttpsProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigNoProxy = (string[]) content.GetValueForProperty("HttpProxyConfigNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("HttpProxyConfigEffectiveNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigEffectiveNoProxy = (string[]) content.GetValueForProperty("HttpProxyConfigEffectiveNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigEffectiveNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("HttpProxyConfigTrustedCa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigTrustedCa = (string) content.GetValueForProperty("HttpProxyConfigTrustedCa",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigTrustedCa, global::System.Convert.ToString); + } + if (content.Contains("SecurityProfileDefender")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileDefender = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender) content.GetValueForProperty("SecurityProfileDefender",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileDefender, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileAzureKeyVaultKm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileAzureKeyVaultKm = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms) content.GetValueForProperty("SecurityProfileAzureKeyVaultKm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileAzureKeyVaultKm, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKmsTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileWorkloadIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileWorkloadIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity) content.GetValueForProperty("SecurityProfileWorkloadIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileWorkloadIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileImageCleaner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileImageCleaner = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner) content.GetValueForProperty("SecurityProfileImageCleaner",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileImageCleaner, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleanerTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileImageIntegrity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileImageIntegrity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity) content.GetValueForProperty("SecurityProfileImageIntegrity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileImageIntegrity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrityTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileNodeRestriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileNodeRestriction = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction) content.GetValueForProperty("SecurityProfileNodeRestriction",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileNodeRestriction, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestrictionTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileCustomCaTrustCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileCustomCaTrustCertificate = (byte[][]) content.GetValueForProperty("SecurityProfileCustomCaTrustCertificate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileCustomCaTrustCertificate, __y => TypeConverterExtensions.SelectToArray(__y, i => i)); + } + if (content.Contains("AzureKeyVaultKmKeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyId, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileDiskCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileDiskCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver) content.GetValueForProperty("StorageProfileDiskCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileDiskCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileFileCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileFileCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver) content.GetValueForProperty("StorageProfileFileCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileFileCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileSnapshotController")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileSnapshotController = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController) content.GetValueForProperty("StorageProfileSnapshotController",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileSnapshotController, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotControllerTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileBlobCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileBlobCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver) content.GetValueForProperty("StorageProfileBlobCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileBlobCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("IngressProfileWebAppRouting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IngressProfileWebAppRouting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting) content.GetValueForProperty("IngressProfileWebAppRouting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IngressProfileWebAppRouting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRoutingTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfileKeda")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfileKeda = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda) content.GetValueForProperty("WorkloadAutoScalerProfileKeda",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfileKeda, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKedaTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfileVerticalPodAutoscaler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfileVerticalPodAutoscaler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler) content.GetValueForProperty("WorkloadAutoScalerProfileVerticalPodAutoscaler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfileVerticalPodAutoscaler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTypeConverter.ConvertFrom); + } + if (content.Contains("VerticalPodAutoscalerAddonAutoscaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).VerticalPodAutoscalerAddonAutoscaling = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling?) content.GetValueForProperty("VerticalPodAutoscalerAddonAutoscaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).VerticalPodAutoscalerAddonAutoscaling, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling.CreateFrom); + } + if (content.Contains("AzureMonitorProfileMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics) content.GetValueForProperty("AzureMonitorProfileMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfileContainerInsight")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileContainerInsight = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights) content.GetValueForProperty("AzureMonitorProfileContainerInsight",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileContainerInsight, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsightsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfileAppMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileAppMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring) content.GetValueForProperty("AzureMonitorProfileAppMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileAppMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("SafeguardProfileSystemExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileSystemExcludedNamespace = (string[]) content.GetValueForProperty("SafeguardProfileSystemExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileSystemExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceMeshProfileIstio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfileIstio = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh) content.GetValueForProperty("ServiceMeshProfileIstio",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfileIstio, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMeshTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceMeshProfileMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfileMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) content.GetValueForProperty("ServiceMeshProfileMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfileMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode.CreateFrom); + } + if (content.Contains("IstioComponent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioComponent = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents) content.GetValueForProperty("IstioComponent",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioComponent, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponentsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioCertificateAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioCertificateAuthority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority) content.GetValueForProperty("IstioCertificateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioCertificateAuthority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("MetricProfileCostAnalysis")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricProfileCostAnalysis = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis) content.GetValueForProperty("MetricProfileCostAnalysis",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricProfileCostAnalysis, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysisTypeConverter.ConvertFrom); + } + if (content.Contains("AiToolchainOperatorProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AiToolchainOperatorProfileEnabled = (bool?) content.GetValueForProperty("AiToolchainOperatorProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AiToolchainOperatorProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeProvisioningProfileMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeProvisioningProfileMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode?) content.GetValueForProperty("NodeProvisioningProfileMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeProvisioningProfileMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode.CreateFrom); + } + if (content.Contains("BootstrapProfileContainerRegistryId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfileContainerRegistryId = (string) content.GetValueForProperty("BootstrapProfileContainerRegistryId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfileContainerRegistryId, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("GmsaProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileEnabled = (bool?) content.GetValueForProperty("GmsaProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GmsaProfileDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileDnsServer = (string) content.GetValueForProperty("GmsaProfileDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileDnsServer, global::System.Convert.ToString); + } + if (content.Contains("GmsaProfileRootDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileRootDomainName = (string) content.GetValueForProperty("GmsaProfileRootDomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileRootDomainName, global::System.Convert.ToString); + } + if (content.Contains("OverrideSettingForceUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OverrideSettingForceUpgrade = (bool?) content.GetValueForProperty("OverrideSettingForceUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OverrideSettingForceUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OverrideSettingUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OverrideSettingUntil = (global::System.DateTime?) content.GetValueForProperty("OverrideSettingUntil",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OverrideSettingUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DefenderSecurityMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DefenderSecurityMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring) content.GetValueForProperty("DefenderSecurityMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DefenderSecurityMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("DefenderLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DefenderLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("DefenderLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DefenderLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureKeyVaultKmEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmEnabled = (bool?) content.GetValueForProperty("AzureKeyVaultKmEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureKeyVaultKmKeyVaultNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes?) content.GetValueForProperty("AzureKeyVaultKmKeyVaultNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes.CreateFrom); + } + if (content.Contains("AzureKeyVaultKmKeyVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyVaultResourceId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("WorkloadIdentityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadIdentityEnabled = (bool?) content.GetValueForProperty("WorkloadIdentityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadIdentityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageCleanerEnabled = (bool?) content.GetValueForProperty("ImageCleanerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageCleanerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerIntervalHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageCleanerIntervalHour = (int?) content.GetValueForProperty("ImageCleanerIntervalHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageCleanerIntervalHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImageIntegrityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageIntegrityEnabled = (bool?) content.GetValueForProperty("ImageIntegrityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageIntegrityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeRestrictionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeRestrictionEnabled = (bool?) content.GetValueForProperty("NodeRestrictionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeRestrictionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskCsiDriverEnabled = (bool?) content.GetValueForProperty("DiskCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskCsiDriverVersion = (string) content.GetValueForProperty("DiskCsiDriverVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskCsiDriverVersion, global::System.Convert.ToString); + } + if (content.Contains("FileCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).FileCsiDriverEnabled = (bool?) content.GetValueForProperty("FileCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).FileCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SnapshotControllerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SnapshotControllerEnabled = (bool?) content.GetValueForProperty("SnapshotControllerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SnapshotControllerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BlobCsiDriverEnabled = (bool?) content.GetValueForProperty("BlobCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BlobCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("WebAppRoutingIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("WebAppRoutingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingEnabled = (bool?) content.GetValueForProperty("WebAppRoutingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingDnsZoneResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingDnsZoneResourceId = (string[]) content.GetValueForProperty("WebAppRoutingDnsZoneResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingDnsZoneResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KedaEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KedaEnabled = (bool) content.GetValueForProperty("KedaEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KedaEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VerticalPodAutoscalerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).VerticalPodAutoscalerEnabled = (bool) content.GetValueForProperty("VerticalPodAutoscalerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).VerticalPodAutoscalerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MetricKubeStateMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricKubeStateMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics) content.GetValueForProperty("MetricKubeStateMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricKubeStateMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("MetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricEnabled = (bool) content.GetValueForProperty("MetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightEnabled = (bool?) content.GetValueForProperty("ContainerInsightEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("ContainerInsightLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ContainerInsightSyslogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightSyslogPort = (long?) content.GetValueForProperty("ContainerInsightSyslogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightSyslogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ContainerInsightDisableCustomMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightDisableCustomMetric = (bool?) content.GetValueForProperty("ContainerInsightDisableCustomMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightDisableCustomMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightDisablePrometheusMetricsScraping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightDisablePrometheusMetricsScraping = (bool?) content.GetValueForProperty("ContainerInsightDisablePrometheusMetricsScraping",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightDisablePrometheusMetricsScraping, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AppMonitoringAutoInstrumentation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringAutoInstrumentation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) content.GetValueForProperty("AppMonitoringAutoInstrumentation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringAutoInstrumentation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringOpenTelemetryMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) content.GetValueForProperty("AppMonitoringOpenTelemetryMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringOpenTelemetryMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringOpenTelemetryLog = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) content.GetValueForProperty("AppMonitoringOpenTelemetryLog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringOpenTelemetryLog, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioRevision = (string[]) content.GetValueForProperty("IstioRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioRevision, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ComponentIngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ComponentIngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("ComponentIngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ComponentIngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("ComponentEgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ComponentEgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("ComponentEgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ComponentEgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("CostAnalysisEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CostAnalysisEnabled = (bool?) content.GetValueForProperty("CostAnalysisEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CostAnalysisEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityMonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityMonitoringEnabled = (bool?) content.GetValueForProperty("SecurityMonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityMonitoringEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityObjectId, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubeStateMetricLabelsAllowlist = (string) content.GetValueForProperty("KubeStateMetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubeStateMetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubeStateMetricAnnotationsAllowList = (string) content.GetValueForProperty("KubeStateMetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubeStateMetricAnnotationsAllowList, global::System.Convert.ToString); + } + if (content.Contains("AutoInstrumentationEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoInstrumentationEnabled = (bool?) content.GetValueForProperty("AutoInstrumentationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoInstrumentationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryMetricEnabled = (bool?) content.GetValueForProperty("OpenTelemetryMetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryMetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryMetricPort = (long?) content.GetValueForProperty("OpenTelemetryMetricPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryMetricPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("OpenTelemetryLogEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryLogEnabled = (bool?) content.GetValueForProperty("OpenTelemetryLogEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryLogEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryLogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryLogPort = (long?) content.GetValueForProperty("OpenTelemetryLogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryLogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CertificateAuthorityPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CertificateAuthorityPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("CertificateAuthorityPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CertificateAuthorityPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginCertChainObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedCluster(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("IdentityDelegatedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityDelegatedResource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources) content.GetValueForProperty("IdentityDelegatedResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityDelegatedResource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResourcesTypeConverter.ConvertFrom); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("SafeguardsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile) content.GetValueForProperty("SafeguardsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.CreateFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile) content.GetValueForProperty("LinuxProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceLinuxProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ServicePrincipalProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile) content.GetValueForProperty("ServicePrincipalProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PodIdentityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile) content.GetValueForProperty("PodIdentityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("OidcIssuerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile) content.GetValueForProperty("OidcIssuerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterOidcIssuerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NodeResourceGroupProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroupProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile) content.GetValueForProperty("NodeResourceGroupProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroupProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeResourceGroupProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AadProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile) content.GetValueForProperty("AadProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AutoUpgradeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile) content.GetValueForProperty("AutoUpgradeProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAutoUpgradeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ClusterUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoScalerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile) content.GetValueForProperty("AutoScalerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAutoScalerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ApiServerAccessProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile) content.GetValueForProperty("ApiServerAccessProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterApiServerAccessProfileTypeConverter.ConvertFrom); + } + if (content.Contains("HttpProxyConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig) content.GetValueForProperty("HttpProxyConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterHttpProxyConfigTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("IngressProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IngressProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile) content.GetValueForProperty("IngressProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IngressProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile) content.GetValueForProperty("WorkloadAutoScalerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile) content.GetValueForProperty("AzureMonitorProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceMeshProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile) content.GetValueForProperty("ServiceMeshProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ServiceMeshProfileTypeConverter.ConvertFrom); + } + if (content.Contains("MetricsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile) content.GetValueForProperty("MetricsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterMetricsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AiToolchainOperatorProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AiToolchainOperatorProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile) content.GetValueForProperty("AiToolchainOperatorProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AiToolchainOperatorProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAiToolchainOperatorProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NodeProvisioningProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeProvisioningProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile) content.GetValueForProperty("NodeProvisioningProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeProvisioningProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeProvisioningProfileTypeConverter.ConvertFrom); + } + if (content.Contains("BootstrapProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile) content.GetValueForProperty("BootstrapProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterBootstrapProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MaxAgentPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MaxAgentPool = (int?) content.GetValueForProperty("MaxAgentPool",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MaxAgentPool, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CurrentKubernetesVersion = (string) content.GetValueForProperty("CurrentKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CurrentKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("DnsPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DnsPrefix = (string) content.GetValueForProperty("DnsPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DnsPrefix, global::System.Convert.ToString); + } + if (content.Contains("FqdnSubdomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).FqdnSubdomain = (string) content.GetValueForProperty("FqdnSubdomain",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).FqdnSubdomain, global::System.Convert.ToString); + } + if (content.Contains("Fqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Fqdn = (string) content.GetValueForProperty("Fqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).Fqdn, global::System.Convert.ToString); + } + if (content.Contains("PrivateFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PrivateFqdn = (string) content.GetValueForProperty("PrivateFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PrivateFqdn, global::System.Convert.ToString); + } + if (content.Contains("AzurePortalFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzurePortalFqdn = (string) content.GetValueForProperty("AzurePortalFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzurePortalFqdn, global::System.Convert.ToString); + } + if (content.Contains("AgentPoolProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AgentPoolProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[]) content.GetValueForProperty("AgentPoolProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AgentPoolProfile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("AddonProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AddonProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles) content.GetValueForProperty("AddonProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AddonProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAddonProfilesTypeConverter.ConvertFrom); + } + if (content.Contains("NodeResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroup = (string) content.GetValueForProperty("NodeResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("EnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnableRbac = (bool?) content.GetValueForProperty("EnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SupportPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SupportPlan = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan?) content.GetValueForProperty("SupportPlan",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SupportPlan, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan.CreateFrom); + } + if (content.Contains("EnablePodSecurityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnablePodSecurityPolicy = (bool?) content.GetValueForProperty("EnablePodSecurityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnablePodSecurityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNamespaceResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnableNamespaceResource = (bool?) content.GetValueForProperty("EnableNamespaceResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).EnableNamespaceResource, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskEncryptionSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskEncryptionSetId = (string) content.GetValueForProperty("DiskEncryptionSetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskEncryptionSetId, global::System.Convert.ToString); + } + if (content.Contains("IdentityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile) content.GetValueForProperty("IdentityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesIdentityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PrivateLinkResource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[]) content.GetValueForProperty("PrivateLinkResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PrivateLinkResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DisableLocalAccount = (bool?) content.GetValueForProperty("DisableLocalAccount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DisableLocalAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("ResourceUid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ResourceUid = (string) content.GetValueForProperty("ResourceUid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ResourceUid, global::System.Convert.ToString); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("WindowProfileLicenseType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileLicenseType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType?) content.GetValueForProperty("WindowProfileLicenseType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileLicenseType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType.CreateFrom); + } + if (content.Contains("NodeResourceGroupProfileRestrictionLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroupProfileRestrictionLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel?) content.GetValueForProperty("NodeResourceGroupProfileRestrictionLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeResourceGroupProfileRestrictionLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel.CreateFrom); + } + if (content.Contains("AutoUpgradeProfileUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfileUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel?) content.GetValueForProperty("AutoUpgradeProfileUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfileUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel.CreateFrom); + } + if (content.Contains("AutoScalerProfileExpander")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileExpander = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander?) content.GetValueForProperty("AutoScalerProfileExpander",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileExpander, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander.CreateFrom); + } + if (content.Contains("SafeguardProfileVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileVersion = (string) content.GetValueForProperty("SafeguardProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileVersion, global::System.Convert.ToString); + } + if (content.Contains("SafeguardProfileLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) content.GetValueForProperty("SafeguardProfileLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level.CreateFrom); + } + if (content.Contains("SafeguardProfileExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileExcludedNamespace = (string[]) content.GetValueForProperty("SafeguardProfileExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BootstrapProfileArtifactSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfileArtifactSource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource?) content.GetValueForProperty("BootstrapProfileArtifactSource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfileArtifactSource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource.CreateFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LinuxProfileSsh")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfileSsh = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration) content.GetValueForProperty("LinuxProfileSsh",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfileSsh, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxProfileAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfileAdminUsername = (string) content.GetValueForProperty("LinuxProfileAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).LinuxProfileAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileGmsaProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileGmsaProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile) content.GetValueForProperty("WindowProfileGmsaProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileGmsaProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WindowProfileAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileAdminUsername = (string) content.GetValueForProperty("WindowProfileAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileAdminPassword = (string) content.GetValueForProperty("WindowProfileAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileAdminPassword, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileEnableCsiProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileEnableCsiProxy = (bool?) content.GetValueForProperty("WindowProfileEnableCsiProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WindowProfileEnableCsiProxy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServicePrincipalProfileClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfileClientId = (string) content.GetValueForProperty("ServicePrincipalProfileClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfileClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalProfileSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfileSecret = (string) content.GetValueForProperty("ServicePrincipalProfileSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServicePrincipalProfileSecret, global::System.Convert.ToString); + } + if (content.Contains("PodIdentityProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileEnabled = (bool?) content.GetValueForProperty("PodIdentityProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PodIdentityProfileAllowNetworkPluginKubenet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileAllowNetworkPluginKubenet = (bool?) content.GetValueForProperty("PodIdentityProfileAllowNetworkPluginKubenet",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileAllowNetworkPluginKubenet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PodIdentityProfileUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[]) content.GetValueForProperty("PodIdentityProfileUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileUserAssignedIdentity, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityTypeConverter.ConvertFrom)); + } + if (content.Contains("PodIdentityProfileUserAssignedIdentityException")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileUserAssignedIdentityException = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[]) content.GetValueForProperty("PodIdentityProfileUserAssignedIdentityException",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PodIdentityProfileUserAssignedIdentityException, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("OidcIssuerProfileIssuerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfileIssuerUrl = (string) content.GetValueForProperty("OidcIssuerProfileIssuerUrl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfileIssuerUrl, global::System.Convert.ToString); + } + if (content.Contains("OidcIssuerProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfileEnabled = (bool?) content.GetValueForProperty("OidcIssuerProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OidcIssuerProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileManaged")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileManaged = (bool?) content.GetValueForProperty("AadProfileManaged",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileEnableAzureRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileEnableAzureRbac = (bool?) content.GetValueForProperty("AadProfileEnableAzureRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileEnableAzureRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileAdminGroupObjectID")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileAdminGroupObjectID = (string[]) content.GetValueForProperty("AadProfileAdminGroupObjectID",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileAdminGroupObjectID, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AadProfileClientAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileClientAppId = (string) content.GetValueForProperty("AadProfileClientAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileClientAppId, global::System.Convert.ToString); + } + if (content.Contains("AadProfileServerAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileServerAppId = (string) content.GetValueForProperty("AadProfileServerAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileServerAppId, global::System.Convert.ToString); + } + if (content.Contains("AadProfileServerAppSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileServerAppSecret = (string) content.GetValueForProperty("AadProfileServerAppSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileServerAppSecret, global::System.Convert.ToString); + } + if (content.Contains("AadProfileTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileTenantId = (string) content.GetValueForProperty("AadProfileTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AadProfileTenantId, global::System.Convert.ToString); + } + if (content.Contains("AutoUpgradeProfileNodeOSUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfileNodeOSUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel?) content.GetValueForProperty("AutoUpgradeProfileNodeOSUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoUpgradeProfileNodeOSUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel.CreateFrom); + } + if (content.Contains("UpgradeSettingOverrideSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).UpgradeSettingOverrideSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings) content.GetValueForProperty("UpgradeSettingOverrideSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).UpgradeSettingOverrideSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoScalerProfileBalanceSimilarNodeGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileBalanceSimilarNodeGroup = (string) content.GetValueForProperty("AutoScalerProfileBalanceSimilarNodeGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileBalanceSimilarNodeGroup, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileDaemonsetEvictionForEmptyNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileDaemonsetEvictionForEmptyNode = (bool?) content.GetValueForProperty("AutoScalerProfileDaemonsetEvictionForEmptyNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileDaemonsetEvictionForEmptyNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileDaemonsetEvictionForOccupiedNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileDaemonsetEvictionForOccupiedNode = (bool?) content.GetValueForProperty("AutoScalerProfileDaemonsetEvictionForOccupiedNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileDaemonsetEvictionForOccupiedNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileIgnoreDaemonsetsUtilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileIgnoreDaemonsetsUtilization = (bool?) content.GetValueForProperty("AutoScalerProfileIgnoreDaemonsetsUtilization",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileIgnoreDaemonsetsUtilization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileMaxEmptyBulkDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxEmptyBulkDelete = (string) content.GetValueForProperty("AutoScalerProfileMaxEmptyBulkDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxEmptyBulkDelete, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxGracefulTerminationSec")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxGracefulTerminationSec = (string) content.GetValueForProperty("AutoScalerProfileMaxGracefulTerminationSec",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxGracefulTerminationSec, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxNodeProvisionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxNodeProvisionTime = (string) content.GetValueForProperty("AutoScalerProfileMaxNodeProvisionTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxNodeProvisionTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxTotalUnreadyPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxTotalUnreadyPercentage = (string) content.GetValueForProperty("AutoScalerProfileMaxTotalUnreadyPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileMaxTotalUnreadyPercentage, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileNewPodScaleUpDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileNewPodScaleUpDelay = (string) content.GetValueForProperty("AutoScalerProfileNewPodScaleUpDelay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileNewPodScaleUpDelay, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileOkTotalUnreadyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileOkTotalUnreadyCount = (string) content.GetValueForProperty("AutoScalerProfileOkTotalUnreadyCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileOkTotalUnreadyCount, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScanInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScanInterval = (string) content.GetValueForProperty("AutoScalerProfileScanInterval",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScanInterval, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterAdd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterAdd = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterAdd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterAdd, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterDelete = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterDelete, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterFailure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterFailure = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterFailure",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownDelayAfterFailure, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUnneededTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUnneededTime = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUnneededTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUnneededTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUnreadyTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUnreadyTime = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUnreadyTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUnreadyTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUtilizationThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUtilizationThreshold = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUtilizationThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileScaleDownUtilizationThreshold, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileSkipNodesWithLocalStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileSkipNodesWithLocalStorage = (string) content.GetValueForProperty("AutoScalerProfileSkipNodesWithLocalStorage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileSkipNodesWithLocalStorage, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileSkipNodesWithSystemPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileSkipNodesWithSystemPod = (string) content.GetValueForProperty("AutoScalerProfileSkipNodesWithSystemPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoScalerProfileSkipNodesWithSystemPod, global::System.Convert.ToString); + } + if (content.Contains("ApiServerAccessProfileAuthorizedIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileAuthorizedIPRange = (string[]) content.GetValueForProperty("ApiServerAccessProfileAuthorizedIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileAuthorizedIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiServerAccessProfileEnablePrivateCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnablePrivateCluster = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnablePrivateCluster",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnablePrivateCluster, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfilePrivateDnsZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfilePrivateDnsZone = (string) content.GetValueForProperty("ApiServerAccessProfilePrivateDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfilePrivateDnsZone, global::System.Convert.ToString); + } + if (content.Contains("ApiServerAccessProfileEnablePrivateClusterPublicFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnablePrivateClusterPublicFqdn = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnablePrivateClusterPublicFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnablePrivateClusterPublicFqdn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileDisableRunCommand")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileDisableRunCommand = (bool?) content.GetValueForProperty("ApiServerAccessProfileDisableRunCommand",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileDisableRunCommand, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileEnableVnetIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnableVnetIntegration = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnableVnetIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileEnableVnetIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileSubnetId = (string) content.GetValueForProperty("ApiServerAccessProfileSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ApiServerAccessProfileSubnetId, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigHttpProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigHttpProxy = (string) content.GetValueForProperty("HttpProxyConfigHttpProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigHttpProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigHttpsProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigHttpsProxy = (string) content.GetValueForProperty("HttpProxyConfigHttpsProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigHttpsProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigNoProxy = (string[]) content.GetValueForProperty("HttpProxyConfigNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("HttpProxyConfigEffectiveNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigEffectiveNoProxy = (string[]) content.GetValueForProperty("HttpProxyConfigEffectiveNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigEffectiveNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("HttpProxyConfigTrustedCa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigTrustedCa = (string) content.GetValueForProperty("HttpProxyConfigTrustedCa",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).HttpProxyConfigTrustedCa, global::System.Convert.ToString); + } + if (content.Contains("SecurityProfileDefender")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileDefender = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender) content.GetValueForProperty("SecurityProfileDefender",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileDefender, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileAzureKeyVaultKm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileAzureKeyVaultKm = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms) content.GetValueForProperty("SecurityProfileAzureKeyVaultKm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileAzureKeyVaultKm, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKmsTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileWorkloadIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileWorkloadIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity) content.GetValueForProperty("SecurityProfileWorkloadIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileWorkloadIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileImageCleaner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileImageCleaner = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner) content.GetValueForProperty("SecurityProfileImageCleaner",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileImageCleaner, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleanerTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileImageIntegrity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileImageIntegrity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity) content.GetValueForProperty("SecurityProfileImageIntegrity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileImageIntegrity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrityTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileNodeRestriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileNodeRestriction = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction) content.GetValueForProperty("SecurityProfileNodeRestriction",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileNodeRestriction, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestrictionTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileCustomCaTrustCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileCustomCaTrustCertificate = (byte[][]) content.GetValueForProperty("SecurityProfileCustomCaTrustCertificate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityProfileCustomCaTrustCertificate, __y => TypeConverterExtensions.SelectToArray(__y, i => i)); + } + if (content.Contains("AzureKeyVaultKmKeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyId, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileDiskCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileDiskCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver) content.GetValueForProperty("StorageProfileDiskCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileDiskCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileFileCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileFileCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver) content.GetValueForProperty("StorageProfileFileCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileFileCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileSnapshotController")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileSnapshotController = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController) content.GetValueForProperty("StorageProfileSnapshotController",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileSnapshotController, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotControllerTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileBlobCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileBlobCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver) content.GetValueForProperty("StorageProfileBlobCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).StorageProfileBlobCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("IngressProfileWebAppRouting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IngressProfileWebAppRouting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting) content.GetValueForProperty("IngressProfileWebAppRouting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IngressProfileWebAppRouting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRoutingTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfileKeda")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfileKeda = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda) content.GetValueForProperty("WorkloadAutoScalerProfileKeda",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfileKeda, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKedaTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfileVerticalPodAutoscaler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfileVerticalPodAutoscaler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler) content.GetValueForProperty("WorkloadAutoScalerProfileVerticalPodAutoscaler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadAutoScalerProfileVerticalPodAutoscaler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTypeConverter.ConvertFrom); + } + if (content.Contains("VerticalPodAutoscalerAddonAutoscaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).VerticalPodAutoscalerAddonAutoscaling = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling?) content.GetValueForProperty("VerticalPodAutoscalerAddonAutoscaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).VerticalPodAutoscalerAddonAutoscaling, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling.CreateFrom); + } + if (content.Contains("AzureMonitorProfileMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics) content.GetValueForProperty("AzureMonitorProfileMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfileContainerInsight")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileContainerInsight = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights) content.GetValueForProperty("AzureMonitorProfileContainerInsight",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileContainerInsight, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsightsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfileAppMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileAppMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring) content.GetValueForProperty("AzureMonitorProfileAppMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureMonitorProfileAppMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("SafeguardProfileSystemExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileSystemExcludedNamespace = (string[]) content.GetValueForProperty("SafeguardProfileSystemExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SafeguardProfileSystemExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceMeshProfileIstio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfileIstio = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh) content.GetValueForProperty("ServiceMeshProfileIstio",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfileIstio, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMeshTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceMeshProfileMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfileMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) content.GetValueForProperty("ServiceMeshProfileMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ServiceMeshProfileMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode.CreateFrom); + } + if (content.Contains("IstioComponent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioComponent = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents) content.GetValueForProperty("IstioComponent",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioComponent, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponentsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioCertificateAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioCertificateAuthority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority) content.GetValueForProperty("IstioCertificateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioCertificateAuthority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("MetricProfileCostAnalysis")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricProfileCostAnalysis = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis) content.GetValueForProperty("MetricProfileCostAnalysis",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricProfileCostAnalysis, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysisTypeConverter.ConvertFrom); + } + if (content.Contains("AiToolchainOperatorProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AiToolchainOperatorProfileEnabled = (bool?) content.GetValueForProperty("AiToolchainOperatorProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AiToolchainOperatorProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeProvisioningProfileMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeProvisioningProfileMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode?) content.GetValueForProperty("NodeProvisioningProfileMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeProvisioningProfileMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode.CreateFrom); + } + if (content.Contains("BootstrapProfileContainerRegistryId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfileContainerRegistryId = (string) content.GetValueForProperty("BootstrapProfileContainerRegistryId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BootstrapProfileContainerRegistryId, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("GmsaProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileEnabled = (bool?) content.GetValueForProperty("GmsaProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GmsaProfileDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileDnsServer = (string) content.GetValueForProperty("GmsaProfileDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileDnsServer, global::System.Convert.ToString); + } + if (content.Contains("GmsaProfileRootDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileRootDomainName = (string) content.GetValueForProperty("GmsaProfileRootDomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).GmsaProfileRootDomainName, global::System.Convert.ToString); + } + if (content.Contains("OverrideSettingForceUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OverrideSettingForceUpgrade = (bool?) content.GetValueForProperty("OverrideSettingForceUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OverrideSettingForceUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OverrideSettingUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OverrideSettingUntil = (global::System.DateTime?) content.GetValueForProperty("OverrideSettingUntil",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OverrideSettingUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DefenderSecurityMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DefenderSecurityMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring) content.GetValueForProperty("DefenderSecurityMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DefenderSecurityMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("DefenderLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DefenderLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("DefenderLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DefenderLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureKeyVaultKmEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmEnabled = (bool?) content.GetValueForProperty("AzureKeyVaultKmEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureKeyVaultKmKeyVaultNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes?) content.GetValueForProperty("AzureKeyVaultKmKeyVaultNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes.CreateFrom); + } + if (content.Contains("AzureKeyVaultKmKeyVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyVaultResourceId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AzureKeyVaultKmKeyVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("WorkloadIdentityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadIdentityEnabled = (bool?) content.GetValueForProperty("WorkloadIdentityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WorkloadIdentityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageCleanerEnabled = (bool?) content.GetValueForProperty("ImageCleanerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageCleanerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerIntervalHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageCleanerIntervalHour = (int?) content.GetValueForProperty("ImageCleanerIntervalHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageCleanerIntervalHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImageIntegrityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageIntegrityEnabled = (bool?) content.GetValueForProperty("ImageIntegrityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ImageIntegrityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeRestrictionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeRestrictionEnabled = (bool?) content.GetValueForProperty("NodeRestrictionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).NodeRestrictionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskCsiDriverEnabled = (bool?) content.GetValueForProperty("DiskCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskCsiDriverVersion = (string) content.GetValueForProperty("DiskCsiDriverVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).DiskCsiDriverVersion, global::System.Convert.ToString); + } + if (content.Contains("FileCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).FileCsiDriverEnabled = (bool?) content.GetValueForProperty("FileCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).FileCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SnapshotControllerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SnapshotControllerEnabled = (bool?) content.GetValueForProperty("SnapshotControllerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SnapshotControllerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BlobCsiDriverEnabled = (bool?) content.GetValueForProperty("BlobCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).BlobCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("WebAppRoutingIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("WebAppRoutingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingEnabled = (bool?) content.GetValueForProperty("WebAppRoutingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingDnsZoneResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingDnsZoneResourceId = (string[]) content.GetValueForProperty("WebAppRoutingDnsZoneResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).WebAppRoutingDnsZoneResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KedaEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KedaEnabled = (bool) content.GetValueForProperty("KedaEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KedaEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VerticalPodAutoscalerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).VerticalPodAutoscalerEnabled = (bool) content.GetValueForProperty("VerticalPodAutoscalerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).VerticalPodAutoscalerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MetricKubeStateMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricKubeStateMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics) content.GetValueForProperty("MetricKubeStateMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricKubeStateMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("MetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricEnabled = (bool) content.GetValueForProperty("MetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).MetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightEnabled = (bool?) content.GetValueForProperty("ContainerInsightEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("ContainerInsightLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ContainerInsightSyslogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightSyslogPort = (long?) content.GetValueForProperty("ContainerInsightSyslogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightSyslogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ContainerInsightDisableCustomMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightDisableCustomMetric = (bool?) content.GetValueForProperty("ContainerInsightDisableCustomMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightDisableCustomMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightDisablePrometheusMetricsScraping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightDisablePrometheusMetricsScraping = (bool?) content.GetValueForProperty("ContainerInsightDisablePrometheusMetricsScraping",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ContainerInsightDisablePrometheusMetricsScraping, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AppMonitoringAutoInstrumentation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringAutoInstrumentation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) content.GetValueForProperty("AppMonitoringAutoInstrumentation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringAutoInstrumentation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringOpenTelemetryMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) content.GetValueForProperty("AppMonitoringOpenTelemetryMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringOpenTelemetryMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringOpenTelemetryLog = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) content.GetValueForProperty("AppMonitoringOpenTelemetryLog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AppMonitoringOpenTelemetryLog, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioRevision = (string[]) content.GetValueForProperty("IstioRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IstioRevision, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ComponentIngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ComponentIngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("ComponentIngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ComponentIngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("ComponentEgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ComponentEgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("ComponentEgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).ComponentEgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("CostAnalysisEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CostAnalysisEnabled = (bool?) content.GetValueForProperty("CostAnalysisEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CostAnalysisEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityMonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityMonitoringEnabled = (bool?) content.GetValueForProperty("SecurityMonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).SecurityMonitoringEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).IdentityObjectId, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubeStateMetricLabelsAllowlist = (string) content.GetValueForProperty("KubeStateMetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubeStateMetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubeStateMetricAnnotationsAllowList = (string) content.GetValueForProperty("KubeStateMetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).KubeStateMetricAnnotationsAllowList, global::System.Convert.ToString); + } + if (content.Contains("AutoInstrumentationEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoInstrumentationEnabled = (bool?) content.GetValueForProperty("AutoInstrumentationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).AutoInstrumentationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryMetricEnabled = (bool?) content.GetValueForProperty("OpenTelemetryMetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryMetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryMetricPort = (long?) content.GetValueForProperty("OpenTelemetryMetricPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryMetricPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("OpenTelemetryLogEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryLogEnabled = (bool?) content.GetValueForProperty("OpenTelemetryLogEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryLogEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryLogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryLogPort = (long?) content.GetValueForProperty("OpenTelemetryLogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).OpenTelemetryLogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CertificateAuthorityPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CertificateAuthorityPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("CertificateAuthorityPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).CertificateAuthorityPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal)this).PluginCertChainObjectName, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterTypeConverter))] + public partial interface IManagedCluster + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.TypeConverter.cs new file mode 100644 index 000000000000..dbe139359c49 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedCluster ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedCluster.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedCluster.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedCluster.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.cs new file mode 100644 index 000000000000..cdfd4fb71320 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.cs @@ -0,0 +1,3230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Managed cluster. + public partial class ManagedCluster : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource(); + + /// The list of AAD group object IDs that will have admin role of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] AadProfileAdminGroupObjectID { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileAdminGroupObjectID; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileAdminGroupObjectID = value ?? null /* arrayOf */; } + + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AadProfileClientAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileClientAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileClientAppId = value ?? null; } + + /// Whether to enable Azure RBAC for Kubernetes authorization. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AadProfileEnableAzureRbac { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileEnableAzureRbac; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileEnableAzureRbac = value ?? default(bool); } + + /// Whether to enable managed AAD. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AadProfileManaged { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileManaged; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileManaged = value ?? default(bool); } + + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AadProfileServerAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileServerAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileServerAppId = value ?? null; } + + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AadProfileServerAppSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileServerAppSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileServerAppSecret = value ?? null; } + + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AadProfileTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfileTenantId = value ?? null; } + + /// The profile of managed cluster add-on. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles AddonProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AddonProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AddonProfile = value ?? null /* model class */; } + + /// The agent pool properties. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[] AgentPoolProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AgentPoolProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AgentPoolProfile = value ?? null /* arrayOf */; } + + /// Indicates if AI toolchain operator enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AiToolchainOperatorProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AiToolchainOperatorProfileEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AiToolchainOperatorProfileEnabled = value ?? default(bool); } + + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] ApiServerAccessProfileAuthorizedIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileAuthorizedIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileAuthorizedIPRange = value ?? null /* arrayOf */; } + + /// Whether to disable run command for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ApiServerAccessProfileDisableRunCommand { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileDisableRunCommand; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileDisableRunCommand = value ?? default(bool); } + + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ApiServerAccessProfileEnablePrivateCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileEnablePrivateCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileEnablePrivateCluster = value ?? default(bool); } + + /// Whether to create additional public FQDN for private cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ApiServerAccessProfileEnablePrivateClusterPublicFqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileEnablePrivateClusterPublicFqdn; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileEnablePrivateClusterPublicFqdn = value ?? default(bool); } + + /// Whether to enable apiserver vnet integration for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ApiServerAccessProfileEnableVnetIntegration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileEnableVnetIntegration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileEnableVnetIntegration = value ?? default(bool); } + + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ApiServerAccessProfilePrivateDnsZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfilePrivateDnsZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfilePrivateDnsZone = value ?? null; } + + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ApiServerAccessProfileSubnetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileSubnetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfileSubnetId = value ?? null; } + + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoInstrumentationEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoInstrumentationEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoInstrumentationEnabled = value ?? default(bool); } + + /// Valid values are 'true' and 'false' + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileBalanceSimilarNodeGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileBalanceSimilarNodeGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileBalanceSimilarNodeGroup = value ?? null; } + + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoScalerProfileDaemonsetEvictionForEmptyNode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileDaemonsetEvictionForEmptyNode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileDaemonsetEvictionForEmptyNode = value ?? default(bool); } + + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoScalerProfileDaemonsetEvictionForOccupiedNode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileDaemonsetEvictionForOccupiedNode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileDaemonsetEvictionForOccupiedNode = value ?? default(bool); } + + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? AutoScalerProfileExpander { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileExpander; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileExpander = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander)""); } + + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoScalerProfileIgnoreDaemonsetsUtilization { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileIgnoreDaemonsetsUtilization; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileIgnoreDaemonsetsUtilization = value ?? default(bool); } + + /// The default is 10. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileMaxEmptyBulkDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileMaxEmptyBulkDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileMaxEmptyBulkDelete = value ?? null; } + + /// The default is 600. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileMaxGracefulTerminationSec { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileMaxGracefulTerminationSec; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileMaxGracefulTerminationSec = value ?? null; } + + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileMaxNodeProvisionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileMaxNodeProvisionTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileMaxNodeProvisionTime = value ?? null; } + + /// The default is 45. The maximum is 100 and the minimum is 0. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileMaxTotalUnreadyPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileMaxTotalUnreadyPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileMaxTotalUnreadyPercentage = value ?? null; } + + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileNewPodScaleUpDelay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileNewPodScaleUpDelay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileNewPodScaleUpDelay = value ?? null; } + + /// This must be an integer. The default is 3. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileOkTotalUnreadyCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileOkTotalUnreadyCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileOkTotalUnreadyCount = value ?? null; } + + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownDelayAfterAdd { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownDelayAfterAdd; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownDelayAfterAdd = value ?? null; } + + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownDelayAfterDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownDelayAfterDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownDelayAfterDelete = value ?? null; } + + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownDelayAfterFailure { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownDelayAfterFailure; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownDelayAfterFailure = value ?? null; } + + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownUnneededTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownUnneededTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownUnneededTime = value ?? null; } + + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownUnreadyTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownUnreadyTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownUnreadyTime = value ?? null; } + + /// The default is '0.5'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownUtilizationThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownUtilizationThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScaleDownUtilizationThreshold = value ?? null; } + + /// The default is '10'. Values must be an integer number of seconds. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScanInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScanInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileScanInterval = value ?? null; } + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileSkipNodesWithLocalStorage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileSkipNodesWithLocalStorage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileSkipNodesWithLocalStorage = value ?? null; } + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileSkipNodesWithSystemPod { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileSkipNodesWithSystemPod; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfileSkipNodesWithSystemPod = value ?? null; } + + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? AutoUpgradeProfileNodeOSUpgradeChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoUpgradeProfileNodeOSUpgradeChannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoUpgradeProfileNodeOSUpgradeChannel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel)""); } + + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? AutoUpgradeProfileUpgradeChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoUpgradeProfileUpgradeChannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoUpgradeProfileUpgradeChannel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel)""); } + + /// Whether to enable Azure Key Vault key management service. The default is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AzureKeyVaultKmEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureKeyVaultKmEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureKeyVaultKmEnabled = value ?? default(bool); } + + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AzureKeyVaultKmKeyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureKeyVaultKmKeyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureKeyVaultKmKeyId = value ?? null; } + + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? AzureKeyVaultKmKeyVaultNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureKeyVaultKmKeyVaultNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureKeyVaultKmKeyVaultNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes)""); } + + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AzureKeyVaultKmKeyVaultResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureKeyVaultKmKeyVaultResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureKeyVaultKmKeyVaultResourceId = value ?? null; } + + /// + /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes + /// APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AzurePortalFqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzurePortalFqdn; } + + /// Whether to enable AzureBlob CSI Driver. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? BlobCsiDriverEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).BlobCsiDriverEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).BlobCsiDriverEnabled = value ?? default(bool); } + + /// The source where the artifacts are downloaded from. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? BootstrapProfileArtifactSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).BootstrapProfileArtifactSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).BootstrapProfileArtifactSource = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource)""); } + + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string BootstrapProfileContainerRegistryId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).BootstrapProfileContainerRegistryId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).BootstrapProfileContainerRegistryId = value ?? null; } + + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ComponentEgressGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ComponentEgressGateway = value ?? null /* arrayOf */; } + + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ComponentIngressGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ComponentIngressGateway = value ?? null /* arrayOf */; } + + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ContainerInsightDisableCustomMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightDisableCustomMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightDisableCustomMetric = value ?? default(bool); } + + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ContainerInsightDisablePrometheusMetricsScraping { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightDisablePrometheusMetricsScraping; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightDisablePrometheusMetricsScraping = value ?? default(bool); } + + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ContainerInsightEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightEnabled = value ?? default(bool); } + + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ContainerInsightLogAnalyticsWorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightLogAnalyticsWorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightLogAnalyticsWorkspaceResourceId = value ?? null; } + + /// The syslog host port. If not specified, the default port is 28330. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? ContainerInsightSyslogPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightSyslogPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ContainerInsightSyslogPort = value ?? default(long); } + + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? CostAnalysisEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CostAnalysisEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CostAnalysisEnabled = value ?? default(bool); } + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CreationDataSourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CreationDataSourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CreationDataSourceResourceId = value ?? null; } + + /// The version of Kubernetes the Managed Cluster is running. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CurrentKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CurrentKubernetesVersion; } + + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DefenderLogAnalyticsWorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DefenderLogAnalyticsWorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DefenderLogAnalyticsWorkspaceResourceId = value ?? null; } + + /// + /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + /// that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? DisableLocalAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DisableLocalAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DisableLocalAccount = value ?? default(bool); } + + /// Whether to enable AzureDisk CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? DiskCsiDriverEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DiskCsiDriverEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DiskCsiDriverEnabled = value ?? default(bool); } + + /// The version of AzureDisk CSI Driver. The default value is v1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DiskCsiDriverVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DiskCsiDriverVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DiskCsiDriverVersion = value ?? null; } + + /// + /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DiskEncryptionSetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DiskEncryptionSetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DiskEncryptionSetId = value ?? null; } + + /// This cannot be updated once the Managed Cluster has been created. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DnsPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DnsPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DnsPrefix = value ?? null; } + + /// Backing field for property. + private string _eTag; + + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; } + + /// + /// The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) + /// for more details on Namespace as a ARM Resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnableNamespaceResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).EnableNamespaceResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).EnableNamespaceResource = value ?? default(bool); } + + /// + /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes + /// v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnablePodSecurityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).EnablePodSecurityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).EnablePodSecurityPolicy = value ?? default(bool); } + + /// Whether to enable Kubernetes Role-Based Access Control. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnableRbac { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).EnableRbac; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).EnableRbac = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation _extendedLocation; + + /// The extended location of the Virtual Machine. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes? ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocationInternal)ExtendedLocation).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes)""); } + + /// Whether to enable AzureFile CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? FileCsiDriverEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).FileCsiDriverEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).FileCsiDriverEnabled = value ?? default(bool); } + + /// The FQDN of the master pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Fqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).Fqdn; } + + /// This cannot be updated once the Managed Cluster has been created. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string FqdnSubdomain { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).FqdnSubdomain; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).FqdnSubdomain = value ?? null; } + + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string GmsaProfileDnsServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).GmsaProfileDnsServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).GmsaProfileDnsServer = value ?? null; } + + /// Specifies whether to enable Windows gMSA in the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? GmsaProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).GmsaProfileEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).GmsaProfileEnabled = value ?? default(bool); } + + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string GmsaProfileRootDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).GmsaProfileRootDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).GmsaProfileRootDomainName = value ?? null; } + + /// + /// A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy + /// and values injected by AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] HttpProxyConfigEffectiveNoProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigEffectiveNoProxy; } + + /// The HTTP proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string HttpProxyConfigHttpProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigHttpProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigHttpProxy = value ?? null; } + + /// The HTTPS proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string HttpProxyConfigHttpsProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigHttpsProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigHttpsProxy = value ?? null; } + + /// The endpoints that should not go through proxy. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] HttpProxyConfigNoProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigNoProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigNoProxy = value ?? null /* arrayOf */; } + + /// Alternative CA cert to use for connecting to proxy servers. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string HttpProxyConfigTrustedCa { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigTrustedCa; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigTrustedCa = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity _identity; + + /// The identity of the managed cluster, if configured. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentity()); set => this._identity = value; } + + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IdentityClientId = value ?? null; } + + /// + /// The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, + /// and managed cluster only accept one delegated identity resource. Internal use only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources IdentityDelegatedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).DelegatedResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).DelegatedResource = value ?? null /* model class */; } + + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IdentityObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IdentityObjectId = value ?? null; } + + /// + /// The principal id of the system assigned identity which is used by master components. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).PrincipalId; } + + /// Identities associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile IdentityProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IdentityProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IdentityProfile = value ?? null /* model class */; } + + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IdentityResourceId = value ?? null; } + + /// + /// The tenant id of the system assigned identity which is used by master components. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).TenantId; } + + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType)""); } + + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// Whether to enable Image Cleaner on AKS cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ImageCleanerEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ImageCleanerEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ImageCleanerEnabled = value ?? default(bool); } + + /// Image Cleaner scanning interval in hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ImageCleanerIntervalHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ImageCleanerIntervalHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ImageCleanerIntervalHour = value ?? default(int); } + + /// Whether to enable image integrity. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ImageIntegrityEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ImageIntegrityEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ImageIntegrityEnabled = value ?? default(bool); } + + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] IstioRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IstioRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IstioRevision = value ?? null /* arrayOf */; } + + /// Whether to enable KEDA. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? KedaEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).KedaEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).KedaEnabled = value ?? default(bool); } + + /// Backing field for property. + private string _kind; + + /// + /// This is primarily used to expose different UI experiences in the portal for different kinds + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Kind { get => this._kind; set => this._kind = value; } + + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeStateMetricAnnotationsAllowList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).KubeStateMetricAnnotationsAllowList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).KubeStateMetricAnnotationsAllowList = value ?? null; } + + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeStateMetricLabelsAllowlist { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).KubeStateMetricLabelsAllowlist; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).KubeStateMetricLabelsAllowlist = value ?? null; } + + /// + /// When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed + /// sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + /// however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).KubernetesVersion = value ?? null; } + + /// The administrator username to use for Linux VMs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string LinuxProfileAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).LinuxProfileAdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).LinuxProfileAdminUsername = value ?? null; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// The max number of agent pools for the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? MaxAgentPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MaxAgentPool; } + + /// Whether to enable the Prometheus collector + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? MetricEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MetricEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MetricEnabled = value ?? default(bool); } + + /// Internal Acessors for AadProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AadProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AadProfile = value; } + + /// Internal Acessors for AiToolchainOperatorProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AiToolchainOperatorProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AiToolchainOperatorProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AiToolchainOperatorProfile = value; } + + /// Internal Acessors for ApiServerAccessProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.ApiServerAccessProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ApiServerAccessProfile = value; } + + /// Internal Acessors for AppMonitoringAutoInstrumentation + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AppMonitoringAutoInstrumentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AppMonitoringAutoInstrumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AppMonitoringAutoInstrumentation = value; } + + /// Internal Acessors for AppMonitoringOpenTelemetryLog + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AppMonitoringOpenTelemetryLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AppMonitoringOpenTelemetryLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AppMonitoringOpenTelemetryLog = value; } + + /// Internal Acessors for AppMonitoringOpenTelemetryMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AppMonitoringOpenTelemetryMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AppMonitoringOpenTelemetryMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AppMonitoringOpenTelemetryMetric = value; } + + /// Internal Acessors for AutoScalerProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AutoScalerProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoScalerProfile = value; } + + /// Internal Acessors for AutoUpgradeProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AutoUpgradeProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoUpgradeProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AutoUpgradeProfile = value; } + + /// Internal Acessors for AzureMonitorProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AzureMonitorProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureMonitorProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureMonitorProfile = value; } + + /// Internal Acessors for AzureMonitorProfileAppMonitoring + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AzureMonitorProfileAppMonitoring { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureMonitorProfileAppMonitoring; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureMonitorProfileAppMonitoring = value; } + + /// Internal Acessors for AzureMonitorProfileContainerInsight + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AzureMonitorProfileContainerInsight { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureMonitorProfileContainerInsight; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureMonitorProfileContainerInsight = value; } + + /// Internal Acessors for AzureMonitorProfileMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AzureMonitorProfileMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureMonitorProfileMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzureMonitorProfileMetric = value; } + + /// Internal Acessors for AzurePortalFqdn + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.AzurePortalFqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzurePortalFqdn; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).AzurePortalFqdn = value; } + + /// Internal Acessors for BootstrapProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.BootstrapProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).BootstrapProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).BootstrapProfile = value; } + + /// Internal Acessors for CertificateAuthorityPlugin + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.CertificateAuthorityPlugin { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CertificateAuthorityPlugin; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CertificateAuthorityPlugin = value; } + + /// Internal Acessors for CreationData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.CreationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CreationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CreationData = value; } + + /// Internal Acessors for CurrentKubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.CurrentKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CurrentKubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).CurrentKubernetesVersion = value; } + + /// Internal Acessors for DefenderSecurityMonitoring + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.DefenderSecurityMonitoring { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DefenderSecurityMonitoring; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).DefenderSecurityMonitoring = value; } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.ETag { get => this._eTag; set { {_eTag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for Fqdn + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.Fqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).Fqdn; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).Fqdn = value; } + + /// Internal Acessors for HttpProxyConfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.HttpProxyConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfig = value; } + + /// Internal Acessors for HttpProxyConfigEffectiveNoProxy + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.HttpProxyConfigEffectiveNoProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigEffectiveNoProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).HttpProxyConfigEffectiveNoProxy = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for IngressProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.IngressProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IngressProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IngressProfile = value; } + + /// Internal Acessors for IngressProfileWebAppRouting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.IngressProfileWebAppRouting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IngressProfileWebAppRouting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IngressProfileWebAppRouting = value; } + + /// Internal Acessors for IstioCertificateAuthority + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.IstioCertificateAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IstioCertificateAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IstioCertificateAuthority = value; } + + /// Internal Acessors for IstioComponent + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.IstioComponent { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IstioComponent; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).IstioComponent = value; } + + /// Internal Acessors for LinuxProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.LinuxProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).LinuxProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).LinuxProfile = value; } + + /// Internal Acessors for LinuxProfileSsh + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.LinuxProfileSsh { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).LinuxProfileSsh; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).LinuxProfileSsh = value; } + + /// Internal Acessors for MaxAgentPool + int? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.MaxAgentPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MaxAgentPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MaxAgentPool = value; } + + /// Internal Acessors for MetricKubeStateMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.MetricKubeStateMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MetricKubeStateMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MetricKubeStateMetric = value; } + + /// Internal Acessors for MetricProfileCostAnalysis + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.MetricProfileCostAnalysis { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MetricProfileCostAnalysis; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MetricProfileCostAnalysis = value; } + + /// Internal Acessors for MetricsProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.MetricsProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MetricsProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).MetricsProfile = value; } + + /// Internal Acessors for NodeProvisioningProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.NodeProvisioningProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeProvisioningProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeProvisioningProfile = value; } + + /// Internal Acessors for NodeResourceGroupProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.NodeResourceGroupProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeResourceGroupProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeResourceGroupProfile = value; } + + /// Internal Acessors for OidcIssuerProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.OidcIssuerProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OidcIssuerProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OidcIssuerProfile = value; } + + /// Internal Acessors for OidcIssuerProfileIssuerUrl + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.OidcIssuerProfileIssuerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OidcIssuerProfileIssuerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OidcIssuerProfileIssuerUrl = value; } + + /// Internal Acessors for PodIdentityProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.PodIdentityProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfile = value; } + + /// Internal Acessors for PowerState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PowerState = value; } + + /// Internal Acessors for PrivateFqdn + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.PrivateFqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PrivateFqdn; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PrivateFqdn = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for ResourceUid + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.ResourceUid { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ResourceUid; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ResourceUid = value; } + + /// Internal Acessors for SafeguardProfileSystemExcludedNamespace + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.SafeguardProfileSystemExcludedNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardProfileSystemExcludedNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardProfileSystemExcludedNamespace = value; } + + /// Internal Acessors for SafeguardsProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.SafeguardsProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardsProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardsProfile = value; } + + /// Internal Acessors for SecurityProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.SecurityProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfile = value; } + + /// Internal Acessors for SecurityProfileAzureKeyVaultKm + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.SecurityProfileAzureKeyVaultKm { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileAzureKeyVaultKm; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileAzureKeyVaultKm = value; } + + /// Internal Acessors for SecurityProfileDefender + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.SecurityProfileDefender { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileDefender; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileDefender = value; } + + /// Internal Acessors for SecurityProfileImageCleaner + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.SecurityProfileImageCleaner { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileImageCleaner; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileImageCleaner = value; } + + /// Internal Acessors for SecurityProfileImageIntegrity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.SecurityProfileImageIntegrity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileImageIntegrity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileImageIntegrity = value; } + + /// Internal Acessors for SecurityProfileNodeRestriction + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.SecurityProfileNodeRestriction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileNodeRestriction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileNodeRestriction = value; } + + /// Internal Acessors for SecurityProfileWorkloadIdentity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.SecurityProfileWorkloadIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileWorkloadIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileWorkloadIdentity = value; } + + /// Internal Acessors for ServiceMeshProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.ServiceMeshProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServiceMeshProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServiceMeshProfile = value; } + + /// Internal Acessors for ServiceMeshProfileIstio + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.ServiceMeshProfileIstio { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServiceMeshProfileIstio; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServiceMeshProfileIstio = value; } + + /// Internal Acessors for ServicePrincipalProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.ServicePrincipalProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServicePrincipalProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServicePrincipalProfile = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSku()); set { {_sku = value;} } } + + /// Internal Acessors for StorageProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.StorageProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfile = value; } + + /// Internal Acessors for StorageProfileBlobCsiDriver + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.StorageProfileBlobCsiDriver { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfileBlobCsiDriver; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfileBlobCsiDriver = value; } + + /// Internal Acessors for StorageProfileDiskCsiDriver + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.StorageProfileDiskCsiDriver { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfileDiskCsiDriver; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfileDiskCsiDriver = value; } + + /// Internal Acessors for StorageProfileFileCsiDriver + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.StorageProfileFileCsiDriver { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfileFileCsiDriver; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfileFileCsiDriver = value; } + + /// Internal Acessors for StorageProfileSnapshotController + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.StorageProfileSnapshotController { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfileSnapshotController; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).StorageProfileSnapshotController = value; } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.UpgradeSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).UpgradeSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).UpgradeSetting = value; } + + /// Internal Acessors for UpgradeSettingOverrideSetting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.UpgradeSettingOverrideSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).UpgradeSettingOverrideSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).UpgradeSettingOverrideSetting = value; } + + /// Internal Acessors for WebAppRoutingIdentity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.WebAppRoutingIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WebAppRoutingIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WebAppRoutingIdentity = value; } + + /// Internal Acessors for WindowProfileGmsaProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.WindowProfileGmsaProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileGmsaProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileGmsaProfile = value; } + + /// Internal Acessors for WindowsProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.WindowsProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowsProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowsProfile = value; } + + /// Internal Acessors for WorkloadAutoScalerProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.WorkloadAutoScalerProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WorkloadAutoScalerProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WorkloadAutoScalerProfile = value; } + + /// Internal Acessors for WorkloadAutoScalerProfileKeda + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.WorkloadAutoScalerProfileKeda { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WorkloadAutoScalerProfileKeda; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WorkloadAutoScalerProfileKeda = value; } + + /// Internal Acessors for WorkloadAutoScalerProfileVerticalPodAutoscaler + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterInternal.WorkloadAutoScalerProfileVerticalPodAutoscaler { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WorkloadAutoScalerProfileVerticalPodAutoscaler; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WorkloadAutoScalerProfileVerticalPodAutoscaler = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name; } + + /// The network configuration profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile NetworkProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NetworkProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NetworkProfile = value ?? null /* model class */; } + + /// Once the mode it set to Auto, it cannot be changed back to Manual. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? NodeProvisioningProfileMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeProvisioningProfileMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeProvisioningProfileMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode)""); } + + /// The name of the resource group containing agent pool nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string NodeResourceGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeResourceGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeResourceGroup = value ?? null; } + + /// The restriction level applied to the cluster's node resource group + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? NodeResourceGroupProfileRestrictionLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeResourceGroupProfileRestrictionLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeResourceGroupProfileRestrictionLevel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel)""); } + + /// Whether to enable Node Restriction + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? NodeRestrictionEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeRestrictionEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).NodeRestrictionEnabled = value ?? default(bool); } + + /// Whether the OIDC issuer is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OidcIssuerProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OidcIssuerProfileEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OidcIssuerProfileEnabled = value ?? default(bool); } + + /// The OIDC issuer url of the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string OidcIssuerProfileIssuerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OidcIssuerProfileIssuerUrl; } + + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OpenTelemetryLogEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OpenTelemetryLogEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OpenTelemetryLogEnabled = value ?? default(bool); } + + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? OpenTelemetryLogPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OpenTelemetryLogPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OpenTelemetryLogPort = value ?? default(long); } + + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OpenTelemetryMetricEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OpenTelemetryMetricEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OpenTelemetryMetricEnabled = value ?? default(bool); } + + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? OpenTelemetryMetricPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OpenTelemetryMetricPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OpenTelemetryMetricPort = value ?? default(long); } + + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OverrideSettingForceUpgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OverrideSettingForceUpgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OverrideSettingForceUpgrade = value ?? default(bool); } + + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? OverrideSettingUntil { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OverrideSettingUntil; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).OverrideSettingUntil = value ?? default(global::System.DateTime); } + + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertChainObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginCertChainObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginCertChainObjectName = value ?? null; } + + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginCertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginCertObjectName = value ?? null; } + + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginKeyObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginKeyObjectName = value ?? null; } + + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginKeyVaultId = value ?? null; } + + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginRootCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginRootCertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PluginRootCertObjectName = value ?? null; } + + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? PodIdentityProfileAllowNetworkPluginKubenet { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfileAllowNetworkPluginKubenet; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfileAllowNetworkPluginKubenet = value ?? default(bool); } + + /// Whether the pod identity addon is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? PodIdentityProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfileEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfileEnabled = value ?? default(bool); } + + /// The pod identities to use in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] PodIdentityProfileUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfileUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfileUserAssignedIdentity = value ?? null /* arrayOf */; } + + /// The pod identity exceptions to allow. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] PodIdentityProfileUserAssignedIdentityException { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfileUserAssignedIdentityException; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PodIdentityProfileUserAssignedIdentityException = value ?? null /* arrayOf */; } + + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PowerStateCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PowerStateCode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code)""); } + + /// The FQDN of private cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PrivateFqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PrivateFqdn; } + + /// Private link resources associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] PrivateLinkResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PrivateLinkResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PrivateLinkResource = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties _property; + + /// Properties of a managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterProperties()); set => this._property = value; } + + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ProvisioningState; } + + /// Allow or deny public network access for AKS + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess)""); } + + /// + /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ResourceUid { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ResourceUid; } + + /// List of namespaces excluded from Safeguards checks + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] SafeguardProfileExcludedNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardProfileExcludedNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardProfileExcludedNamespace = value ?? null /* arrayOf */; } + + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level? SafeguardProfileLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardProfileLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardProfileLevel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level)""); } + + /// List of namespaces specified by AKS to be excluded from Safeguards + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] SafeguardProfileSystemExcludedNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardProfileSystemExcludedNamespace; } + + /// The version of constraints to use + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string SafeguardProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardProfileVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SafeguardProfileVersion = value ?? null; } + + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SecurityMonitoringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityMonitoringEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityMonitoringEnabled = value ?? default(bool); } + + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public byte[][] SecurityProfileCustomCaTrustCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileCustomCaTrustCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SecurityProfileCustomCaTrustCertificate = value ?? null /* arrayOf */; } + + /// Mode of the service mesh. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode? ServiceMeshProfileMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServiceMeshProfileMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServiceMeshProfileMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode)""); } + + /// The ID for the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ServicePrincipalProfileClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServicePrincipalProfileClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServicePrincipalProfileClientId = value ?? null; } + + /// The secret password associated with the service principal in plain text. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ServicePrincipalProfileSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServicePrincipalProfileSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).ServicePrincipalProfileSecret = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku _sku; + + /// The managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSku()); set => this._sku = value; } + + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName)""); } + + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)Sku).Tier = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier)""); } + + /// Whether to enable Snapshot Controller. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SnapshotControllerEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SnapshotControllerEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SnapshotControllerEnabled = value ?? default(bool); } + + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SshPublicKey = value ?? null /* arrayOf */; } + + /// + /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan? SupportPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SupportPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).SupportPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan)""); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type; } + + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? VerticalPodAutoscalerAddonAutoscaling { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).VerticalPodAutoscalerAddonAutoscaling; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).VerticalPodAutoscalerAddonAutoscaling = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling)""); } + + /// Whether to enable VPA add-on in cluster. Default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? VerticalPodAutoscalerEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).VerticalPodAutoscalerEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).VerticalPodAutoscalerEnabled = value ?? default(bool); } + + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] WebAppRoutingDnsZoneResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WebAppRoutingDnsZoneResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WebAppRoutingDnsZoneResourceId = value ?? null /* arrayOf */; } + + /// Whether to enable Web App Routing. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WebAppRoutingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WebAppRoutingEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WebAppRoutingEnabled = value ?? default(bool); } + + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string WindowProfileAdminPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileAdminPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileAdminPassword = value ?? null; } + + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string WindowProfileAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileAdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileAdminUsername = value ?? null; } + + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WindowProfileEnableCsiProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileEnableCsiProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileEnableCsiProxy = value ?? default(bool); } + + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? WindowProfileLicenseType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileLicenseType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WindowProfileLicenseType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType)""); } + + /// Whether to enable workload identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WorkloadIdentityEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WorkloadIdentityEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)Property).WorkloadIdentityEnabled = value ?? default(bool); } + + /// Creates an new instance. + public ManagedCluster() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// Managed cluster. + public partial interface IManagedCluster : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource + { + /// The list of AAD group object IDs that will have admin role of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of AAD group object IDs that will have admin role of the cluster.", + SerializedName = @"adminGroupObjectIDs", + PossibleTypes = new [] { typeof(string) })] + string[] AadProfileAdminGroupObjectID { get; set; } + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"clientAppID", + PossibleTypes = new [] { typeof(string) })] + string AadProfileClientAppId { get; set; } + /// Whether to enable Azure RBAC for Kubernetes authorization. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure RBAC for Kubernetes authorization.", + SerializedName = @"enableAzureRBAC", + PossibleTypes = new [] { typeof(bool) })] + bool? AadProfileEnableAzureRbac { get; set; } + /// Whether to enable managed AAD. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable managed AAD.", + SerializedName = @"managed", + PossibleTypes = new [] { typeof(bool) })] + bool? AadProfileManaged { get; set; } + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppID", + PossibleTypes = new [] { typeof(string) })] + string AadProfileServerAppId { get; set; } + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppSecret", + PossibleTypes = new [] { typeof(string) })] + string AadProfileServerAppSecret { get; set; } + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription.", + SerializedName = @"tenantID", + PossibleTypes = new [] { typeof(string) })] + string AadProfileTenantId { get; set; } + /// The profile of managed cluster add-on. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The profile of managed cluster add-on.", + SerializedName = @"addonProfiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles AddonProfile { get; set; } + /// The agent pool properties. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The agent pool properties.", + SerializedName = @"agentPoolProfiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[] AgentPoolProfile { get; set; } + /// Indicates if AI toolchain operator enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if AI toolchain operator enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AiToolchainOperatorProfileEnabled { get; set; } + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges).", + SerializedName = @"authorizedIPRanges", + PossibleTypes = new [] { typeof(string) })] + string[] ApiServerAccessProfileAuthorizedIPRange { get; set; } + /// Whether to disable run command for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to disable run command for the cluster or not.", + SerializedName = @"disableRunCommand", + PossibleTypes = new [] { typeof(bool) })] + bool? ApiServerAccessProfileDisableRunCommand { get; set; } + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters).", + SerializedName = @"enablePrivateCluster", + PossibleTypes = new [] { typeof(bool) })] + bool? ApiServerAccessProfileEnablePrivateCluster { get; set; } + /// Whether to create additional public FQDN for private cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to create additional public FQDN for private cluster or not.", + SerializedName = @"enablePrivateClusterPublicFQDN", + PossibleTypes = new [] { typeof(bool) })] + bool? ApiServerAccessProfileEnablePrivateClusterPublicFqdn { get; set; } + /// Whether to enable apiserver vnet integration for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable apiserver vnet integration for the cluster or not.", + SerializedName = @"enableVnetIntegration", + PossibleTypes = new [] { typeof(bool) })] + bool? ApiServerAccessProfileEnableVnetIntegration { get; set; } + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'.", + SerializedName = @"privateDNSZone", + PossibleTypes = new [] { typeof(string) })] + string ApiServerAccessProfilePrivateDnsZone { get; set; } + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet integration.", + SerializedName = @"subnetId", + PossibleTypes = new [] { typeof(string) })] + string ApiServerAccessProfileSubnetId { get; set; } + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Auto Instrumentation is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoInstrumentationEnabled { get; set; } + /// Valid values are 'true' and 'false' + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'true' and 'false'", + SerializedName = @"balance-similar-node-groups", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileBalanceSimilarNodeGroup { get; set; } + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.", + SerializedName = @"daemonset-eviction-for-empty-nodes", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoScalerProfileDaemonsetEvictionForEmptyNode { get; set; } + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.", + SerializedName = @"daemonset-eviction-for-occupied-nodes", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoScalerProfileDaemonsetEvictionForOccupiedNode { get; set; } + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Available values are: 'least-waste', 'most-pods', 'priority', 'random'.", + SerializedName = @"expander", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? AutoScalerProfileExpander { get; set; } + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, the resources used by daemonset will be taken into account when making scaling down decisions.", + SerializedName = @"ignore-daemonsets-utilization", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoScalerProfileIgnoreDaemonsetsUtilization { get; set; } + /// The default is 10. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 10.", + SerializedName = @"max-empty-bulk-delete", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileMaxEmptyBulkDelete { get; set; } + /// The default is 600. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 600.", + SerializedName = @"max-graceful-termination-sec", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileMaxGracefulTerminationSec { get; set; } + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"max-node-provision-time", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileMaxNodeProvisionTime { get; set; } + /// The default is 45. The maximum is 100 and the minimum is 0. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 45. The maximum is 100 and the minimum is 0.", + SerializedName = @"max-total-unready-percentage", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileMaxTotalUnreadyPercentage { get; set; } + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc).", + SerializedName = @"new-pod-scale-up-delay", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileNewPodScaleUpDelay { get; set; } + /// This must be an integer. The default is 3. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This must be an integer. The default is 3.", + SerializedName = @"ok-total-unready-count", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileOkTotalUnreadyCount { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-add", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownDelayAfterAdd { get; set; } + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-delete", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownDelayAfterDelete { get; set; } + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-failure", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownDelayAfterFailure { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-unneeded-time", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownUnneededTime { get; set; } + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-unready-time", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownUnreadyTime { get; set; } + /// The default is '0.5'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '0.5'.", + SerializedName = @"scale-down-utilization-threshold", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownUtilizationThreshold { get; set; } + /// The default is '10'. Values must be an integer number of seconds. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10'. Values must be an integer number of seconds.", + SerializedName = @"scan-interval", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScanInterval { get; set; } + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"skip-nodes-with-local-storage", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileSkipNodesWithLocalStorage { get; set; } + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"skip-nodes-with-system-pods", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileSkipNodesWithSystemPod { get; set; } + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA.", + SerializedName = @"nodeOSUpgradeChannel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? AutoUpgradeProfileNodeOSUpgradeChannel { get; set; } + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel).", + SerializedName = @"upgradeChannel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? AutoUpgradeProfileUpgradeChannel { get; set; } + /// Whether to enable Azure Key Vault key management service. The default is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure Key Vault key management service. The default is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AzureKeyVaultKmEnabled { get; set; } + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty.", + SerializedName = @"keyId", + PossibleTypes = new [] { typeof(string) })] + string AzureKeyVaultKmKeyId { get; set; } + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`.", + SerializedName = @"keyVaultNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? AzureKeyVaultKmKeyVaultNetworkAccess { get; set; } + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty.", + SerializedName = @"keyVaultResourceId", + PossibleTypes = new [] { typeof(string) })] + string AzureKeyVaultKmKeyVaultResourceId { get; set; } + /// + /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes + /// APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly.", + SerializedName = @"azurePortalFQDN", + PossibleTypes = new [] { typeof(string) })] + string AzurePortalFqdn { get; } + /// Whether to enable AzureBlob CSI Driver. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureBlob CSI Driver. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? BlobCsiDriverEnabled { get; set; } + /// The source where the artifacts are downloaded from. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source where the artifacts are downloaded from.", + SerializedName = @"artifactSource", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? BootstrapProfileArtifactSource { get; set; } + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy.", + SerializedName = @"containerRegistryId", + PossibleTypes = new [] { typeof(string) })] + string BootstrapProfileContainerRegistryId { get; set; } + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio egress gateways.", + SerializedName = @"egressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get; set; } + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio ingress gateways.", + SerializedName = @"ingressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get; set; } + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disableCustomMetrics", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerInsightDisableCustomMetric { get; set; } + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disablePrometheusMetricsScraping", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerInsightDisablePrometheusMetricsScraping { get; set; } + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Azure Monitor Container Insights Logs Addon is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerInsightEnabled { get; set; } + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string ContainerInsightLogAnalyticsWorkspaceResourceId { get; set; } + /// The syslog host port. If not specified, the default port is 28330. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The syslog host port. If not specified, the default port is 28330.", + SerializedName = @"syslogPort", + PossibleTypes = new [] { typeof(long) })] + long? ContainerInsightSyslogPort { get; set; } + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? CostAnalysisEnabled { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string CreationDataSourceResourceId { get; set; } + /// The version of Kubernetes the Managed Cluster is running. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of Kubernetes the Managed Cluster is running.", + SerializedName = @"currentKubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string CurrentKubernetesVersion { get; } + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string DefenderLogAnalyticsWorkspaceResourceId { get; set; } + /// + /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + /// that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview).", + SerializedName = @"disableLocalAccounts", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAccount { get; set; } + /// Whether to enable AzureDisk CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureDisk CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? DiskCsiDriverEnabled { get; set; } + /// The version of AzureDisk CSI Driver. The default value is v1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of AzureDisk CSI Driver. The default value is v1.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string DiskCsiDriverVersion { get; set; } + /// + /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'", + SerializedName = @"diskEncryptionSetID", + PossibleTypes = new [] { typeof(string) })] + string DiskEncryptionSetId { get; set; } + /// This cannot be updated once the Managed Cluster has been created. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be updated once the Managed Cluster has been created.", + SerializedName = @"dnsPrefix", + PossibleTypes = new [] { typeof(string) })] + string DnsPrefix { get; set; } + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; } + /// + /// The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) + /// for more details on Namespace as a ARM Resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM Resource.", + SerializedName = @"enableNamespaceResources", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNamespaceResource { get; set; } + /// + /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes + /// v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp.", + SerializedName = @"enablePodSecurityPolicy", + PossibleTypes = new [] { typeof(bool) })] + bool? EnablePodSecurityPolicy { get; set; } + /// Whether to enable Kubernetes Role-Based Access Control. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Kubernetes Role-Based Access Control.", + SerializedName = @"enableRBAC", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableRbac { get; set; } + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes? ExtendedLocationType { get; set; } + /// Whether to enable AzureFile CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureFile CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? FileCsiDriverEnabled { get; set; } + /// The FQDN of the master pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The FQDN of the master pool.", + SerializedName = @"fqdn", + PossibleTypes = new [] { typeof(string) })] + string Fqdn { get; } + /// This cannot be updated once the Managed Cluster has been created. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be updated once the Managed Cluster has been created.", + SerializedName = @"fqdnSubdomain", + PossibleTypes = new [] { typeof(string) })] + string FqdnSubdomain { get; set; } + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"dnsServer", + PossibleTypes = new [] { typeof(string) })] + string GmsaProfileDnsServer { get; set; } + /// Specifies whether to enable Windows gMSA in the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether to enable Windows gMSA in the managed cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? GmsaProfileEnabled { get; set; } + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"rootDomainName", + PossibleTypes = new [] { typeof(string) })] + string GmsaProfileRootDomainName { get; set; } + /// + /// A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy + /// and values injected by AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy and values injected by AKS.", + SerializedName = @"effectiveNoProxy", + PossibleTypes = new [] { typeof(string) })] + string[] HttpProxyConfigEffectiveNoProxy { get; } + /// The HTTP proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP proxy server endpoint to use.", + SerializedName = @"httpProxy", + PossibleTypes = new [] { typeof(string) })] + string HttpProxyConfigHttpProxy { get; set; } + /// The HTTPS proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTPS proxy server endpoint to use.", + SerializedName = @"httpsProxy", + PossibleTypes = new [] { typeof(string) })] + string HttpProxyConfigHttpsProxy { get; set; } + /// The endpoints that should not go through proxy. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The endpoints that should not go through proxy.", + SerializedName = @"noProxy", + PossibleTypes = new [] { typeof(string) })] + string[] HttpProxyConfigNoProxy { get; set; } + /// Alternative CA cert to use for connecting to proxy servers. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alternative CA cert to use for connecting to proxy servers.", + SerializedName = @"trustedCa", + PossibleTypes = new [] { typeof(string) })] + string HttpProxyConfigTrustedCa { get; set; } + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client ID of the user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string IdentityClientId { get; set; } + /// + /// The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, + /// and managed cluster only accept one delegated identity resource. Internal use only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. Internal use only.", + SerializedName = @"delegatedResources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources IdentityDelegatedResource { get; set; } + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object ID of the user assigned identity.", + SerializedName = @"objectId", + PossibleTypes = new [] { typeof(string) })] + string IdentityObjectId { get; set; } + /// + /// The principal id of the system assigned identity which is used by master components. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal id of the system assigned identity which is used by master components.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; } + /// Identities associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identities associated with the cluster.", + SerializedName = @"identityProfile", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile IdentityProfile { get; set; } + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the user assigned identity.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string IdentityResourceId { get; set; } + /// + /// The tenant id of the system assigned identity which is used by master components. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The tenant id of the system assigned identity which is used by master components.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; } + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity).", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType? IdentityType { get; set; } + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Whether to enable Image Cleaner on AKS cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Image Cleaner on AKS cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImageCleanerEnabled { get; set; } + /// Image Cleaner scanning interval in hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image Cleaner scanning interval in hours.", + SerializedName = @"intervalHours", + PossibleTypes = new [] { typeof(int) })] + int? ImageCleanerIntervalHour { get; set; } + /// Whether to enable image integrity. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable image integrity. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImageIntegrityEnabled { get; set; } + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade", + SerializedName = @"revisions", + PossibleTypes = new [] { typeof(string) })] + string[] IstioRevision { get; set; } + /// Whether to enable KEDA. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable KEDA.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? KedaEnabled { get; set; } + /// + /// This is primarily used to expose different UI experiences in the portal for different kinds + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is primarily used to expose different UI experiences in the portal for different kinds", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + string Kind { get; set; } + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric.", + SerializedName = @"metricAnnotationsAllowList", + PossibleTypes = new [] { typeof(string) })] + string KubeStateMetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. ", + SerializedName = @"metricLabelsAllowlist", + PossibleTypes = new [] { typeof(string) })] + string KubeStateMetricLabelsAllowlist { get; set; } + /// + /// When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed + /// sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + /// however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// The administrator username to use for Linux VMs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The administrator username to use for Linux VMs.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string LinuxProfileAdminUsername { get; set; } + /// The max number of agent pools for the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The max number of agent pools for the managed cluster.", + SerializedName = @"maxAgentPools", + PossibleTypes = new [] { typeof(int) })] + int? MaxAgentPool { get; } + /// Whether to enable the Prometheus collector + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable the Prometheus collector", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? MetricEnabled { get; set; } + /// The network configuration profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network configuration profile.", + SerializedName = @"networkProfile", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile NetworkProfile { get; set; } + /// Once the mode it set to Auto, it cannot be changed back to Manual. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Once the mode it set to Auto, it cannot be changed back to Manual.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? NodeProvisioningProfileMode { get; set; } + /// The name of the resource group containing agent pool nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the resource group containing agent pool nodes.", + SerializedName = @"nodeResourceGroup", + PossibleTypes = new [] { typeof(string) })] + string NodeResourceGroup { get; set; } + /// The restriction level applied to the cluster's node resource group + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The restriction level applied to the cluster's node resource group", + SerializedName = @"restrictionLevel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? NodeResourceGroupProfileRestrictionLevel { get; set; } + /// Whether to enable Node Restriction + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Node Restriction", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? NodeRestrictionEnabled { get; set; } + /// Whether the OIDC issuer is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the OIDC issuer is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OidcIssuerProfileEnabled { get; set; } + /// The OIDC issuer url of the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The OIDC issuer url of the Managed Cluster.", + SerializedName = @"issuerURL", + PossibleTypes = new [] { typeof(string) })] + string OidcIssuerProfileIssuerUrl { get; } + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OpenTelemetryLogEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? OpenTelemetryLogPort { get; set; } + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Metrics is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OpenTelemetryMetricEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? OpenTelemetryMetricPort { get; set; } + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution.", + SerializedName = @"forceUpgrade", + PossibleTypes = new [] { typeof(bool) })] + bool? OverrideSettingForceUpgrade { get; set; } + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect.", + SerializedName = @"until", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OverrideSettingUntil { get; set; } + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate chain object name in Azure Key Vault.", + SerializedName = @"certChainObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate object name in Azure Key Vault.", + SerializedName = @"certObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate private key object name in Azure Key Vault.", + SerializedName = @"keyObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the Key Vault.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Root certificate object name in Azure Key Vault.", + SerializedName = @"rootCertObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginRootCertObjectName { get; set; } + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information.", + SerializedName = @"allowNetworkPluginKubenet", + PossibleTypes = new [] { typeof(bool) })] + bool? PodIdentityProfileAllowNetworkPluginKubenet { get; set; } + /// Whether the pod identity addon is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the pod identity addon is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? PodIdentityProfileEnabled { get; set; } + /// The pod identities to use in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The pod identities to use in the cluster.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] PodIdentityProfileUserAssignedIdentity { get; set; } + /// The pod identity exceptions to allow. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The pod identity exceptions to allow.", + SerializedName = @"userAssignedIdentityExceptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] PodIdentityProfileUserAssignedIdentityException { get; set; } + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tells whether the cluster is Running or Stopped", + SerializedName = @"code", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get; set; } + /// The FQDN of private cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The FQDN of private cluster.", + SerializedName = @"privateFQDN", + PossibleTypes = new [] { typeof(string) })] + string PrivateFqdn { get; } + /// Private link resources associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Private link resources associated with the cluster.", + SerializedName = @"privateLinkResources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] PrivateLinkResource { get; set; } + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Allow or deny public network access for AKS + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or deny public network access for AKS", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence)", + SerializedName = @"resourceUID", + PossibleTypes = new [] { typeof(string) })] + string ResourceUid { get; } + /// List of namespaces excluded from Safeguards checks + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of namespaces excluded from Safeguards checks", + SerializedName = @"excludedNamespaces", + PossibleTypes = new [] { typeof(string) })] + string[] SafeguardProfileExcludedNamespace { get; set; } + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces", + SerializedName = @"level", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level? SafeguardProfileLevel { get; set; } + /// List of namespaces specified by AKS to be excluded from Safeguards + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of namespaces specified by AKS to be excluded from Safeguards", + SerializedName = @"systemExcludedNamespaces", + PossibleTypes = new [] { typeof(string) })] + string[] SafeguardProfileSystemExcludedNamespace { get; } + /// The version of constraints to use + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of constraints to use", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string SafeguardProfileVersion { get; set; } + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Defender threat detection", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SecurityMonitoringEnabled { get; set; } + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority)", + SerializedName = @"customCATrustCertificates", + PossibleTypes = new [] { typeof(byte[]) })] + byte[][] SecurityProfileCustomCaTrustCertificate { get; set; } + /// Mode of the service mesh. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode of the service mesh.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode? ServiceMeshProfileMode { get; set; } + /// The ID for the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID for the service principal.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalProfileClientId { get; set; } + /// The secret password associated with the service principal in plain text. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secret password associated with the service principal in plain text.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalProfileSecret { get; set; } + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of a managed cluster SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get; set; } + /// Whether to enable Snapshot Controller. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Snapshot Controller. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SnapshotControllerEnabled { get; set; } + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified.", + SerializedName = @"publicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get; set; } + /// + /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'.", + SerializedName = @"supportPlan", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan? SupportPlan { get; set; } + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether VPA add-on is enabled and configured to scale AKS-managed add-ons.", + SerializedName = @"addonAutoscaling", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? VerticalPodAutoscalerAddonAutoscaling { get; set; } + /// Whether to enable VPA add-on in cluster. Default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable VPA add-on in cluster. Default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? VerticalPodAutoscalerEnabled { get; set; } + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group.", + SerializedName = @"dnsZoneResourceIds", + PossibleTypes = new [] { typeof(string) })] + string[] WebAppRoutingDnsZoneResourceId { get; set; } + /// Whether to enable Web App Routing. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Web App Routing.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? WebAppRoutingEnabled { get; set; } + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** ""abc@123"", ""P@$$w0rd"", ""P@ssw0rd"", ""P@ssword123"", ""Pa$$word"", ""pass@word1"", ""Password!"", ""Password1"", ""Password22"", ""iloveyou!""", + SerializedName = @"adminPassword", + PossibleTypes = new [] { typeof(string) })] + string WindowProfileAdminPassword { get; set; } + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the name of the administrator account.

**Restriction:** Cannot end in "".""

**Disallowed values:** ""administrator"", ""admin"", ""user"", ""user1"", ""test"", ""user2"", ""test1"", ""user3"", ""admin1"", ""1"", ""123"", ""a"", ""actuser"", ""adm"", ""admin2"", ""aspnet"", ""backup"", ""console"", ""david"", ""guest"", ""john"", ""owner"", ""root"", ""server"", ""sql"", ""support"", ""support_388945a0"", ""sys"", ""test2"", ""test3"", ""user4"", ""user5"".

**Minimum-length:** 1 character

**Max-length:** 20 characters", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string WindowProfileAdminUsername { get; set; } + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy).", + SerializedName = @"enableCSIProxy", + PossibleTypes = new [] { typeof(bool) })] + bool? WindowProfileEnableCsiProxy { get; set; } + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details.", + SerializedName = @"licenseType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? WindowProfileLicenseType { get; set; } + /// Whether to enable workload identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable workload identity.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? WorkloadIdentityEnabled { get; set; } + + } + /// Managed cluster. + internal partial interface IManagedClusterInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal + { + /// The Azure Active Directory configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile AadProfile { get; set; } + /// The list of AAD group object IDs that will have admin role of the cluster. + string[] AadProfileAdminGroupObjectID { get; set; } + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + string AadProfileClientAppId { get; set; } + /// Whether to enable Azure RBAC for Kubernetes authorization. + bool? AadProfileEnableAzureRbac { get; set; } + /// Whether to enable managed AAD. + bool? AadProfileManaged { get; set; } + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + string AadProfileServerAppId { get; set; } + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + string AadProfileServerAppSecret { get; set; } + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + string AadProfileTenantId { get; set; } + /// The profile of managed cluster add-on. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles AddonProfile { get; set; } + /// The agent pool properties. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[] AgentPoolProfile { get; set; } + /// AI toolchain operator settings that apply to the whole cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile AiToolchainOperatorProfile { get; set; } + /// Indicates if AI toolchain operator enabled or not. + bool? AiToolchainOperatorProfileEnabled { get; set; } + /// The access profile for managed cluster API server. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile ApiServerAccessProfile { get; set; } + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + string[] ApiServerAccessProfileAuthorizedIPRange { get; set; } + /// Whether to disable run command for the cluster or not. + bool? ApiServerAccessProfileDisableRunCommand { get; set; } + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + bool? ApiServerAccessProfileEnablePrivateCluster { get; set; } + /// Whether to create additional public FQDN for private cluster or not. + bool? ApiServerAccessProfileEnablePrivateClusterPublicFqdn { get; set; } + /// Whether to enable apiserver vnet integration for the cluster or not. + bool? ApiServerAccessProfileEnableVnetIntegration { get; set; } + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + string ApiServerAccessProfilePrivateDnsZone { get; set; } + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + string ApiServerAccessProfileSubnetId { get; set; } + /// + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation AppMonitoringAutoInstrumentation { get; set; } + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs AppMonitoringOpenTelemetryLog { get; set; } + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics AppMonitoringOpenTelemetryMetric { get; set; } + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + bool? AutoInstrumentationEnabled { get; set; } + /// Parameters to be applied to the cluster-autoscaler when enabled + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile AutoScalerProfile { get; set; } + /// Valid values are 'true' and 'false' + string AutoScalerProfileBalanceSimilarNodeGroup { get; set; } + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + bool? AutoScalerProfileDaemonsetEvictionForEmptyNode { get; set; } + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + bool? AutoScalerProfileDaemonsetEvictionForOccupiedNode { get; set; } + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? AutoScalerProfileExpander { get; set; } + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + bool? AutoScalerProfileIgnoreDaemonsetsUtilization { get; set; } + /// The default is 10. + string AutoScalerProfileMaxEmptyBulkDelete { get; set; } + /// The default is 600. + string AutoScalerProfileMaxGracefulTerminationSec { get; set; } + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileMaxNodeProvisionTime { get; set; } + /// The default is 45. The maximum is 100 and the minimum is 0. + string AutoScalerProfileMaxTotalUnreadyPercentage { get; set; } + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + string AutoScalerProfileNewPodScaleUpDelay { get; set; } + /// This must be an integer. The default is 3. + string AutoScalerProfileOkTotalUnreadyCount { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileScaleDownDelayAfterAdd { get; set; } + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + string AutoScalerProfileScaleDownDelayAfterDelete { get; set; } + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileScaleDownDelayAfterFailure { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileScaleDownUnneededTime { get; set; } + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileScaleDownUnreadyTime { get; set; } + /// The default is '0.5'. + string AutoScalerProfileScaleDownUtilizationThreshold { get; set; } + /// The default is '10'. Values must be an integer number of seconds. + string AutoScalerProfileScanInterval { get; set; } + /// The default is true. + string AutoScalerProfileSkipNodesWithLocalStorage { get; set; } + /// The default is true. + string AutoScalerProfileSkipNodesWithSystemPod { get; set; } + /// The auto upgrade configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile AutoUpgradeProfile { get; set; } + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? AutoUpgradeProfileNodeOSUpgradeChannel { get; set; } + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? AutoUpgradeProfileUpgradeChannel { get; set; } + /// Whether to enable Azure Key Vault key management service. The default is false. + bool? AzureKeyVaultKmEnabled { get; set; } + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + string AzureKeyVaultKmKeyId { get; set; } + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? AzureKeyVaultKmKeyVaultNetworkAccess { get; set; } + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + string AzureKeyVaultKmKeyVaultResourceId { get; set; } + /// Prometheus addon profile for the container service cluster + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile AzureMonitorProfile { get; set; } + /// + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring AzureMonitorProfileAppMonitoring { get; set; } + /// + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights AzureMonitorProfileContainerInsight { get; set; } + /// Metrics profile for the prometheus service addon + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics AzureMonitorProfileMetric { get; set; } + /// + /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes + /// APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + /// + string AzurePortalFqdn { get; set; } + /// Whether to enable AzureBlob CSI Driver. The default value is false. + bool? BlobCsiDriverEnabled { get; set; } + /// Profile of the cluster bootstrap configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile BootstrapProfile { get; set; } + /// The source where the artifacts are downloaded from. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? BootstrapProfileArtifactSource { get; set; } + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + string BootstrapProfileContainerRegistryId { get; set; } + /// Plugin certificates information for Service Mesh. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority CertificateAuthorityPlugin { get; set; } + /// Istio egress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get; set; } + /// Istio ingress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get; set; } + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + bool? ContainerInsightDisableCustomMetric { get; set; } + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + bool? ContainerInsightDisablePrometheusMetricsScraping { get; set; } + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + bool? ContainerInsightEnabled { get; set; } + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + string ContainerInsightLogAnalyticsWorkspaceResourceId { get; set; } + /// The syslog host port. If not specified, the default port is 28330. + long? ContainerInsightSyslogPort { get; set; } + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + bool? CostAnalysisEnabled { get; set; } + /// + /// CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + string CreationDataSourceResourceId { get; set; } + /// The version of Kubernetes the Managed Cluster is running. + string CurrentKubernetesVersion { get; set; } + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + string DefenderLogAnalyticsWorkspaceResourceId { get; set; } + /// + /// Microsoft Defender threat detection for Cloud settings for the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring DefenderSecurityMonitoring { get; set; } + /// + /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + /// that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + /// + bool? DisableLocalAccount { get; set; } + /// Whether to enable AzureDisk CSI Driver. The default value is true. + bool? DiskCsiDriverEnabled { get; set; } + /// The version of AzureDisk CSI Driver. The default value is v1. + string DiskCsiDriverVersion { get; set; } + /// + /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + /// + string DiskEncryptionSetId { get; set; } + /// This cannot be updated once the Managed Cluster has been created. + string DnsPrefix { get; set; } + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + string ETag { get; set; } + /// + /// The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) + /// for more details on Namespace as a ARM Resource. + /// + bool? EnableNamespaceResource { get; set; } + /// + /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes + /// v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + /// + bool? EnablePodSecurityPolicy { get; set; } + /// Whether to enable Kubernetes Role-Based Access Control. + bool? EnableRbac { get; set; } + /// The extended location of the Virtual Machine. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IExtendedLocation ExtendedLocation { get; set; } + /// The name of the extended location. + string ExtendedLocationName { get; set; } + /// The type of the extended location. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes? ExtendedLocationType { get; set; } + /// Whether to enable AzureFile CSI Driver. The default value is true. + bool? FileCsiDriverEnabled { get; set; } + /// The FQDN of the master pool. + string Fqdn { get; set; } + /// This cannot be updated once the Managed Cluster has been created. + string FqdnSubdomain { get; set; } + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ string GmsaProfileDnsServer { get; set; } + /// Specifies whether to enable Windows gMSA in the managed cluster. + bool? GmsaProfileEnabled { get; set; } + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ string GmsaProfileRootDomainName { get; set; } + /// Configurations for provisioning the cluster with HTTP proxy servers. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig HttpProxyConfig { get; set; } + /// + /// A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy + /// and values injected by AKS. + /// + string[] HttpProxyConfigEffectiveNoProxy { get; set; } + /// The HTTP proxy server endpoint to use. + string HttpProxyConfigHttpProxy { get; set; } + /// The HTTPS proxy server endpoint to use. + string HttpProxyConfigHttpsProxy { get; set; } + /// The endpoints that should not go through proxy. + string[] HttpProxyConfigNoProxy { get; set; } + /// Alternative CA cert to use for connecting to proxy servers. + string HttpProxyConfigTrustedCa { get; set; } + /// The identity of the managed cluster, if configured. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity Identity { get; set; } + /// The client ID of the user assigned identity. + string IdentityClientId { get; set; } + /// + /// The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, + /// and managed cluster only accept one delegated identity resource. Internal use only. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources IdentityDelegatedResource { get; set; } + /// The object ID of the user assigned identity. + string IdentityObjectId { get; set; } + /// + /// The principal id of the system assigned identity which is used by master components. + /// + string IdentityPrincipalId { get; set; } + /// Identities associated with the cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile IdentityProfile { get; set; } + /// The resource ID of the user assigned identity. + string IdentityResourceId { get; set; } + /// + /// The tenant id of the system assigned identity which is used by master components. + /// + string IdentityTenantId { get; set; } + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType? IdentityType { get; set; } + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// Whether to enable Image Cleaner on AKS cluster. + bool? ImageCleanerEnabled { get; set; } + /// Image Cleaner scanning interval in hours. + int? ImageCleanerIntervalHour { get; set; } + /// Whether to enable image integrity. The default value is false. + bool? ImageIntegrityEnabled { get; set; } + /// Ingress profile for the managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile IngressProfile { get; set; } + /// Web App Routing settings for the ingress profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting IngressProfileWebAppRouting { get; set; } + /// + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority IstioCertificateAuthority { get; set; } + /// Istio components configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents IstioComponent { get; set; } + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + string[] IstioRevision { get; set; } + /// Whether to enable KEDA. + bool? KedaEnabled { get; set; } + /// + /// This is primarily used to expose different UI experiences in the portal for different kinds + /// + string Kind { get; set; } + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + string KubeStateMetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + string KubeStateMetricLabelsAllowlist { get; set; } + /// + /// When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed + /// sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + /// however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) + /// for more details. + /// + string KubernetesVersion { get; set; } + /// The profile for Linux VMs in the Managed Cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile LinuxProfile { get; set; } + /// The administrator username to use for Linux VMs. + string LinuxProfileAdminUsername { get; set; } + /// The SSH configuration for Linux-based VMs running on Azure. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration LinuxProfileSsh { get; set; } + /// The max number of agent pools for the managed cluster. + int? MaxAgentPool { get; set; } + /// Whether to enable the Prometheus collector + bool? MetricEnabled { get; set; } + /// + /// Kube State Metrics for prometheus addon profile for the container service cluster + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics MetricKubeStateMetric { get; set; } + /// The cost analysis configuration for the cluster + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis MetricProfileCostAnalysis { get; set; } + /// Optional cluster metrics configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile MetricsProfile { get; set; } + /// The network configuration profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile NetworkProfile { get; set; } + /// Node provisioning settings that apply to the whole cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile NodeProvisioningProfile { get; set; } + /// Once the mode it set to Auto, it cannot be changed back to Manual. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? NodeProvisioningProfileMode { get; set; } + /// The name of the resource group containing agent pool nodes. + string NodeResourceGroup { get; set; } + /// The node resource group configuration profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile NodeResourceGroupProfile { get; set; } + /// The restriction level applied to the cluster's node resource group + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? NodeResourceGroupProfileRestrictionLevel { get; set; } + /// Whether to enable Node Restriction + bool? NodeRestrictionEnabled { get; set; } + /// The OIDC issuer profile of the Managed Cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile OidcIssuerProfile { get; set; } + /// Whether the OIDC issuer is enabled. + bool? OidcIssuerProfileEnabled { get; set; } + /// The OIDC issuer url of the Managed Cluster. + string OidcIssuerProfileIssuerUrl { get; set; } + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + bool? OpenTelemetryLogEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + long? OpenTelemetryLogPort { get; set; } + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + bool? OpenTelemetryMetricEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + long? OpenTelemetryMetricPort { get; set; } + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + bool? OverrideSettingForceUpgrade { get; set; } + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + global::System.DateTime? OverrideSettingUntil { get; set; } + /// Certificate chain object name in Azure Key Vault. + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + string PluginRootCertObjectName { get; set; } + /// + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod + /// identity integration. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile PodIdentityProfile { get; set; } + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + bool? PodIdentityProfileAllowNetworkPluginKubenet { get; set; } + /// Whether the pod identity addon is enabled. + bool? PodIdentityProfileEnabled { get; set; } + /// The pod identities to use in the cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] PodIdentityProfileUserAssignedIdentity { get; set; } + /// The pod identity exceptions to allow. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] PodIdentityProfileUserAssignedIdentityException { get; set; } + /// The Power State of the cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState PowerState { get; set; } + /// Tells whether the cluster is Running or Stopped + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get; set; } + /// The FQDN of private cluster. + string PrivateFqdn { get; set; } + /// Private link resources associated with the cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] PrivateLinkResource { get; set; } + /// Properties of a managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties Property { get; set; } + /// The current provisioning state. + string ProvisioningState { get; set; } + /// Allow or deny public network access for AKS + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence) + /// + string ResourceUid { get; set; } + /// List of namespaces excluded from Safeguards checks + string[] SafeguardProfileExcludedNamespace { get; set; } + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level? SafeguardProfileLevel { get; set; } + /// List of namespaces specified by AKS to be excluded from Safeguards + string[] SafeguardProfileSystemExcludedNamespace { get; set; } + /// The version of constraints to use + string SafeguardProfileVersion { get; set; } + /// The Safeguards profile holds all the safeguards information for a given cluster + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile SafeguardsProfile { get; set; } + /// Whether to enable Defender threat detection + bool? SecurityMonitoringEnabled { get; set; } + /// Security profile for the managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile SecurityProfile { get; set; } + /// + /// Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for + /// the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms SecurityProfileAzureKeyVaultKm { get; set; } + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + byte[][] SecurityProfileCustomCaTrustCertificate { get; set; } + /// Microsoft Defender settings for the security profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender SecurityProfileDefender { get; set; } + /// Image Cleaner settings for the security profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner SecurityProfileImageCleaner { get; set; } + /// + /// Image integrity is a feature that works with Azure Policy to verify image integrity by signature. This will not have any + /// effect unless Azure Policy is applied to enforce image signatures. See https://aka.ms/aks/image-integrity for how to use + /// this feature via policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity SecurityProfileImageIntegrity { get; set; } + /// + /// [Node Restriction](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction) settings + /// for the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction SecurityProfileNodeRestriction { get; set; } + /// + /// Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure + /// cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity SecurityProfileWorkloadIdentity { get; set; } + /// Service mesh profile for a managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile ServiceMeshProfile { get; set; } + /// Istio service mesh configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh ServiceMeshProfileIstio { get; set; } + /// Mode of the service mesh. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode? ServiceMeshProfileMode { get; set; } + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile ServicePrincipalProfile { get; set; } + /// The ID for the service principal. + string ServicePrincipalProfileClientId { get; set; } + /// The secret password associated with the service principal in plain text. + string ServicePrincipalProfileSecret { get; set; } + /// The managed cluster SKU. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku Sku { get; set; } + /// The name of a managed cluster SKU. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get; set; } + /// Whether to enable Snapshot Controller. The default value is true. + bool? SnapshotControllerEnabled { get; set; } + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get; set; } + /// Storage profile for the managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile StorageProfile { get; set; } + /// AzureBlob CSI Driver settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver StorageProfileBlobCsiDriver { get; set; } + /// AzureDisk CSI Driver settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver StorageProfileDiskCsiDriver { get; set; } + /// AzureFile CSI Driver settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver StorageProfileFileCsiDriver { get; set; } + /// Snapshot Controller settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController StorageProfileSnapshotController { get; set; } + /// + /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan? SupportPlan { get; set; } + /// Settings for upgrading a cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings UpgradeSetting { get; set; } + /// Settings for overrides. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings UpgradeSettingOverrideSetting { get; set; } + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? VerticalPodAutoscalerAddonAutoscaling { get; set; } + /// Whether to enable VPA add-on in cluster. Default value is false. + bool? VerticalPodAutoscalerEnabled { get; set; } + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + string[] WebAppRoutingDnsZoneResourceId { get; set; } + /// Whether to enable Web App Routing. + bool? WebAppRoutingEnabled { get; set; } + /// + /// Managed identity of the Web Application Routing add-on. This is the identity that should be granted permissions, for example, + /// to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) + /// for more instructions. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity WebAppRoutingIdentity { get; set; } + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ string WindowProfileAdminPassword { get; set; } + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ string WindowProfileAdminUsername { get; set; } + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + bool? WindowProfileEnableCsiProxy { get; set; } + /// The Windows gMSA Profile in the Managed Cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile WindowProfileGmsaProfile { get; set; } + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? WindowProfileLicenseType { get; set; } + /// The profile for Windows VMs in the Managed Cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile WindowsProfile { get; set; } + /// Workload Auto-scaler profile for the managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile WorkloadAutoScalerProfile { get; set; } + /// + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda WorkloadAutoScalerProfileKeda { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler WorkloadAutoScalerProfileVerticalPodAutoscaler { get; set; } + /// Whether to enable workload identity. + bool? WorkloadIdentityEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.json.cs new file mode 100644 index 000000000000..3a66e24c3e4f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedCluster.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Managed cluster. + public partial class ManagedCluster + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedCluster(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedCluster(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource(json); + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSku.FromJson(__jsonSku) : Sku;} + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentity.FromJson(__jsonIdentity) : Identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterProperties.FromJson(__jsonProperties) : Property;} + {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)ETag;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._eTag.ToString()) : null, "eTag" ,container.Add ); + } + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.PowerShell.cs new file mode 100644 index 000000000000..df7172af64bb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAadProfileTypeConverter))] + public partial class ManagedClusterAadProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAadProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAadProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAadProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Managed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).Managed = (bool?) content.GetValueForProperty("Managed",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).Managed, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableAzureRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).EnableAzureRbac = (bool?) content.GetValueForProperty("EnableAzureRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).EnableAzureRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdminGroupObjectID")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).AdminGroupObjectID = (string[]) content.GetValueForProperty("AdminGroupObjectID",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).AdminGroupObjectID, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClientAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ClientAppId = (string) content.GetValueForProperty("ClientAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ClientAppId, global::System.Convert.ToString); + } + if (content.Contains("ServerAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ServerAppId = (string) content.GetValueForProperty("ServerAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ServerAppId, global::System.Convert.ToString); + } + if (content.Contains("ServerAppSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ServerAppSecret = (string) content.GetValueForProperty("ServerAppSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ServerAppSecret, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)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 ManagedClusterAadProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Managed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).Managed = (bool?) content.GetValueForProperty("Managed",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).Managed, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableAzureRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).EnableAzureRbac = (bool?) content.GetValueForProperty("EnableAzureRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).EnableAzureRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AdminGroupObjectID")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).AdminGroupObjectID = (string[]) content.GetValueForProperty("AdminGroupObjectID",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).AdminGroupObjectID, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClientAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ClientAppId = (string) content.GetValueForProperty("ClientAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ClientAppId, global::System.Convert.ToString); + } + if (content.Contains("ServerAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ServerAppId = (string) content.GetValueForProperty("ServerAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ServerAppId, global::System.Convert.ToString); + } + if (content.Contains("ServerAppSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ServerAppSecret = (string) content.GetValueForProperty("ServerAppSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).ServerAppSecret, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAadProfileTypeConverter))] + public partial interface IManagedClusterAadProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.TypeConverter.cs new file mode 100644 index 000000000000..2bffbf46113d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAadProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAadProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAadProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAadProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.cs new file mode 100644 index 000000000000..ba0b2ec4b6fb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + /// + public partial class ManagedClusterAadProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal + { + + /// Backing field for property. + private string[] _adminGroupObjectID; + + /// The list of AAD group object IDs that will have admin role of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] AdminGroupObjectID { get => this._adminGroupObjectID; set => this._adminGroupObjectID = value; } + + /// Backing field for property. + private string _clientAppId; + + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ClientAppId { get => this._clientAppId; set => this._clientAppId = value; } + + /// Backing field for property. + private bool? _enableAzureRbac; + + /// Whether to enable Azure RBAC for Kubernetes authorization. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableAzureRbac { get => this._enableAzureRbac; set => this._enableAzureRbac = value; } + + /// Backing field for property. + private bool? _managed; + + /// Whether to enable managed AAD. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Managed { get => this._managed; set => this._managed = value; } + + /// Backing field for property. + private string _serverAppId; + + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ServerAppId { get => this._serverAppId; set => this._serverAppId = value; } + + /// Backing field for property. + private string _serverAppSecret; + + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ServerAppSecret { get => this._serverAppSecret; set => this._serverAppSecret = value; } + + /// Backing field for property. + private string _tenantId; + + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; set => this._tenantId = value; } + + /// Creates an new instance. + public ManagedClusterAadProfile() + { + + } + } + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + public partial interface IManagedClusterAadProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The list of AAD group object IDs that will have admin role of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of AAD group object IDs that will have admin role of the cluster.", + SerializedName = @"adminGroupObjectIDs", + PossibleTypes = new [] { typeof(string) })] + string[] AdminGroupObjectID { get; set; } + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"clientAppID", + PossibleTypes = new [] { typeof(string) })] + string ClientAppId { get; set; } + /// Whether to enable Azure RBAC for Kubernetes authorization. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure RBAC for Kubernetes authorization.", + SerializedName = @"enableAzureRBAC", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableAzureRbac { get; set; } + /// Whether to enable managed AAD. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable managed AAD.", + SerializedName = @"managed", + PossibleTypes = new [] { typeof(bool) })] + bool? Managed { get; set; } + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppID", + PossibleTypes = new [] { typeof(string) })] + string ServerAppId { get; set; } + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppSecret", + PossibleTypes = new [] { typeof(string) })] + string ServerAppSecret { get; set; } + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription.", + SerializedName = @"tenantID", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + internal partial interface IManagedClusterAadProfileInternal + + { + /// The list of AAD group object IDs that will have admin role of the cluster. + string[] AdminGroupObjectID { get; set; } + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + string ClientAppId { get; set; } + /// Whether to enable Azure RBAC for Kubernetes authorization. + bool? EnableAzureRbac { get; set; } + /// Whether to enable managed AAD. + bool? Managed { get; set; } + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + string ServerAppId { get; set; } + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + string ServerAppSecret { get; set; } + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.json.cs new file mode 100644 index 000000000000..3fc7db1943e3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAadProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + /// + public partial class ManagedClusterAadProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAadProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAadProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_managed = If( json?.PropertyT("managed"), out var __jsonManaged) ? (bool?)__jsonManaged : Managed;} + {_enableAzureRbac = If( json?.PropertyT("enableAzureRBAC"), out var __jsonEnableAzureRbac) ? (bool?)__jsonEnableAzureRbac : EnableAzureRbac;} + {_adminGroupObjectID = If( json?.PropertyT("adminGroupObjectIDs"), out var __jsonAdminGroupObjectIDs) ? If( __jsonAdminGroupObjectIDs as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AdminGroupObjectID;} + {_clientAppId = If( json?.PropertyT("clientAppID"), out var __jsonClientAppId) ? (string)__jsonClientAppId : (string)ClientAppId;} + {_serverAppId = If( json?.PropertyT("serverAppID"), out var __jsonServerAppId) ? (string)__jsonServerAppId : (string)ServerAppId;} + {_serverAppSecret = If( json?.PropertyT("serverAppSecret"), out var __jsonServerAppSecret) ? (string)__jsonServerAppSecret : (string)ServerAppSecret;} + {_tenantId = If( json?.PropertyT("tenantID"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._managed ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._managed) : null, "managed" ,container.Add ); + AddIf( null != this._enableAzureRbac ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableAzureRbac) : null, "enableAzureRBAC" ,container.Add ); + if (null != this._adminGroupObjectID) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._adminGroupObjectID ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("adminGroupObjectIDs",__w); + } + AddIf( null != (((object)this._clientAppId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._clientAppId.ToString()) : null, "clientAppID" ,container.Add ); + AddIf( null != (((object)this._serverAppId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._serverAppId.ToString()) : null, "serverAppID" ,container.Add ); + AddIf( null != (((object)this._serverAppSecret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._serverAppSecret.ToString()) : null, "serverAppSecret" ,container.Add ); + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantID" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.PowerShell.cs new file mode 100644 index 000000000000..95c3103383d8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.PowerShell.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Managed cluster Access Profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAccessProfileTypeConverter))] + public partial class ManagedClusterAccessProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAccessProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAccessProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAccessProfile(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.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AccessProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("KubeConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal)this).KubeConfig = (byte[]) content.GetValueForProperty("KubeConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal)this).KubeConfig, i => i); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterAccessProfile(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.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AccessProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("KubeConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal)this).KubeConfig = (byte[]) content.GetValueForProperty("KubeConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal)this).KubeConfig, i => i); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Managed cluster Access Profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAccessProfileTypeConverter))] + public partial interface IManagedClusterAccessProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.TypeConverter.cs new file mode 100644 index 000000000000..95cd1682623f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAccessProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAccessProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAccessProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAccessProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.cs new file mode 100644 index 000000000000..2fd03cdc528b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Managed cluster Access Profile. + public partial class ManagedClusterAccessProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id; } + + /// Base64-encoded Kubernetes configuration file. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public byte[] KubeConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfileInternal)Property).KubeConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfileInternal)Property).KubeConfig = value ?? null /* byte array */; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfileInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AccessProfile()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile _property; + + /// AccessProfile of a managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AccessProfile()); set => this._property = value; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public ManagedClusterAccessProfile() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// Managed cluster Access Profile. + public partial interface IManagedClusterAccessProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource + { + /// Base64-encoded Kubernetes configuration file. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Base64-encoded Kubernetes configuration file.", + SerializedName = @"kubeConfig", + PossibleTypes = new [] { typeof(byte[]) })] + byte[] KubeConfig { get; set; } + + } + /// Managed cluster Access Profile. + internal partial interface IManagedClusterAccessProfileInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal + { + /// Base64-encoded Kubernetes configuration file. + byte[] KubeConfig { get; set; } + /// AccessProfile of a managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAccessProfile Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.json.cs new file mode 100644 index 000000000000..f9c2ca2c6738 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAccessProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Managed cluster Access Profile. + public partial class ManagedClusterAccessProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAccessProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAccessProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AccessProfile.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.PowerShell.cs new file mode 100644 index 000000000000..08381b601ca0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A Kubernetes add-on profile for a managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAddonProfileTypeConverter))] + public partial class ManagedClusterAddonProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAddonProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAddonProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAddonProfile(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.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Config")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Config = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig) content.GetValueForProperty("Config",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Config, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfileConfigTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityObjectId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterAddonProfile(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.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Config")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Config = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig) content.GetValueForProperty("Config",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).Config, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfileConfigTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal)this).IdentityObjectId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A Kubernetes add-on profile for a managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAddonProfileTypeConverter))] + public partial interface IManagedClusterAddonProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.TypeConverter.cs new file mode 100644 index 000000000000..e682983227bc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAddonProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAddonProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAddonProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAddonProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.cs new file mode 100644 index 000000000000..566e648b9ce4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A Kubernetes add-on profile for a managed cluster. + public partial class ManagedClusterAddonProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig _config; + + /// Key-value pairs for configuring an add-on. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig Config { get => (this._config = this._config ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfileConfig()); set => this._config = value; } + + /// Backing field for property. + private bool _enabled; + + /// Whether the add-on is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity _identity; + + /// Information of user assigned identity used by this add-on. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity()); } + + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ClientId = value ?? null; } + + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ObjectId = value ?? null; } + + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ResourceId = value ?? null; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity()); set { {_identity = value;} } } + + /// Creates an new instance. + public ManagedClusterAddonProfile() + { + + } + } + /// A Kubernetes add-on profile for a managed cluster. + public partial interface IManagedClusterAddonProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Key-value pairs for configuring an add-on. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Key-value pairs for configuring an add-on.", + SerializedName = @"config", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig Config { get; set; } + /// Whether the add-on is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the add-on is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client ID of the user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object ID of the user assigned identity.", + SerializedName = @"objectId", + PossibleTypes = new [] { typeof(string) })] + string IdentityObjectId { get; set; } + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the user assigned identity.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string IdentityResourceId { get; set; } + + } + /// A Kubernetes add-on profile for a managed cluster. + internal partial interface IManagedClusterAddonProfileInternal + + { + /// Key-value pairs for configuring an add-on. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig Config { get; set; } + /// Whether the add-on is enabled or not. + bool Enabled { get; set; } + /// Information of user assigned identity used by this add-on. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Identity { get; set; } + /// The client ID of the user assigned identity. + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + string IdentityObjectId { get; set; } + /// The resource ID of the user assigned identity. + string IdentityResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.json.cs new file mode 100644 index 000000000000..524091a848bf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfile.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A Kubernetes add-on profile for a managed cluster. + public partial class ManagedClusterAddonProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAddonProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAddonProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.UserAssignedIdentity.FromJson(__jsonIdentity) : Identity;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_config = If( json?.PropertyT("config"), out var __jsonConfig) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfileConfig.FromJson(__jsonConfig) : Config;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + AddIf( null != this._config ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._config.ToJson(null,serializationMode) : null, "config" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.PowerShell.cs new file mode 100644 index 000000000000..5b5e11ffe7ba --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Key-value pairs for configuring an add-on. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAddonProfileConfigTypeConverter))] + public partial class ManagedClusterAddonProfileConfig + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAddonProfileConfig(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAddonProfileConfig(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAddonProfileConfig(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 ManagedClusterAddonProfileConfig(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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Key-value pairs for configuring an add-on. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAddonProfileConfigTypeConverter))] + public partial interface IManagedClusterAddonProfileConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.TypeConverter.cs new file mode 100644 index 000000000000..ae2e0d0c5e4a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAddonProfileConfigTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAddonProfileConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAddonProfileConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAddonProfileConfig.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.cs new file mode 100644 index 000000000000..1abb0cfadc70 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Key-value pairs for configuring an add-on. + public partial class ManagedClusterAddonProfileConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfigInternal + { + + /// Creates an new instance. + public ManagedClusterAddonProfileConfig() + { + + } + } + /// Key-value pairs for configuring an add-on. + public partial interface IManagedClusterAddonProfileConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// Key-value pairs for configuring an add-on. + internal partial interface IManagedClusterAddonProfileConfigInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.dictionary.cs new file mode 100644 index 000000000000..dc6803e37900 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterAddonProfileConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfileConfig source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.json.cs new file mode 100644 index 000000000000..0c4bfd0da3ff --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileConfig.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Key-value pairs for configuring an add-on. + public partial class ManagedClusterAddonProfileConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAddonProfileConfig(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedClusterAddonProfileConfig(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.PowerShell.cs new file mode 100644 index 000000000000..dc82778e9174 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Information of user assigned identity used by this add-on. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAddonProfileIdentityTypeConverter))] + public partial class ManagedClusterAddonProfileIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAddonProfileIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAddonProfileIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAddonProfileIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + } + if (content.Contains("ObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ObjectId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterAddonProfileIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + } + if (content.Contains("ObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ObjectId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information of user assigned identity used by this add-on. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAddonProfileIdentityTypeConverter))] + public partial interface IManagedClusterAddonProfileIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.TypeConverter.cs new file mode 100644 index 000000000000..6472e678e7b2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAddonProfileIdentityTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAddonProfileIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAddonProfileIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAddonProfileIdentity.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.cs new file mode 100644 index 000000000000..af0766ca6128 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Information of user assigned identity used by this add-on. + public partial class ManagedClusterAddonProfileIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentityInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity __userAssignedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity(); + + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string ClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)__userAssignedIdentity).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)__userAssignedIdentity).ClientId = value ?? null; } + + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string ObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)__userAssignedIdentity).ObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)__userAssignedIdentity).ObjectId = value ?? null; } + + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string ResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)__userAssignedIdentity).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)__userAssignedIdentity).ResourceId = value ?? null; } + + /// Creates an new instance. + public ManagedClusterAddonProfileIdentity() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__userAssignedIdentity), __userAssignedIdentity); + await eventListener.AssertObjectIsValid(nameof(__userAssignedIdentity), __userAssignedIdentity); + } + } + /// Information of user assigned identity used by this add-on. + public partial interface IManagedClusterAddonProfileIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity + { + + } + /// Information of user assigned identity used by this add-on. + internal partial interface IManagedClusterAddonProfileIdentityInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.json.cs new file mode 100644 index 000000000000..6d1698984b5e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAddonProfileIdentity.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Information of user assigned identity used by this add-on. + public partial class ManagedClusterAddonProfileIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfileIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAddonProfileIdentity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAddonProfileIdentity(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __userAssignedIdentity = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __userAssignedIdentity?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.PowerShell.cs new file mode 100644 index 000000000000..0a809a1cd8fd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.PowerShell.cs @@ -0,0 +1,858 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Profile for the container service agent pool. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAgentPoolProfileTypeConverter))] + public partial class ManagedClusterAgentPoolProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAgentPoolProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAgentPoolProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAgentPoolProfile(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.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingDrainTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingDrainTimeoutInMinute = (int?) content.GetValueForProperty("UpgradeSettingDrainTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingDrainTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingNodeSoakDurationInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingNodeSoakDurationInMinute = (int?) content.GetValueForProperty("UpgradeSettingNodeSoakDurationInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingNodeSoakDurationInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingUndrainableNodeBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingUndrainableNodeBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior?) content.GetValueForProperty("UpgradeSettingUndrainableNodeBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingUndrainableNodeBehavior, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior.CreateFrom); + } + if (content.Contains("KubeletConfigCpuManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuManagerPolicy = (string) content.GetValueForProperty("KubeletConfigCpuManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigCpuCfsQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuota = (bool?) content.GetValueForProperty("KubeletConfigCpuCfsQuota",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuota, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigCpuCfsQuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuotaPeriod = (string) content.GetValueForProperty("KubeletConfigCpuCfsQuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigImageGcHighThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcHighThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcHighThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcHighThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigImageGcLowThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcLowThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcLowThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcLowThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigTopologyManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigTopologyManagerPolicy = (string) content.GetValueForProperty("KubeletConfigTopologyManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigTopologyManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigAllowedUnsafeSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigAllowedUnsafeSysctl = (string[]) content.GetValueForProperty("KubeletConfigAllowedUnsafeSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigAllowedUnsafeSysctl, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubeletConfigFailSwapOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigFailSwapOn = (bool?) content.GetValueForProperty("KubeletConfigFailSwapOn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigFailSwapOn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigContainerLogMaxSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxSizeMb = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigContainerLogMaxFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxFile = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxFile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxFile, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigPodMaxPid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigPodMaxPid = (int?) content.GetValueForProperty("KubeletConfigPodMaxPid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigPodMaxPid, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigTransparentHugePageEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageEnabled = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageEnabled, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigTransparentHugePageDefrag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageDefrag = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageDefrag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageDefrag, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigSwapFileSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSwapFileSizeMb = (int?) content.GetValueForProperty("LinuxOSConfigSwapFileSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSwapFileSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSysctl = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) content.GetValueForProperty("LinuxOSConfigSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSysctl, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileDisableOutboundNat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowProfileDisableOutboundNat = (bool?) content.GetValueForProperty("WindowProfileDisableOutboundNat",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowProfileDisableOutboundNat, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNodePublicIPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileNodePublicIPTag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]) content.GetValueForProperty("NetworkProfileNodePublicIPTag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileNodePublicIPTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTagTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileAllowedHostPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileAllowedHostPort = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]) content.GetValueForProperty("NetworkProfileAllowedHostPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileAllowedHostPort, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileApplicationSecurityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileApplicationSecurityGroup = (string[]) content.GetValueForProperty("NetworkProfileApplicationSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileApplicationSecurityGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SecurityProfileSshAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileSshAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess?) content.GetValueForProperty("SecurityProfileSshAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileSshAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess.CreateFrom); + } + if (content.Contains("SecurityProfileEnableVtpm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableVtpm = (bool?) content.GetValueForProperty("SecurityProfileEnableVtpm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableVtpm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityProfileEnableSecureBoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableSecureBoot = (bool?) content.GetValueForProperty("SecurityProfileEnableSecureBoot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableSecureBoot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuProfileInstallGpuDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfileInstallGpuDriver = (bool?) content.GetValueForProperty("GpuProfileInstallGpuDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfileInstallGpuDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ArtifactStreamingProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfileEnabled = (bool?) content.GetValueForProperty("ArtifactStreamingProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VirtualMachineProfileScale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineProfileScale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile) content.GetValueForProperty("VirtualMachineProfileScale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineProfileScale, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfilePublicIPPrefixSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfilePublicIPPrefixSize = (int?) content.GetValueForProperty("GatewayProfilePublicIPPrefixSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfilePublicIPPrefixSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ScaleManual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleManual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("ScaleManual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleManual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleAutoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleAutoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("ScaleAutoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleAutoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("KubeletConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig) content.GetValueForProperty("KubeletConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfigTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxOSConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig) content.GetValueForProperty("LinuxOSConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GpuProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile) content.GetValueForProperty("GpuProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ArtifactStreamingProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile) content.GetValueForProperty("ArtifactStreamingProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfileTypeConverter.ConvertFrom); + } + if (content.Contains("VirtualMachinesProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachinesProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile) content.GetValueForProperty("VirtualMachinesProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachinesProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachinesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile) content.GetValueForProperty("GatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskSizeGb = (int?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskSizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType?) content.GetValueForProperty("OSDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType.CreateFrom); + } + if (content.Contains("KubeletDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType?) content.GetValueForProperty("KubeletDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType.CreateFrom); + } + if (content.Contains("WorkloadRuntime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WorkloadRuntime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime?) content.GetValueForProperty("WorkloadRuntime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WorkloadRuntime, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime.CreateFrom); + } + if (content.Contains("MessageOfTheDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MessageOfTheDay = (string) content.GetValueForProperty("MessageOfTheDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MessageOfTheDay, global::System.Convert.ToString); + } + if (content.Contains("VnetSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VnetSubnetId = (string) content.GetValueForProperty("VnetSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VnetSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodSubnetId = (string) content.GetValueForProperty("PodSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodIPAllocationMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodIPAllocationMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode?) content.GetValueForProperty("PodIPAllocationMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodIPAllocationMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode.CreateFrom); + } + if (content.Contains("MaxPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxPod = (int?) content.GetValueForProperty("MaxPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxPod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("MaxCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxCount = (int?) content.GetValueForProperty("MaxCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MinCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MinCount = (int?) content.GetValueForProperty("MinCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MinCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnableAutoScaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableAutoScaling = (bool?) content.GetValueForProperty("EnableAutoScaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableAutoScaling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ScaleDownMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleDownMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode?) content.GetValueForProperty("ScaleDownMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleDownMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType.CreateFrom); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode.CreateFrom); + } + if (content.Contains("OrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OrchestratorVersion = (string) content.GetValueForProperty("OrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentOrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CurrentOrchestratorVersion = (string) content.GetValueForProperty("CurrentOrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CurrentOrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnableNodePublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableNodePublicIP = (bool?) content.GetValueForProperty("EnableNodePublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableNodePublicIP, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableCustomCaTrust")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableCustomCaTrust = (bool?) content.GetValueForProperty("EnableCustomCaTrust",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableCustomCaTrust, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodePublicIPPrefixId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodePublicIPPrefixId = (string) content.GetValueForProperty("NodePublicIPPrefixId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodePublicIPPrefixId, global::System.Convert.ToString); + } + if (content.Contains("ScaleSetPriority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetPriority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority?) content.GetValueForProperty("ScaleSetPriority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetPriority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority.CreateFrom); + } + if (content.Contains("ScaleSetEvictionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetEvictionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy?) content.GetValueForProperty("ScaleSetEvictionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetEvictionPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy.CreateFrom); + } + if (content.Contains("SpotMaxPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SpotMaxPrice = (float?) content.GetValueForProperty("SpotMaxPrice",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SpotMaxPrice, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeLabel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels) content.GetValueForProperty("NodeLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeLabel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabelsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeTaint = (string[]) content.GetValueForProperty("NodeTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeInitializationTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeInitializationTaint = (string[]) content.GetValueForProperty("NodeInitializationTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeInitializationTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProximityPlacementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProximityPlacementGroupId = (string) content.GetValueForProperty("ProximityPlacementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProximityPlacementGroupId, global::System.Convert.ToString); + } + if (content.Contains("EnableEncryptionAtHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableEncryptionAtHost = (bool?) content.GetValueForProperty("EnableEncryptionAtHost",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableEncryptionAtHost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableUltraSsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableUltraSsd = (bool?) content.GetValueForProperty("EnableUltraSsd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableUltraSsd, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuInstanceProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuInstanceProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile?) content.GetValueForProperty("GpuInstanceProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuInstanceProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile.CreateFrom); + } + if (content.Contains("CapacityReservationGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CapacityReservationGroupId = (string) content.GetValueForProperty("CapacityReservationGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CapacityReservationGroupId, global::System.Convert.ToString); + } + if (content.Contains("HostGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).HostGroupId = (string) content.GetValueForProperty("HostGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).HostGroupId, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineNodesStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineNodesStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[]) content.GetValueForProperty("VirtualMachineNodesStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineNodesStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachineNodesTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterAgentPoolProfile(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.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingDrainTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingDrainTimeoutInMinute = (int?) content.GetValueForProperty("UpgradeSettingDrainTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingDrainTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingNodeSoakDurationInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingNodeSoakDurationInMinute = (int?) content.GetValueForProperty("UpgradeSettingNodeSoakDurationInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingNodeSoakDurationInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingUndrainableNodeBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingUndrainableNodeBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior?) content.GetValueForProperty("UpgradeSettingUndrainableNodeBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingUndrainableNodeBehavior, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior.CreateFrom); + } + if (content.Contains("KubeletConfigCpuManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuManagerPolicy = (string) content.GetValueForProperty("KubeletConfigCpuManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigCpuCfsQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuota = (bool?) content.GetValueForProperty("KubeletConfigCpuCfsQuota",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuota, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigCpuCfsQuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuotaPeriod = (string) content.GetValueForProperty("KubeletConfigCpuCfsQuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigImageGcHighThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcHighThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcHighThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcHighThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigImageGcLowThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcLowThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcLowThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcLowThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigTopologyManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigTopologyManagerPolicy = (string) content.GetValueForProperty("KubeletConfigTopologyManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigTopologyManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigAllowedUnsafeSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigAllowedUnsafeSysctl = (string[]) content.GetValueForProperty("KubeletConfigAllowedUnsafeSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigAllowedUnsafeSysctl, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubeletConfigFailSwapOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigFailSwapOn = (bool?) content.GetValueForProperty("KubeletConfigFailSwapOn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigFailSwapOn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigContainerLogMaxSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxSizeMb = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigContainerLogMaxFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxFile = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxFile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxFile, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigPodMaxPid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigPodMaxPid = (int?) content.GetValueForProperty("KubeletConfigPodMaxPid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigPodMaxPid, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigTransparentHugePageEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageEnabled = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageEnabled, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigTransparentHugePageDefrag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageDefrag = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageDefrag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageDefrag, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigSwapFileSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSwapFileSizeMb = (int?) content.GetValueForProperty("LinuxOSConfigSwapFileSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSwapFileSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSysctl = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) content.GetValueForProperty("LinuxOSConfigSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSysctl, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileDisableOutboundNat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowProfileDisableOutboundNat = (bool?) content.GetValueForProperty("WindowProfileDisableOutboundNat",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowProfileDisableOutboundNat, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNodePublicIPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileNodePublicIPTag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]) content.GetValueForProperty("NetworkProfileNodePublicIPTag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileNodePublicIPTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTagTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileAllowedHostPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileAllowedHostPort = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]) content.GetValueForProperty("NetworkProfileAllowedHostPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileAllowedHostPort, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileApplicationSecurityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileApplicationSecurityGroup = (string[]) content.GetValueForProperty("NetworkProfileApplicationSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileApplicationSecurityGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SecurityProfileSshAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileSshAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess?) content.GetValueForProperty("SecurityProfileSshAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileSshAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess.CreateFrom); + } + if (content.Contains("SecurityProfileEnableVtpm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableVtpm = (bool?) content.GetValueForProperty("SecurityProfileEnableVtpm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableVtpm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityProfileEnableSecureBoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableSecureBoot = (bool?) content.GetValueForProperty("SecurityProfileEnableSecureBoot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableSecureBoot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuProfileInstallGpuDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfileInstallGpuDriver = (bool?) content.GetValueForProperty("GpuProfileInstallGpuDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfileInstallGpuDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ArtifactStreamingProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfileEnabled = (bool?) content.GetValueForProperty("ArtifactStreamingProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VirtualMachineProfileScale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineProfileScale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile) content.GetValueForProperty("VirtualMachineProfileScale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineProfileScale, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfilePublicIPPrefixSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfilePublicIPPrefixSize = (int?) content.GetValueForProperty("GatewayProfilePublicIPPrefixSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfilePublicIPPrefixSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ScaleManual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleManual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("ScaleManual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleManual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleAutoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleAutoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("ScaleAutoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleAutoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("KubeletConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig) content.GetValueForProperty("KubeletConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfigTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxOSConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig) content.GetValueForProperty("LinuxOSConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GpuProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile) content.GetValueForProperty("GpuProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ArtifactStreamingProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile) content.GetValueForProperty("ArtifactStreamingProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfileTypeConverter.ConvertFrom); + } + if (content.Contains("VirtualMachinesProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachinesProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile) content.GetValueForProperty("VirtualMachinesProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachinesProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachinesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile) content.GetValueForProperty("GatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskSizeGb = (int?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskSizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType?) content.GetValueForProperty("OSDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType.CreateFrom); + } + if (content.Contains("KubeletDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType?) content.GetValueForProperty("KubeletDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType.CreateFrom); + } + if (content.Contains("WorkloadRuntime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WorkloadRuntime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime?) content.GetValueForProperty("WorkloadRuntime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WorkloadRuntime, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime.CreateFrom); + } + if (content.Contains("MessageOfTheDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MessageOfTheDay = (string) content.GetValueForProperty("MessageOfTheDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MessageOfTheDay, global::System.Convert.ToString); + } + if (content.Contains("VnetSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VnetSubnetId = (string) content.GetValueForProperty("VnetSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VnetSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodSubnetId = (string) content.GetValueForProperty("PodSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodIPAllocationMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodIPAllocationMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode?) content.GetValueForProperty("PodIPAllocationMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodIPAllocationMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode.CreateFrom); + } + if (content.Contains("MaxPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxPod = (int?) content.GetValueForProperty("MaxPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxPod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("MaxCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxCount = (int?) content.GetValueForProperty("MaxCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MinCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MinCount = (int?) content.GetValueForProperty("MinCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MinCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnableAutoScaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableAutoScaling = (bool?) content.GetValueForProperty("EnableAutoScaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableAutoScaling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ScaleDownMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleDownMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode?) content.GetValueForProperty("ScaleDownMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleDownMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType.CreateFrom); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode.CreateFrom); + } + if (content.Contains("OrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OrchestratorVersion = (string) content.GetValueForProperty("OrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentOrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CurrentOrchestratorVersion = (string) content.GetValueForProperty("CurrentOrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CurrentOrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnableNodePublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableNodePublicIP = (bool?) content.GetValueForProperty("EnableNodePublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableNodePublicIP, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableCustomCaTrust")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableCustomCaTrust = (bool?) content.GetValueForProperty("EnableCustomCaTrust",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableCustomCaTrust, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodePublicIPPrefixId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodePublicIPPrefixId = (string) content.GetValueForProperty("NodePublicIPPrefixId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodePublicIPPrefixId, global::System.Convert.ToString); + } + if (content.Contains("ScaleSetPriority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetPriority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority?) content.GetValueForProperty("ScaleSetPriority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetPriority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority.CreateFrom); + } + if (content.Contains("ScaleSetEvictionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetEvictionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy?) content.GetValueForProperty("ScaleSetEvictionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetEvictionPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy.CreateFrom); + } + if (content.Contains("SpotMaxPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SpotMaxPrice = (float?) content.GetValueForProperty("SpotMaxPrice",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SpotMaxPrice, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeLabel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels) content.GetValueForProperty("NodeLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeLabel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabelsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeTaint = (string[]) content.GetValueForProperty("NodeTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeInitializationTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeInitializationTaint = (string[]) content.GetValueForProperty("NodeInitializationTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeInitializationTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProximityPlacementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProximityPlacementGroupId = (string) content.GetValueForProperty("ProximityPlacementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProximityPlacementGroupId, global::System.Convert.ToString); + } + if (content.Contains("EnableEncryptionAtHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableEncryptionAtHost = (bool?) content.GetValueForProperty("EnableEncryptionAtHost",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableEncryptionAtHost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableUltraSsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableUltraSsd = (bool?) content.GetValueForProperty("EnableUltraSsd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableUltraSsd, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuInstanceProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuInstanceProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile?) content.GetValueForProperty("GpuInstanceProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuInstanceProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile.CreateFrom); + } + if (content.Contains("CapacityReservationGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CapacityReservationGroupId = (string) content.GetValueForProperty("CapacityReservationGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CapacityReservationGroupId, global::System.Convert.ToString); + } + if (content.Contains("HostGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).HostGroupId = (string) content.GetValueForProperty("HostGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).HostGroupId, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineNodesStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineNodesStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[]) content.GetValueForProperty("VirtualMachineNodesStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineNodesStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachineNodesTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Profile for the container service agent pool. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAgentPoolProfileTypeConverter))] + public partial interface IManagedClusterAgentPoolProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.TypeConverter.cs new file mode 100644 index 000000000000..9bda1d5c196d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAgentPoolProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAgentPoolProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAgentPoolProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAgentPoolProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.cs new file mode 100644 index 000000000000..b19c917d33e8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.cs @@ -0,0 +1,598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile for the container service agent pool. + public partial class ManagedClusterAgentPoolProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties __managedClusterAgentPoolProfileProperties = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileProperties(); + + /// Configuration for using artifact streaming on AKS. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile ArtifactStreamingProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ArtifactStreamingProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ArtifactStreamingProfile = value ?? null /* model class */; } + + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? ArtifactStreamingProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ArtifactStreamingProfileEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ArtifactStreamingProfileEnabled = value ?? default(bool); } + + /// + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string[] AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).AvailabilityZone = value ?? null /* arrayOf */; } + + /// + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string CapacityReservationGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).CapacityReservationGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).CapacityReservationGroupId = value ?? null; } + + /// + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user + /// pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? Count { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).Count = value ?? default(int); } + + /// + /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).CreationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).CreationData = value ?? null /* model class */; } + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string CreationDataSourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).CreationDataSourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).CreationDataSourceResourceId = value ?? null; } + + /// + /// If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + /// was , this field will contain the full version being used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string CurrentOrchestratorVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).CurrentOrchestratorVersion; } + + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ETag; } + + /// Whether to enable auto-scaler + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? EnableAutoScaling { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableAutoScaling; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableAutoScaling = value ?? default(bool); } + + /// + /// When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + /// host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node + /// trust stores. Defaults to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? EnableCustomCaTrust { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableCustomCaTrust; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableCustomCaTrust = value ?? default(bool); } + + /// + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? EnableEncryptionAtHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableEncryptionAtHost; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableEncryptionAtHost = value ?? default(bool); } + + /// + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? EnableFips { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableFips; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableFips = value ?? default(bool); } + + /// + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario + /// is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + /// For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + /// The default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? EnableNodePublicIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableNodePublicIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableNodePublicIP = value ?? default(bool); } + + /// Whether to enable UltraSSD + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? EnableUltraSsd { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableUltraSsd; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).EnableUltraSsd = value ?? default(bool); } + + /// + /// Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile GatewayProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GatewayProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GatewayProfile = value ?? null /* model class */; } + + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? GatewayProfilePublicIPPrefixSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GatewayProfilePublicIPPrefixSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GatewayProfilePublicIPPrefixSize = value ?? default(int); } + + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile? GpuInstanceProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GpuInstanceProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GpuInstanceProfile = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile)""); } + + /// The GPU settings of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile GpuProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GpuProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GpuProfile = value ?? null /* model class */; } + + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? GpuProfileInstallGpuDriver { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GpuProfileInstallGpuDriver; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).GpuProfileInstallGpuDriver = value ?? default(bool); } + + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + /// For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string HostGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).HostGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).HostGroupId = value ?? null; } + + /// The Kubelet configuration on the agent pool nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig KubeletConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfig = value ?? null /* model class */; } + + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string[] KubeletConfigAllowedUnsafeSysctl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigAllowedUnsafeSysctl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigAllowedUnsafeSysctl = value ?? null /* arrayOf */; } + + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? KubeletConfigContainerLogMaxFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigContainerLogMaxFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigContainerLogMaxFile = value ?? default(int); } + + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? KubeletConfigContainerLogMaxSizeMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigContainerLogMaxSizeMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigContainerLogMaxSizeMb = value ?? default(int); } + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? KubeletConfigCpuCfsQuota { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigCpuCfsQuota; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigCpuCfsQuota = value ?? default(bool); } + + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string KubeletConfigCpuCfsQuotaPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigCpuCfsQuotaPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigCpuCfsQuotaPeriod = value ?? null; } + + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string KubeletConfigCpuManagerPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigCpuManagerPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigCpuManagerPolicy = value ?? null; } + + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? KubeletConfigFailSwapOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigFailSwapOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigFailSwapOn = value ?? default(bool); } + + /// To disable image garbage collection, set to 100. The default is 85% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? KubeletConfigImageGcHighThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigImageGcHighThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigImageGcHighThreshold = value ?? default(int); } + + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? KubeletConfigImageGcLowThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigImageGcLowThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigImageGcLowThreshold = value ?? default(int); } + + /// The maximum number of processes per pod. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? KubeletConfigPodMaxPid { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigPodMaxPid; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigPodMaxPid = value ?? default(int); } + + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string KubeletConfigTopologyManagerPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigTopologyManagerPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletConfigTopologyManagerPolicy = value ?? null; } + + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType? KubeletDiskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletDiskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).KubeletDiskType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType)""); } + + /// The OS configuration of Linux agent nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig LinuxOSConfig { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfig; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfig = value ?? null /* model class */; } + + /// The size in MB of a swap file that will be created on each node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? LinuxOSConfigSwapFileSizeMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfigSwapFileSizeMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfigSwapFileSizeMb = value ?? default(int); } + + /// Sysctl settings for Linux agent nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig LinuxOSConfigSysctl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfigSysctl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfigSysctl = value ?? null /* model class */; } + + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string LinuxOSConfigTransparentHugePageDefrag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfigTransparentHugePageDefrag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfigTransparentHugePageDefrag = value ?? null; } + + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string LinuxOSConfigTransparentHugePageEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfigTransparentHugePageEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).LinuxOSConfigTransparentHugePageEnabled = value ?? null; } + + /// The maximum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? MaxCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).MaxCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).MaxCount = value ?? default(int); } + + /// The maximum number of pods that can run on a node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? MaxPod { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).MaxPod; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).MaxPod = value ?? default(int); } + + /// + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + /// the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed + /// raw and not be executed as a script). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string MessageOfTheDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).MessageOfTheDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).MessageOfTheDay = value ?? null; } + + /// Internal Acessors for CurrentOrchestratorVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.CurrentOrchestratorVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).CurrentOrchestratorVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).CurrentOrchestratorVersion = value; } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.ETag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ETag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ETag = value; } + + /// Internal Acessors for NodeImageVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.NodeImageVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodeImageVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodeImageVersion = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ProvisioningState = value; } + + /// The minimum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? MinCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).MinCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).MinCount = value ?? default(int); } + + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode? Mode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).Mode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).Mode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode)""); } + + /// Backing field for property. + private string _name; + + /// Windows agent pool names must be 6 characters or less. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Network-related settings of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile NetworkProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NetworkProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NetworkProfile = value ?? null /* model class */; } + + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] NetworkProfileAllowedHostPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NetworkProfileAllowedHostPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NetworkProfileAllowedHostPort = value ?? null /* arrayOf */; } + + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string[] NetworkProfileApplicationSecurityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NetworkProfileApplicationSecurityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NetworkProfileApplicationSecurityGroup = value ?? null /* arrayOf */; } + + /// IPTags of instance-level public IPs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NetworkProfileNodePublicIPTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NetworkProfileNodePublicIPTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NetworkProfileNodePublicIPTag = value ?? null /* arrayOf */; } + + /// The version of node image + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string NodeImageVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodeImageVersion; } + + /// + /// These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + /// pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + /// node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, + /// for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string[] NodeInitializationTaint { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodeInitializationTaint; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodeInitializationTaint = value ?? null /* arrayOf */; } + + /// The node labels to be persisted across all nodes in agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels NodeLabel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodeLabel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodeLabel = value ?? null /* model class */; } + + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string NodePublicIPPrefixId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodePublicIPPrefixId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodePublicIPPrefixId = value ?? null; } + + /// + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string[] NodeTaint { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodeTaint; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).NodeTaint = value ?? null /* arrayOf */; } + + /// + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it + /// will apply the default osDisk size according to the vmSize specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? OSDiskSizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OSDiskSizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OSDiskSizeGb = value ?? default(int); } + + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType? OSDiskType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OSDiskType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OSDiskType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType)""); } + + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OSSku; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OSSku = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku)""); } + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OSType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OSType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType)""); } + + /// + /// Both patch version and are supported. When is specified, the latest supported + /// patch version is chosen automatically. Updating the agent pool with the same once it has been created will + /// not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools + /// in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control + /// plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version + /// cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string OrchestratorVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OrchestratorVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).OrchestratorVersion = value ?? null; } + + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode? PodIPAllocationMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).PodIPAllocationMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).PodIPAllocationMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode)""); } + + /// + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string PodSubnetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).PodSubnetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).PodSubnetId = value ?? null; } + + /// + /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. + /// A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it + /// is Running and provisioning state is Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).PowerState = value ?? null /* model class */; } + + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).PowerStateCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).PowerStateCode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code)""); } + + /// The current deployment or provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ProvisioningState; } + + /// The ID for Proximity Placement Group. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string ProximityPlacementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ProximityPlacementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ProximityPlacementGroupId = value ?? null; } + + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleAutoscale; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleAutoscale = value ?? null /* arrayOf */; } + + /// + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode? ScaleDownMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleDownMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleDownMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode)""); } + + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleManual; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleManual = value ?? null /* arrayOf */; } + + /// + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleSetEvictionPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleSetEvictionPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy)""); } + + /// + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority? ScaleSetPriority { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleSetPriority; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).ScaleSetPriority = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority)""); } + + /// The security settings of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile SecurityProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SecurityProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SecurityProfile = value ?? null /* model class */; } + + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? SecurityProfileEnableSecureBoot { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SecurityProfileEnableSecureBoot; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SecurityProfileEnableSecureBoot = value ?? default(bool); } + + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? SecurityProfileEnableVtpm { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SecurityProfileEnableVtpm; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SecurityProfileEnableVtpm = value ?? default(bool); } + + /// SSH access method of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SecurityProfileSshAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SecurityProfileSshAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SecurityProfileSshAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess)""); } + + /// + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + /// For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public float? SpotMaxPrice { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SpotMaxPrice; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).SpotMaxPrice = value ?? default(float); } + + /// The tags to be persisted on the agent pool virtual machine scale set. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).Tag = value ?? null /* model class */; } + + /// The type of Agent Pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType? Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType)""); } + + /// Settings for upgrading the agentpool + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings UpgradeSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSetting = value ?? null /* model class */; } + + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? UpgradeSettingDrainTimeoutInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSettingDrainTimeoutInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSettingDrainTimeoutInMinute = value ?? default(int); } + + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSettingMaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSettingMaxSurge = value ?? null; } + + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public int? UpgradeSettingNodeSoakDurationInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSettingNodeSoakDurationInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSettingNodeSoakDurationInMinute = value ?? default(int); } + + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UpgradeSettingUndrainableNodeBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSettingUndrainableNodeBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).UpgradeSettingUndrainableNodeBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior)""); } + + /// + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might + /// fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string VMSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VMSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VMSize = value ?? null; } + + /// The status of nodes in a VirtualMachines agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] VirtualMachineNodesStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VirtualMachineNodesStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VirtualMachineNodesStatus = value ?? null /* arrayOf */; } + + /// Specifications on how to scale a VirtualMachines agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile VirtualMachineProfileScale { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VirtualMachineProfileScale; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VirtualMachineProfileScale = value ?? null /* model class */; } + + /// Specifications on VirtualMachines agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile VirtualMachinesProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VirtualMachinesProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VirtualMachinesProfile = value ?? null /* model class */; } + + /// + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to + /// nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string VnetSubnetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VnetSubnetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).VnetSubnetId = value ?? null; } + + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public bool? WindowProfileDisableOutboundNat { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).WindowProfileDisableOutboundNat; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).WindowProfileDisableOutboundNat = value ?? default(bool); } + + /// The Windows agent pool's specific profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile WindowsProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).WindowsProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).WindowsProfile = value ?? null /* model class */; } + + /// Determines the type of workload a node can run. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime? WorkloadRuntime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).WorkloadRuntime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)__managedClusterAgentPoolProfileProperties).WorkloadRuntime = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime)""); } + + /// Creates an new instance. + public ManagedClusterAgentPoolProfile() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__managedClusterAgentPoolProfileProperties), __managedClusterAgentPoolProfileProperties); + await eventListener.AssertObjectIsValid(nameof(__managedClusterAgentPoolProfileProperties), __managedClusterAgentPoolProfileProperties); + } + } + /// Profile for the container service agent pool. + public partial interface IManagedClusterAgentPoolProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties + { + /// Windows agent pool names must be 6 characters or less. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Windows agent pool names must be 6 characters or less.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Profile for the container service agent pool. + internal partial interface IManagedClusterAgentPoolProfileInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal + { + /// Windows agent pool names must be 6 characters or less. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.json.cs new file mode 100644 index 000000000000..6d9bb9029c73 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile for the container service agent pool. + public partial class ManagedClusterAgentPoolProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAgentPoolProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAgentPoolProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __managedClusterAgentPoolProfileProperties = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileProperties(json); + {_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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __managedClusterAgentPoolProfileProperties?.ToJson(container, serializationMode); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.PowerShell.cs new file mode 100644 index 000000000000..f224f5f274e6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.PowerShell.cs @@ -0,0 +1,853 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Properties for the container service agent pool profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAgentPoolProfilePropertiesTypeConverter))] + public partial class ManagedClusterAgentPoolProfileProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAgentPoolProfileProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAgentPoolProfileProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAgentPoolProfileProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("KubeletConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig) content.GetValueForProperty("KubeletConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfigTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxOSConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig) content.GetValueForProperty("LinuxOSConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GpuProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile) content.GetValueForProperty("GpuProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ArtifactStreamingProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile) content.GetValueForProperty("ArtifactStreamingProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfileTypeConverter.ConvertFrom); + } + if (content.Contains("VirtualMachinesProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachinesProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile) content.GetValueForProperty("VirtualMachinesProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachinesProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachinesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile) content.GetValueForProperty("GatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskSizeGb = (int?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskSizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType?) content.GetValueForProperty("OSDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType.CreateFrom); + } + if (content.Contains("KubeletDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType?) content.GetValueForProperty("KubeletDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType.CreateFrom); + } + if (content.Contains("WorkloadRuntime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WorkloadRuntime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime?) content.GetValueForProperty("WorkloadRuntime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WorkloadRuntime, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime.CreateFrom); + } + if (content.Contains("MessageOfTheDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MessageOfTheDay = (string) content.GetValueForProperty("MessageOfTheDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MessageOfTheDay, global::System.Convert.ToString); + } + if (content.Contains("VnetSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VnetSubnetId = (string) content.GetValueForProperty("VnetSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VnetSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodSubnetId = (string) content.GetValueForProperty("PodSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodIPAllocationMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodIPAllocationMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode?) content.GetValueForProperty("PodIPAllocationMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodIPAllocationMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode.CreateFrom); + } + if (content.Contains("MaxPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxPod = (int?) content.GetValueForProperty("MaxPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxPod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("MaxCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxCount = (int?) content.GetValueForProperty("MaxCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MinCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MinCount = (int?) content.GetValueForProperty("MinCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MinCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnableAutoScaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableAutoScaling = (bool?) content.GetValueForProperty("EnableAutoScaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableAutoScaling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ScaleDownMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleDownMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode?) content.GetValueForProperty("ScaleDownMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleDownMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType.CreateFrom); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode.CreateFrom); + } + if (content.Contains("OrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OrchestratorVersion = (string) content.GetValueForProperty("OrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentOrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CurrentOrchestratorVersion = (string) content.GetValueForProperty("CurrentOrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CurrentOrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnableNodePublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableNodePublicIP = (bool?) content.GetValueForProperty("EnableNodePublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableNodePublicIP, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableCustomCaTrust")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableCustomCaTrust = (bool?) content.GetValueForProperty("EnableCustomCaTrust",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableCustomCaTrust, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodePublicIPPrefixId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodePublicIPPrefixId = (string) content.GetValueForProperty("NodePublicIPPrefixId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodePublicIPPrefixId, global::System.Convert.ToString); + } + if (content.Contains("ScaleSetPriority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetPriority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority?) content.GetValueForProperty("ScaleSetPriority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetPriority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority.CreateFrom); + } + if (content.Contains("ScaleSetEvictionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetEvictionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy?) content.GetValueForProperty("ScaleSetEvictionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetEvictionPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy.CreateFrom); + } + if (content.Contains("SpotMaxPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SpotMaxPrice = (float?) content.GetValueForProperty("SpotMaxPrice",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SpotMaxPrice, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeLabel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels) content.GetValueForProperty("NodeLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeLabel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabelsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeTaint = (string[]) content.GetValueForProperty("NodeTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeInitializationTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeInitializationTaint = (string[]) content.GetValueForProperty("NodeInitializationTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeInitializationTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProximityPlacementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProximityPlacementGroupId = (string) content.GetValueForProperty("ProximityPlacementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProximityPlacementGroupId, global::System.Convert.ToString); + } + if (content.Contains("EnableEncryptionAtHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableEncryptionAtHost = (bool?) content.GetValueForProperty("EnableEncryptionAtHost",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableEncryptionAtHost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableUltraSsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableUltraSsd = (bool?) content.GetValueForProperty("EnableUltraSsd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableUltraSsd, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuInstanceProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuInstanceProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile?) content.GetValueForProperty("GpuInstanceProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuInstanceProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile.CreateFrom); + } + if (content.Contains("CapacityReservationGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CapacityReservationGroupId = (string) content.GetValueForProperty("CapacityReservationGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CapacityReservationGroupId, global::System.Convert.ToString); + } + if (content.Contains("HostGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).HostGroupId = (string) content.GetValueForProperty("HostGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).HostGroupId, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineNodesStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineNodesStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[]) content.GetValueForProperty("VirtualMachineNodesStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineNodesStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachineNodesTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingDrainTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingDrainTimeoutInMinute = (int?) content.GetValueForProperty("UpgradeSettingDrainTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingDrainTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingNodeSoakDurationInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingNodeSoakDurationInMinute = (int?) content.GetValueForProperty("UpgradeSettingNodeSoakDurationInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingNodeSoakDurationInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingUndrainableNodeBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingUndrainableNodeBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior?) content.GetValueForProperty("UpgradeSettingUndrainableNodeBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingUndrainableNodeBehavior, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior.CreateFrom); + } + if (content.Contains("KubeletConfigCpuManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuManagerPolicy = (string) content.GetValueForProperty("KubeletConfigCpuManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigCpuCfsQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuota = (bool?) content.GetValueForProperty("KubeletConfigCpuCfsQuota",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuota, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigCpuCfsQuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuotaPeriod = (string) content.GetValueForProperty("KubeletConfigCpuCfsQuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigImageGcHighThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcHighThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcHighThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcHighThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigImageGcLowThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcLowThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcLowThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcLowThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigTopologyManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigTopologyManagerPolicy = (string) content.GetValueForProperty("KubeletConfigTopologyManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigTopologyManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigAllowedUnsafeSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigAllowedUnsafeSysctl = (string[]) content.GetValueForProperty("KubeletConfigAllowedUnsafeSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigAllowedUnsafeSysctl, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubeletConfigFailSwapOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigFailSwapOn = (bool?) content.GetValueForProperty("KubeletConfigFailSwapOn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigFailSwapOn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigContainerLogMaxSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxSizeMb = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigContainerLogMaxFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxFile = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxFile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxFile, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigPodMaxPid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigPodMaxPid = (int?) content.GetValueForProperty("KubeletConfigPodMaxPid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigPodMaxPid, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigTransparentHugePageEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageEnabled = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageEnabled, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigTransparentHugePageDefrag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageDefrag = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageDefrag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageDefrag, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigSwapFileSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSwapFileSizeMb = (int?) content.GetValueForProperty("LinuxOSConfigSwapFileSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSwapFileSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSysctl = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) content.GetValueForProperty("LinuxOSConfigSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSysctl, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileDisableOutboundNat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowProfileDisableOutboundNat = (bool?) content.GetValueForProperty("WindowProfileDisableOutboundNat",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowProfileDisableOutboundNat, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNodePublicIPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileNodePublicIPTag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]) content.GetValueForProperty("NetworkProfileNodePublicIPTag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileNodePublicIPTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTagTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileAllowedHostPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileAllowedHostPort = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]) content.GetValueForProperty("NetworkProfileAllowedHostPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileAllowedHostPort, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileApplicationSecurityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileApplicationSecurityGroup = (string[]) content.GetValueForProperty("NetworkProfileApplicationSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileApplicationSecurityGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SecurityProfileSshAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileSshAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess?) content.GetValueForProperty("SecurityProfileSshAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileSshAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess.CreateFrom); + } + if (content.Contains("SecurityProfileEnableVtpm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableVtpm = (bool?) content.GetValueForProperty("SecurityProfileEnableVtpm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableVtpm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityProfileEnableSecureBoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableSecureBoot = (bool?) content.GetValueForProperty("SecurityProfileEnableSecureBoot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableSecureBoot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuProfileInstallGpuDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfileInstallGpuDriver = (bool?) content.GetValueForProperty("GpuProfileInstallGpuDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfileInstallGpuDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ArtifactStreamingProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfileEnabled = (bool?) content.GetValueForProperty("ArtifactStreamingProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VirtualMachineProfileScale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineProfileScale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile) content.GetValueForProperty("VirtualMachineProfileScale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineProfileScale, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfilePublicIPPrefixSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfilePublicIPPrefixSize = (int?) content.GetValueForProperty("GatewayProfilePublicIPPrefixSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfilePublicIPPrefixSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ScaleManual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleManual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("ScaleManual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleManual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleAutoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleAutoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("ScaleAutoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleAutoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterAgentPoolProfileProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("KubeletConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig) content.GetValueForProperty("KubeletConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfigTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxOSConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig) content.GetValueForProperty("LinuxOSConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GpuProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile) content.GetValueForProperty("GpuProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ArtifactStreamingProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile) content.GetValueForProperty("ArtifactStreamingProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfileTypeConverter.ConvertFrom); + } + if (content.Contains("VirtualMachinesProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachinesProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile) content.GetValueForProperty("VirtualMachinesProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachinesProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachinesProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile) content.GetValueForProperty("GatewayProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskSizeGb = (int?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskSizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType?) content.GetValueForProperty("OSDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType.CreateFrom); + } + if (content.Contains("KubeletDiskType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletDiskType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType?) content.GetValueForProperty("KubeletDiskType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletDiskType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType.CreateFrom); + } + if (content.Contains("WorkloadRuntime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WorkloadRuntime = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime?) content.GetValueForProperty("WorkloadRuntime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WorkloadRuntime, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime.CreateFrom); + } + if (content.Contains("MessageOfTheDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MessageOfTheDay = (string) content.GetValueForProperty("MessageOfTheDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MessageOfTheDay, global::System.Convert.ToString); + } + if (content.Contains("VnetSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VnetSubnetId = (string) content.GetValueForProperty("VnetSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VnetSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodSubnetId = (string) content.GetValueForProperty("PodSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodSubnetId, global::System.Convert.ToString); + } + if (content.Contains("PodIPAllocationMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodIPAllocationMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode?) content.GetValueForProperty("PodIPAllocationMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PodIPAllocationMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode.CreateFrom); + } + if (content.Contains("MaxPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxPod = (int?) content.GetValueForProperty("MaxPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxPod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("MaxCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxCount = (int?) content.GetValueForProperty("MaxCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MaxCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("MinCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MinCount = (int?) content.GetValueForProperty("MinCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).MinCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnableAutoScaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableAutoScaling = (bool?) content.GetValueForProperty("EnableAutoScaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableAutoScaling, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ScaleDownMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleDownMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode?) content.GetValueForProperty("ScaleDownMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleDownMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode.CreateFrom); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType.CreateFrom); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode.CreateFrom); + } + if (content.Contains("OrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OrchestratorVersion = (string) content.GetValueForProperty("OrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).OrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentOrchestratorVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CurrentOrchestratorVersion = (string) content.GetValueForProperty("CurrentOrchestratorVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CurrentOrchestratorVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnableNodePublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableNodePublicIP = (bool?) content.GetValueForProperty("EnableNodePublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableNodePublicIP, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableCustomCaTrust")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableCustomCaTrust = (bool?) content.GetValueForProperty("EnableCustomCaTrust",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableCustomCaTrust, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodePublicIPPrefixId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodePublicIPPrefixId = (string) content.GetValueForProperty("NodePublicIPPrefixId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodePublicIPPrefixId, global::System.Convert.ToString); + } + if (content.Contains("ScaleSetPriority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetPriority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority?) content.GetValueForProperty("ScaleSetPriority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetPriority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority.CreateFrom); + } + if (content.Contains("ScaleSetEvictionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetEvictionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy?) content.GetValueForProperty("ScaleSetEvictionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleSetEvictionPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy.CreateFrom); + } + if (content.Contains("SpotMaxPrice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SpotMaxPrice = (float?) content.GetValueForProperty("SpotMaxPrice",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SpotMaxPrice, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTagsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeLabel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels) content.GetValueForProperty("NodeLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeLabel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabelsTypeConverter.ConvertFrom); + } + if (content.Contains("NodeTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeTaint = (string[]) content.GetValueForProperty("NodeTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NodeInitializationTaint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeInitializationTaint = (string[]) content.GetValueForProperty("NodeInitializationTaint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NodeInitializationTaint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProximityPlacementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProximityPlacementGroupId = (string) content.GetValueForProperty("ProximityPlacementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ProximityPlacementGroupId, global::System.Convert.ToString); + } + if (content.Contains("EnableEncryptionAtHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableEncryptionAtHost = (bool?) content.GetValueForProperty("EnableEncryptionAtHost",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableEncryptionAtHost, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableUltraSsd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableUltraSsd = (bool?) content.GetValueForProperty("EnableUltraSsd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableUltraSsd, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuInstanceProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuInstanceProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile?) content.GetValueForProperty("GpuInstanceProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuInstanceProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile.CreateFrom); + } + if (content.Contains("CapacityReservationGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CapacityReservationGroupId = (string) content.GetValueForProperty("CapacityReservationGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CapacityReservationGroupId, global::System.Convert.ToString); + } + if (content.Contains("HostGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).HostGroupId = (string) content.GetValueForProperty("HostGroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).HostGroupId, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineNodesStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineNodesStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[]) content.GetValueForProperty("VirtualMachineNodesStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineNodesStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachineNodesTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingDrainTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingDrainTimeoutInMinute = (int?) content.GetValueForProperty("UpgradeSettingDrainTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingDrainTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingNodeSoakDurationInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingNodeSoakDurationInMinute = (int?) content.GetValueForProperty("UpgradeSettingNodeSoakDurationInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingNodeSoakDurationInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("UpgradeSettingUndrainableNodeBehavior")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingUndrainableNodeBehavior = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior?) content.GetValueForProperty("UpgradeSettingUndrainableNodeBehavior",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).UpgradeSettingUndrainableNodeBehavior, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior.CreateFrom); + } + if (content.Contains("KubeletConfigCpuManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuManagerPolicy = (string) content.GetValueForProperty("KubeletConfigCpuManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigCpuCfsQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuota = (bool?) content.GetValueForProperty("KubeletConfigCpuCfsQuota",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuota, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigCpuCfsQuotaPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuotaPeriod = (string) content.GetValueForProperty("KubeletConfigCpuCfsQuotaPeriod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigCpuCfsQuotaPeriod, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigImageGcHighThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcHighThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcHighThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcHighThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigImageGcLowThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcLowThreshold = (int?) content.GetValueForProperty("KubeletConfigImageGcLowThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigImageGcLowThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigTopologyManagerPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigTopologyManagerPolicy = (string) content.GetValueForProperty("KubeletConfigTopologyManagerPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigTopologyManagerPolicy, global::System.Convert.ToString); + } + if (content.Contains("KubeletConfigAllowedUnsafeSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigAllowedUnsafeSysctl = (string[]) content.GetValueForProperty("KubeletConfigAllowedUnsafeSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigAllowedUnsafeSysctl, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubeletConfigFailSwapOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigFailSwapOn = (bool?) content.GetValueForProperty("KubeletConfigFailSwapOn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigFailSwapOn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeletConfigContainerLogMaxSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxSizeMb = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigContainerLogMaxFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxFile = (int?) content.GetValueForProperty("KubeletConfigContainerLogMaxFile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigContainerLogMaxFile, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubeletConfigPodMaxPid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigPodMaxPid = (int?) content.GetValueForProperty("KubeletConfigPodMaxPid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).KubeletConfigPodMaxPid, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigTransparentHugePageEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageEnabled = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageEnabled, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigTransparentHugePageDefrag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageDefrag = (string) content.GetValueForProperty("LinuxOSConfigTransparentHugePageDefrag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigTransparentHugePageDefrag, global::System.Convert.ToString); + } + if (content.Contains("LinuxOSConfigSwapFileSizeMb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSwapFileSizeMb = (int?) content.GetValueForProperty("LinuxOSConfigSwapFileSizeMb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSwapFileSizeMb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LinuxOSConfigSysctl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSysctl = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) content.GetValueForProperty("LinuxOSConfigSysctl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).LinuxOSConfigSysctl, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SysctlConfigTypeConverter.ConvertFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileDisableOutboundNat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowProfileDisableOutboundNat = (bool?) content.GetValueForProperty("WindowProfileDisableOutboundNat",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).WindowProfileDisableOutboundNat, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNodePublicIPTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileNodePublicIPTag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[]) content.GetValueForProperty("NetworkProfileNodePublicIPTag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileNodePublicIPTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPTagTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileAllowedHostPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileAllowedHostPort = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[]) content.GetValueForProperty("NetworkProfileAllowedHostPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileAllowedHostPort, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PortRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkProfileApplicationSecurityGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileApplicationSecurityGroup = (string[]) content.GetValueForProperty("NetworkProfileApplicationSecurityGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).NetworkProfileApplicationSecurityGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("SecurityProfileSshAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileSshAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess?) content.GetValueForProperty("SecurityProfileSshAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileSshAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess.CreateFrom); + } + if (content.Contains("SecurityProfileEnableVtpm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableVtpm = (bool?) content.GetValueForProperty("SecurityProfileEnableVtpm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableVtpm, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityProfileEnableSecureBoot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableSecureBoot = (bool?) content.GetValueForProperty("SecurityProfileEnableSecureBoot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).SecurityProfileEnableSecureBoot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GpuProfileInstallGpuDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfileInstallGpuDriver = (bool?) content.GetValueForProperty("GpuProfileInstallGpuDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GpuProfileInstallGpuDriver, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ArtifactStreamingProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfileEnabled = (bool?) content.GetValueForProperty("ArtifactStreamingProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ArtifactStreamingProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VirtualMachineProfileScale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineProfileScale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile) content.GetValueForProperty("VirtualMachineProfileScale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).VirtualMachineProfileScale, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfileTypeConverter.ConvertFrom); + } + if (content.Contains("GatewayProfilePublicIPPrefixSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfilePublicIPPrefixSize = (int?) content.GetValueForProperty("GatewayProfilePublicIPPrefixSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).GatewayProfilePublicIPPrefixSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ScaleManual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleManual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("ScaleManual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleManual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleAutoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleAutoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("ScaleAutoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal)this).ScaleAutoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for the container service agent pool profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAgentPoolProfilePropertiesTypeConverter))] + public partial interface IManagedClusterAgentPoolProfileProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.TypeConverter.cs new file mode 100644 index 000000000000..5adab050c74b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAgentPoolProfilePropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAgentPoolProfileProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAgentPoolProfileProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAgentPoolProfileProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.cs new file mode 100644 index 000000000000..aa56d4d86357 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.cs @@ -0,0 +1,1862 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties for the container service agent pool profile. + public partial class ManagedClusterAgentPoolProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile _artifactStreamingProfile; + + /// Configuration for using artifact streaming on AKS. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile ArtifactStreamingProfile { get => (this._artifactStreamingProfile = this._artifactStreamingProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfile()); set => this._artifactStreamingProfile = value; } + + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ArtifactStreamingProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfileInternal)ArtifactStreamingProfile).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfileInternal)ArtifactStreamingProfile).Enabled = value ?? default(bool); } + + /// Backing field for property. + private string[] _availabilityZone; + + /// + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } + + /// Backing field for property. + private string _capacityReservationGroupId; + + /// + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string CapacityReservationGroupId { get => this._capacityReservationGroupId; set => this._capacityReservationGroupId = value; } + + /// Backing field for property. + private int? _count; + + /// + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user + /// pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData _creationData; + + /// + /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get => (this._creationData = this._creationData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData()); set => this._creationData = value; } + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CreationDataSourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)CreationData).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)CreationData).SourceResourceId = value ?? null; } + + /// Backing field for property. + private string _currentOrchestratorVersion; + + /// + /// If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + /// was , this field will contain the full version being used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string CurrentOrchestratorVersion { get => this._currentOrchestratorVersion; } + + /// Backing field for property. + private string _eTag; + + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; } + + /// Backing field for property. + private bool? _enableAutoScaling; + + /// Whether to enable auto-scaler + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableAutoScaling { get => this._enableAutoScaling; set => this._enableAutoScaling = value; } + + /// Backing field for property. + private bool? _enableCustomCaTrust; + + /// + /// When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + /// host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node + /// trust stores. Defaults to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableCustomCaTrust { get => this._enableCustomCaTrust; set => this._enableCustomCaTrust = value; } + + /// Backing field for property. + private bool? _enableEncryptionAtHost; + + /// + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableEncryptionAtHost { get => this._enableEncryptionAtHost; set => this._enableEncryptionAtHost = value; } + + /// Backing field for property. + private bool? _enableFips; + + /// + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableFips { get => this._enableFips; set => this._enableFips = value; } + + /// Backing field for property. + private bool? _enableNodePublicIP; + + /// + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario + /// is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + /// For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + /// The default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableNodePublicIP { get => this._enableNodePublicIP; set => this._enableNodePublicIP = value; } + + /// Backing field for property. + private bool? _enableUltraSsd; + + /// Whether to enable UltraSSD + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableUltraSsd { get => this._enableUltraSsd; set => this._enableUltraSsd = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile _gatewayProfile; + + /// + /// Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile GatewayProfile { get => (this._gatewayProfile = this._gatewayProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfile()); set => this._gatewayProfile = value; } + + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? GatewayProfilePublicIPPrefixSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfileInternal)GatewayProfile).PublicIPPrefixSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfileInternal)GatewayProfile).PublicIPPrefixSize = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile? _gpuInstanceProfile; + + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile? GpuInstanceProfile { get => this._gpuInstanceProfile; set => this._gpuInstanceProfile = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile _gpuProfile; + + /// The GPU settings of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile GpuProfile { get => (this._gpuProfile = this._gpuProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfile()); set => this._gpuProfile = value; } + + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? GpuProfileInstallGpuDriver { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfileInternal)GpuProfile).InstallGpuDriver; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfileInternal)GpuProfile).InstallGpuDriver = value ?? default(bool); } + + /// Backing field for property. + private string _hostGroupId; + + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + /// For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string HostGroupId { get => this._hostGroupId; set => this._hostGroupId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig _kubeletConfig; + + /// The Kubelet configuration on the agent pool nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig KubeletConfig { get => (this._kubeletConfig = this._kubeletConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfig()); set => this._kubeletConfig = value; } + + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] KubeletConfigAllowedUnsafeSysctl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).AllowedUnsafeSysctl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).AllowedUnsafeSysctl = value ?? null /* arrayOf */; } + + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigContainerLogMaxFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).ContainerLogMaxFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).ContainerLogMaxFile = value ?? default(int); } + + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigContainerLogMaxSizeMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).ContainerLogMaxSizeMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).ContainerLogMaxSizeMb = value ?? default(int); } + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? KubeletConfigCpuCfsQuota { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).CpuCfsQuota; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).CpuCfsQuota = value ?? default(bool); } + + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeletConfigCpuCfsQuotaPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).CpuCfsQuotaPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).CpuCfsQuotaPeriod = value ?? null; } + + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeletConfigCpuManagerPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).CpuManagerPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).CpuManagerPolicy = value ?? null; } + + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? KubeletConfigFailSwapOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).FailSwapOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).FailSwapOn = value ?? default(bool); } + + /// To disable image garbage collection, set to 100. The default is 85% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigImageGcHighThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).ImageGcHighThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).ImageGcHighThreshold = value ?? default(int); } + + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigImageGcLowThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).ImageGcLowThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).ImageGcLowThreshold = value ?? default(int); } + + /// The maximum number of processes per pod. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? KubeletConfigPodMaxPid { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).PodMaxPid; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).PodMaxPid = value ?? default(int); } + + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeletConfigTopologyManagerPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).TopologyManagerPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfigInternal)KubeletConfig).TopologyManagerPolicy = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType? _kubeletDiskType; + + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType? KubeletDiskType { get => this._kubeletDiskType; set => this._kubeletDiskType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig _linuxOSConfig; + + /// The OS configuration of Linux agent nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig LinuxOSConfig { get => (this._linuxOSConfig = this._linuxOSConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfig()); set => this._linuxOSConfig = value; } + + /// The size in MB of a swap file that will be created on each node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? LinuxOSConfigSwapFileSizeMb { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)LinuxOSConfig).SwapFileSizeMb; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)LinuxOSConfig).SwapFileSizeMb = value ?? default(int); } + + /// Sysctl settings for Linux agent nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig LinuxOSConfigSysctl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)LinuxOSConfig).Sysctl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)LinuxOSConfig).Sysctl = value ?? null /* model class */; } + + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string LinuxOSConfigTransparentHugePageDefrag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)LinuxOSConfig).TransparentHugePageDefrag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)LinuxOSConfig).TransparentHugePageDefrag = value ?? null; } + + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string LinuxOSConfigTransparentHugePageEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)LinuxOSConfig).TransparentHugePageEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfigInternal)LinuxOSConfig).TransparentHugePageEnabled = value ?? null; } + + /// Backing field for property. + private int? _maxCount; + + /// The maximum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? MaxCount { get => this._maxCount; set => this._maxCount = value; } + + /// Backing field for property. + private int? _maxPod; + + /// The maximum number of pods that can run on a node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? MaxPod { get => this._maxPod; set => this._maxPod = value; } + + /// Backing field for property. + private string _messageOfTheDay; + + /// + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + /// the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed + /// raw and not be executed as a script). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string MessageOfTheDay { get => this._messageOfTheDay; set => this._messageOfTheDay = value; } + + /// Internal Acessors for ArtifactStreamingProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.ArtifactStreamingProfile { get => (this._artifactStreamingProfile = this._artifactStreamingProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfile()); set { {_artifactStreamingProfile = value;} } } + + /// Internal Acessors for CreationData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.CreationData { get => (this._creationData = this._creationData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData()); set { {_creationData = value;} } } + + /// Internal Acessors for CurrentOrchestratorVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.CurrentOrchestratorVersion { get => this._currentOrchestratorVersion; set { {_currentOrchestratorVersion = value;} } } + + /// Internal Acessors for ETag + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.ETag { get => this._eTag; set { {_eTag = value;} } } + + /// Internal Acessors for GatewayProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.GatewayProfile { get => (this._gatewayProfile = this._gatewayProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfile()); set { {_gatewayProfile = value;} } } + + /// Internal Acessors for GpuProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.GpuProfile { get => (this._gpuProfile = this._gpuProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfile()); set { {_gpuProfile = value;} } } + + /// Internal Acessors for KubeletConfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.KubeletConfig { get => (this._kubeletConfig = this._kubeletConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfig()); set { {_kubeletConfig = value;} } } + + /// Internal Acessors for LinuxOSConfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.LinuxOSConfig { get => (this._linuxOSConfig = this._linuxOSConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfig()); set { {_linuxOSConfig = value;} } } + + /// Internal Acessors for NetworkProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfile()); set { {_networkProfile = value;} } } + + /// Internal Acessors for NodeImageVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.NodeImageVersion { get => this._nodeImageVersion; set { {_nodeImageVersion = value;} } } + + /// Internal Acessors for PowerState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.PowerState { get => (this._powerState = this._powerState ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerState()); set { {_powerState = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for SecurityProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.SecurityProfile { get => (this._securityProfile = this._securityProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfile()); set { {_securityProfile = value;} } } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettings()); set { {_upgradeSetting = value;} } } + + /// Internal Acessors for VirtualMachineProfileScale + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.VirtualMachineProfileScale { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)VirtualMachinesProfile).Scale; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)VirtualMachinesProfile).Scale = value; } + + /// Internal Acessors for VirtualMachinesProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.VirtualMachinesProfile { get => (this._virtualMachinesProfile = this._virtualMachinesProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachinesProfile()); set { {_virtualMachinesProfile = value;} } } + + /// Internal Acessors for WindowsProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesInternal.WindowsProfile { get => (this._windowsProfile = this._windowsProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfile()); set { {_windowsProfile = value;} } } + + /// Backing field for property. + private int? _minCount; + + /// The minimum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? MinCount { get => this._minCount; set => this._minCount = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode? _mode; + + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode? Mode { get => this._mode; set => this._mode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile _networkProfile; + + /// Network-related settings of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfile()); set => this._networkProfile = value; } + + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] NetworkProfileAllowedHostPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)NetworkProfile).AllowedHostPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)NetworkProfile).AllowedHostPort = value ?? null /* arrayOf */; } + + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] NetworkProfileApplicationSecurityGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)NetworkProfile).ApplicationSecurityGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)NetworkProfile).ApplicationSecurityGroup = value ?? null /* arrayOf */; } + + /// IPTags of instance-level public IPs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NetworkProfileNodePublicIPTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)NetworkProfile).NodePublicIPTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfileInternal)NetworkProfile).NodePublicIPTag = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _nodeImageVersion; + + /// The version of node image + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NodeImageVersion { get => this._nodeImageVersion; } + + /// Backing field for property. + private string[] _nodeInitializationTaint; + + /// + /// These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + /// pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + /// node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, + /// for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] NodeInitializationTaint { get => this._nodeInitializationTaint; set => this._nodeInitializationTaint = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels _nodeLabel; + + /// The node labels to be persisted across all nodes in agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels NodeLabel { get => (this._nodeLabel = this._nodeLabel ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabels()); set => this._nodeLabel = value; } + + /// Backing field for property. + private string _nodePublicIPPrefixId; + + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NodePublicIPPrefixId { get => this._nodePublicIPPrefixId; set => this._nodePublicIPPrefixId = value; } + + /// Backing field for property. + private string[] _nodeTaint; + + /// + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] NodeTaint { get => this._nodeTaint; set => this._nodeTaint = value; } + + /// Backing field for property. + private int? _oSDiskSizeGb; + + /// + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it + /// will apply the default osDisk size according to the vmSize specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? OSDiskSizeGb { get => this._oSDiskSizeGb; set => this._oSDiskSizeGb = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType? _oSDiskType; + + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType? OSDiskType { get => this._oSDiskType; set => this._oSDiskType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? _oSSku; + + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get => this._oSSku; set => this._oSSku = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? _oSType; + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get => this._oSType; set => this._oSType = value; } + + /// Backing field for property. + private string _orchestratorVersion; + + /// + /// Both patch version and are supported. When is specified, the latest supported + /// patch version is chosen automatically. Updating the agent pool with the same once it has been created will + /// not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools + /// in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control + /// plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version + /// cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string OrchestratorVersion { get => this._orchestratorVersion; set => this._orchestratorVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode? _podIPAllocationMode; + + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode? PodIPAllocationMode { get => this._podIPAllocationMode; set => this._podIPAllocationMode = value; } + + /// Backing field for property. + private string _podSubnetId; + + /// + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string PodSubnetId { get => this._podSubnetId; set => this._podSubnetId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState _powerState; + + /// + /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. + /// A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it + /// is Running and provisioning state is Succeeded + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState PowerState { get => (this._powerState = this._powerState ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerState()); set => this._powerState = value; } + + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerStateInternal)PowerState).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerStateInternal)PowerState).Code = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code)""); } + + /// Backing field for property. + private string _provisioningState; + + /// The current deployment or provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _proximityPlacementGroupId; + + /// The ID for Proximity Placement Group. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ProximityPlacementGroupId { get => this._proximityPlacementGroupId; set => this._proximityPlacementGroupId = value; } + + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)VirtualMachinesProfile).ScaleAutoscale; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)VirtualMachinesProfile).ScaleAutoscale = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode? _scaleDownMode; + + /// + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode? ScaleDownMode { get => this._scaleDownMode; set => this._scaleDownMode = value; } + + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)VirtualMachinesProfile).ScaleManual; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)VirtualMachinesProfile).ScaleManual = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy? _scaleSetEvictionPolicy; + + /// + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get => this._scaleSetEvictionPolicy; set => this._scaleSetEvictionPolicy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority? _scaleSetPriority; + + /// + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority? ScaleSetPriority { get => this._scaleSetPriority; set => this._scaleSetPriority = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile _securityProfile; + + /// The security settings of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile SecurityProfile { get => (this._securityProfile = this._securityProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfile()); set => this._securityProfile = value; } + + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SecurityProfileEnableSecureBoot { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)SecurityProfile).EnableSecureBoot; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)SecurityProfile).EnableSecureBoot = value ?? default(bool); } + + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SecurityProfileEnableVtpm { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)SecurityProfile).EnableVtpm; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)SecurityProfile).EnableVtpm = value ?? default(bool); } + + /// SSH access method of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SecurityProfileSshAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)SecurityProfile).SshAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfileInternal)SecurityProfile).SshAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess)""); } + + /// Backing field for property. + private float? _spotMaxPrice; + + /// + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + /// For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public float? SpotMaxPrice { get => this._spotMaxPrice; set => this._spotMaxPrice = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags _tag; + + /// The tags to be persisted on the agent pool virtual machine scale set. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTags()); set => this._tag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType? _type; + + /// The type of Agent Pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType? Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings _upgradeSetting; + + /// Settings for upgrading the agentpool + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettings()); set => this._upgradeSetting = value; } + + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? UpgradeSettingDrainTimeoutInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeoutInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeoutInMinute = value ?? default(int); } + + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge = value ?? null; } + + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? UpgradeSettingNodeSoakDurationInMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).NodeSoakDurationInMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).NodeSoakDurationInMinute = value ?? default(int); } + + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UpgradeSettingUndrainableNodeBehavior { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).UndrainableNodeBehavior; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).UndrainableNodeBehavior = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior)""); } + + /// Backing field for property. + private string _vMSize; + + /// + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might + /// fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string VMSize { get => this._vMSize; set => this._vMSize = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] _virtualMachineNodesStatus; + + /// The status of nodes in a VirtualMachines agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] VirtualMachineNodesStatus { get => this._virtualMachineNodesStatus; set => this._virtualMachineNodesStatus = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile _virtualMachinesProfile; + + /// Specifications on VirtualMachines agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile VirtualMachinesProfile { get => (this._virtualMachinesProfile = this._virtualMachinesProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachinesProfile()); set => this._virtualMachinesProfile = value; } + + /// Backing field for property. + private string _vnetSubnetId; + + /// + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to + /// nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string VnetSubnetId { get => this._vnetSubnetId; set => this._vnetSubnetId = value; } + + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WindowProfileDisableOutboundNat { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfileInternal)WindowsProfile).DisableOutboundNat; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfileInternal)WindowsProfile).DisableOutboundNat = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile _windowsProfile; + + /// The Windows agent pool's specific profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile WindowsProfile { get => (this._windowsProfile = this._windowsProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfile()); set => this._windowsProfile = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime? _workloadRuntime; + + /// Determines the type of workload a node can run. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime? WorkloadRuntime { get => this._workloadRuntime; set => this._workloadRuntime = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterAgentPoolProfileProperties() + { + + } + } + /// Properties for the container service agent pool profile. + public partial interface IManagedClusterAgentPoolProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, container images must also enable artifact streaming on ACR. If not specified, the default is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ArtifactStreamingProfileEnabled { get; set; } + /// + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + string[] AvailabilityZone { get; set; } + /// + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"AKS will associate the specified agent pool with the Capacity Reservation Group.", + SerializedName = @"capacityReservationGroupID", + PossibleTypes = new [] { typeof(string) })] + string CapacityReservationGroupId { get; set; } + /// + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user + /// pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? Count { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string CreationDataSourceResourceId { get; set; } + /// + /// If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + /// was , this field will contain the full version being used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion was , this field will contain the full version being used.", + SerializedName = @"currentOrchestratorVersion", + PossibleTypes = new [] { typeof(string) })] + string CurrentOrchestratorVersion { get; } + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency per the normal etag convention.", + SerializedName = @"eTag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; } + /// Whether to enable auto-scaler + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable auto-scaler", + SerializedName = @"enableAutoScaling", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableAutoScaling { get; set; } + /// + /// When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + /// host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node + /// trust stores. Defaults to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node trust stores. Defaults to false.", + SerializedName = @"enableCustomCATrust", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableCustomCaTrust { get; set; } + /// + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption", + SerializedName = @"enableEncryptionAtHost", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableEncryptionAtHost { get; set; } + /// + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.", + SerializedName = @"enableFIPS", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableFips { get; set; } + /// + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario + /// is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + /// For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + /// The default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.", + SerializedName = @"enableNodePublicIP", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNodePublicIP { get; set; } + /// Whether to enable UltraSSD + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable UltraSSD", + SerializedName = @"enableUltraSSD", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableUltraSsd { get; set; } + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31.", + SerializedName = @"publicIPPrefixSize", + PossibleTypes = new [] { typeof(int) })] + int? GatewayProfilePublicIPPrefixSize { get; set; } + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.", + SerializedName = @"gpuInstanceProfile", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile? GpuInstanceProfile { get; set; } + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves.", + SerializedName = @"installGPUDriver", + PossibleTypes = new [] { typeof(bool) })] + bool? GpuProfileInstallGpuDriver { get; set; } + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + /// For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).", + SerializedName = @"hostGroupID", + PossibleTypes = new [] { typeof(string) })] + string HostGroupId { get; set; } + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`).", + SerializedName = @"allowedUnsafeSysctls", + PossibleTypes = new [] { typeof(string) })] + string[] KubeletConfigAllowedUnsafeSysctl { get; set; } + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of container log files that can be present for a container. The number must be ≥ 2.", + SerializedName = @"containerLogMaxFiles", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigContainerLogMaxFile { get; set; } + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size (e.g. 10Mi) of container log file before it is rotated.", + SerializedName = @"containerLogMaxSizeMB", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigContainerLogMaxSizeMb { get; set; } + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"cpuCfsQuota", + PossibleTypes = new [] { typeof(bool) })] + bool? KubeletConfigCpuCfsQuota { get; set; } + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'.", + SerializedName = @"cpuCfsQuotaPeriod", + PossibleTypes = new [] { typeof(string) })] + string KubeletConfigCpuCfsQuotaPeriod { get; set; } + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'.", + SerializedName = @"cpuManagerPolicy", + PossibleTypes = new [] { typeof(string) })] + string KubeletConfigCpuManagerPolicy { get; set; } + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true it will make the Kubelet fail to start if swap is enabled on the node.", + SerializedName = @"failSwapOn", + PossibleTypes = new [] { typeof(bool) })] + bool? KubeletConfigFailSwapOn { get; set; } + /// To disable image garbage collection, set to 100. The default is 85% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To disable image garbage collection, set to 100. The default is 85%", + SerializedName = @"imageGcHighThreshold", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigImageGcHighThreshold { get; set; } + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be set higher than imageGcHighThreshold. The default is 80%", + SerializedName = @"imageGcLowThreshold", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigImageGcLowThreshold { get; set; } + /// The maximum number of processes per pod. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of processes per pod.", + SerializedName = @"podMaxPids", + PossibleTypes = new [] { typeof(int) })] + int? KubeletConfigPodMaxPid { get; set; } + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'.", + SerializedName = @"topologyManagerPolicy", + PossibleTypes = new [] { typeof(string) })] + string KubeletConfigTopologyManagerPolicy { get; set; } + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.", + SerializedName = @"kubeletDiskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType? KubeletDiskType { get; set; } + /// The size in MB of a swap file that will be created on each node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size in MB of a swap file that will be created on each node.", + SerializedName = @"swapFileSizeMB", + PossibleTypes = new [] { typeof(int) })] + int? LinuxOSConfigSwapFileSizeMb { get; set; } + /// Sysctl settings for Linux agent nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl settings for Linux agent nodes.", + SerializedName = @"sysctls", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig LinuxOSConfigSysctl { get; set; } + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).", + SerializedName = @"transparentHugePageDefrag", + PossibleTypes = new [] { typeof(string) })] + string LinuxOSConfigTransparentHugePageDefrag { get; set; } + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).", + SerializedName = @"transparentHugePageEnabled", + PossibleTypes = new [] { typeof(string) })] + string LinuxOSConfigTransparentHugePageEnabled { get; set; } + /// The maximum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of nodes for auto-scaling", + SerializedName = @"maxCount", + PossibleTypes = new [] { typeof(int) })] + int? MaxCount { get; set; } + /// The maximum number of pods that can run on a node. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of pods that can run on a node.", + SerializedName = @"maxPods", + PossibleTypes = new [] { typeof(int) })] + int? MaxPod { get; set; } + /// + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + /// the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed + /// raw and not be executed as a script). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script).", + SerializedName = @"messageOfTheDay", + PossibleTypes = new [] { typeof(string) })] + string MessageOfTheDay { get; set; } + /// The minimum number of nodes for auto-scaling + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The minimum number of nodes for auto-scaling", + SerializedName = @"minCount", + PossibleTypes = new [] { typeof(int) })] + int? MinCount { get; set; } + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode? Mode { get; set; } + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The port ranges that are allowed to access. The specified ranges are allowed to overlap.", + SerializedName = @"allowedHostPorts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] NetworkProfileAllowedHostPort { get; set; } + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IDs of the application security groups which agent pool will associate when created.", + SerializedName = @"applicationSecurityGroups", + PossibleTypes = new [] { typeof(string) })] + string[] NetworkProfileApplicationSecurityGroup { get; set; } + /// IPTags of instance-level public IPs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IPTags of instance-level public IPs.", + SerializedName = @"nodePublicIPTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NetworkProfileNodePublicIPTag { get; set; } + /// The version of node image + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of node image", + SerializedName = @"nodeImageVersion", + PossibleTypes = new [] { typeof(string) })] + string NodeImageVersion { get; } + /// + /// These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + /// pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + /// node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, + /// for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-`", + SerializedName = @"nodeInitializationTaints", + PossibleTypes = new [] { typeof(string) })] + string[] NodeInitializationTaint { get; set; } + /// The node labels to be persisted across all nodes in agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The node labels to be persisted across all nodes in agent pool.", + SerializedName = @"nodeLabels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels NodeLabel { get; set; } + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}", + SerializedName = @"nodePublicIPPrefixID", + PossibleTypes = new [] { typeof(string) })] + string NodePublicIPPrefixId { get; set; } + /// + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.", + SerializedName = @"nodeTaints", + PossibleTypes = new [] { typeof(string) })] + string[] NodeTaint { get; set; } + /// + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it + /// will apply the default osDisk size according to the vmSize specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.", + SerializedName = @"osDiskSizeGB", + PossibleTypes = new [] { typeof(int) })] + int? OSDiskSizeGb { get; set; } + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).", + SerializedName = @"osDiskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType? OSDiskType { get; set; } + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated.", + SerializedName = @"osSKU", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get; set; } + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get; set; } + /// + /// Both patch version and are supported. When is specified, the latest supported + /// patch version is chosen automatically. Updating the agent pool with the same once it has been created will + /// not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools + /// in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control + /// plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version + /// cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).", + SerializedName = @"orchestratorVersion", + PossibleTypes = new [] { typeof(string) })] + string OrchestratorVersion { get; set; } + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'.", + SerializedName = @"podIPAllocationMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode? PodIPAllocationMode { get; set; } + /// + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", + SerializedName = @"podSubnetID", + PossibleTypes = new [] { typeof(string) })] + string PodSubnetId { get; set; } + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tells whether the cluster is Running or Stopped", + SerializedName = @"code", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get; set; } + /// The current deployment or provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current deployment or provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// The ID for Proximity Placement Group. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID for Proximity Placement Group.", + SerializedName = @"proximityPlacementGroupID", + PossibleTypes = new [] { typeof(string) })] + string ProximityPlacementGroupId { get; set; } + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed.", + SerializedName = @"autoscale", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get; set; } + /// + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.", + SerializedName = @"scaleDownMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode? ScaleDownMode { get; set; } + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed.", + SerializedName = @"manual", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get; set; } + /// + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.", + SerializedName = @"scaleSetEvictionPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get; set; } + /// + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.", + SerializedName = @"scaleSetPriority", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority? ScaleSetPriority { get; set; } + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.", + SerializedName = @"enableSecureBoot", + PossibleTypes = new [] { typeof(bool) })] + bool? SecurityProfileEnableSecureBoot { get; set; } + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.", + SerializedName = @"enableVTPM", + PossibleTypes = new [] { typeof(bool) })] + bool? SecurityProfileEnableVtpm { get; set; } + /// SSH access method of an agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SSH access method of an agent pool.", + SerializedName = @"sshAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SecurityProfileSshAccess { get; set; } + /// + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + /// For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing)", + SerializedName = @"spotMaxPrice", + PossibleTypes = new [] { typeof(float) })] + float? SpotMaxPrice { get; set; } + /// The tags to be persisted on the agent pool virtual machine scale set. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags to be persisted on the agent pool virtual machine scale set.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags Tag { get; set; } + /// The type of Agent Pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of Agent Pool.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType? Type { get; set; } + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes.", + SerializedName = @"drainTimeoutInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? UpgradeSettingDrainTimeoutInMinute { get; set; } + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxSurge { get; set; } + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes.", + SerializedName = @"nodeSoakDurationInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? UpgradeSettingNodeSoakDurationInMinute { get; set; } + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes.", + SerializedName = @"undrainableNodeBehavior", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UpgradeSettingUndrainableNodeBehavior { get; set; } + /// + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might + /// fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + string VMSize { get; set; } + /// The status of nodes in a VirtualMachines agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status of nodes in a VirtualMachines agent pool.", + SerializedName = @"virtualMachineNodesStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] VirtualMachineNodesStatus { get; set; } + /// + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to + /// nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", + SerializedName = @"vnetSubnetID", + PossibleTypes = new [] { typeof(string) })] + string VnetSubnetId { get; set; } + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled.", + SerializedName = @"disableOutboundNat", + PossibleTypes = new [] { typeof(bool) })] + bool? WindowProfileDisableOutboundNat { get; set; } + /// Determines the type of workload a node can run. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the type of workload a node can run.", + SerializedName = @"workloadRuntime", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime? WorkloadRuntime { get; set; } + + } + /// Properties for the container service agent pool profile. + internal partial interface IManagedClusterAgentPoolProfilePropertiesInternal + + { + /// Configuration for using artifact streaming on AKS. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolArtifactStreamingProfile ArtifactStreamingProfile { get; set; } + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + bool? ArtifactStreamingProfileEnabled { get; set; } + /// + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// + string[] AvailabilityZone { get; set; } + /// + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// + string CapacityReservationGroupId { get; set; } + /// + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user + /// pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// + int? Count { get; set; } + /// + /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + string CreationDataSourceResourceId { get; set; } + /// + /// If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + /// was , this field will contain the full version being used. + /// + string CurrentOrchestratorVersion { get; set; } + /// + /// Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource is updated. + /// Specify an if-match or if-none-match header with the eTag value for a subsequent request to enable optimistic concurrency + /// per the normal etag convention. + /// + string ETag { get; set; } + /// Whether to enable auto-scaler + bool? EnableAutoScaling { get; set; } + /// + /// When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + /// host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node + /// trust stores. Defaults to false. + /// + bool? EnableCustomCaTrust { get; set; } + /// + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + /// + bool? EnableEncryptionAtHost { get; set; } + /// + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + /// for more details. + /// + bool? EnableFips { get; set; } + /// + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario + /// is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + /// For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + /// The default is false. + /// + bool? EnableNodePublicIP { get; set; } + /// Whether to enable UltraSSD + bool? EnableUltraSsd { get; set; } + /// + /// Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGatewayProfile GatewayProfile { get; set; } + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + int? GatewayProfilePublicIPPrefixSize { get; set; } + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile? GpuInstanceProfile { get; set; } + /// The GPU settings of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolGpuProfile GpuProfile { get; set; } + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + bool? GpuProfileInstallGpuDriver { get; set; } + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + /// For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// + string HostGroupId { get; set; } + /// The Kubelet configuration on the agent pool nodes. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubeletConfig KubeletConfig { get; set; } + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + string[] KubeletConfigAllowedUnsafeSysctl { get; set; } + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + int? KubeletConfigContainerLogMaxFile { get; set; } + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + int? KubeletConfigContainerLogMaxSizeMb { get; set; } + /// The default is true. + bool? KubeletConfigCpuCfsQuota { get; set; } + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + string KubeletConfigCpuCfsQuotaPeriod { get; set; } + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + string KubeletConfigCpuManagerPolicy { get; set; } + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + bool? KubeletConfigFailSwapOn { get; set; } + /// To disable image garbage collection, set to 100. The default is 85% + int? KubeletConfigImageGcHighThreshold { get; set; } + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + int? KubeletConfigImageGcLowThreshold { get; set; } + /// The maximum number of processes per pod. + int? KubeletConfigPodMaxPid { get; set; } + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + string KubeletConfigTopologyManagerPolicy { get; set; } + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType? KubeletDiskType { get; set; } + /// The OS configuration of Linux agent nodes. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILinuxOSConfig LinuxOSConfig { get; set; } + /// The size in MB of a swap file that will be created on each node. + int? LinuxOSConfigSwapFileSizeMb { get; set; } + /// Sysctl settings for Linux agent nodes. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig LinuxOSConfigSysctl { get; set; } + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + string LinuxOSConfigTransparentHugePageDefrag { get; set; } + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + string LinuxOSConfigTransparentHugePageEnabled { get; set; } + /// The maximum number of nodes for auto-scaling + int? MaxCount { get; set; } + /// The maximum number of pods that can run on a node. + int? MaxPod { get; set; } + /// + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + /// the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed + /// raw and not be executed as a script). + /// + string MessageOfTheDay { get; set; } + /// The minimum number of nodes for auto-scaling + int? MinCount { get; set; } + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode? Mode { get; set; } + /// Network-related settings of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolNetworkProfile NetworkProfile { get; set; } + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] NetworkProfileAllowedHostPort { get; set; } + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + string[] NetworkProfileApplicationSecurityGroup { get; set; } + /// IPTags of instance-level public IPs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NetworkProfileNodePublicIPTag { get; set; } + /// The version of node image + string NodeImageVersion { get; set; } + /// + /// These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + /// pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + /// node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, + /// for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + /// + string[] NodeInitializationTaint { get; set; } + /// The node labels to be persisted across all nodes in agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels NodeLabel { get; set; } + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + /// + string NodePublicIPPrefixId { get; set; } + /// + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// + string[] NodeTaint { get; set; } + /// + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it + /// will apply the default osDisk size according to the vmSize specified. + /// + int? OSDiskSizeGb { get; set; } + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType? OSDiskType { get; set; } + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get; set; } + /// The operating system type. The default is Linux. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get; set; } + /// + /// Both patch version and are supported. When is specified, the latest supported + /// patch version is chosen automatically. Updating the agent pool with the same once it has been created will + /// not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools + /// in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control + /// plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version + /// cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// + string OrchestratorVersion { get; set; } + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode? PodIPAllocationMode { get; set; } + /// + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + string PodSubnetId { get; set; } + /// + /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. + /// A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it + /// is Running and provisioning state is Succeeded + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState PowerState { get; set; } + /// Tells whether the cluster is Running or Stopped + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get; set; } + /// The current deployment or provisioning state. + string ProvisioningState { get; set; } + /// The ID for Proximity Placement Group. + string ProximityPlacementGroupId { get; set; } + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get; set; } + /// + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode? ScaleDownMode { get; set; } + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get; set; } + /// + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get; set; } + /// + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority? ScaleSetPriority { get; set; } + /// The security settings of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolSecurityProfile SecurityProfile { get; set; } + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + bool? SecurityProfileEnableSecureBoot { get; set; } + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + bool? SecurityProfileEnableVtpm { get; set; } + /// SSH access method of an agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess? SecurityProfileSshAccess { get; set; } + /// + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + /// For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + /// + float? SpotMaxPrice { get; set; } + /// The tags to be persisted on the agent pool virtual machine scale set. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags Tag { get; set; } + /// The type of Agent Pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType? Type { get; set; } + /// Settings for upgrading the agentpool + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + int? UpgradeSettingDrainTimeoutInMinute { get; set; } + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + string UpgradeSettingMaxSurge { get; set; } + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + int? UpgradeSettingNodeSoakDurationInMinute { get; set; } + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior? UpgradeSettingUndrainableNodeBehavior { get; set; } + /// + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might + /// fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + /// + string VMSize { get; set; } + /// The status of nodes in a VirtualMachines agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] VirtualMachineNodesStatus { get; set; } + /// Specifications on how to scale a VirtualMachines agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile VirtualMachineProfileScale { get; set; } + /// Specifications on VirtualMachines agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile VirtualMachinesProfile { get; set; } + /// + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to + /// nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + string VnetSubnetId { get; set; } + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + bool? WindowProfileDisableOutboundNat { get; set; } + /// The Windows agent pool's specific profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolWindowsProfile WindowsProfile { get; set; } + /// Determines the type of workload a node can run. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime? WorkloadRuntime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.json.cs new file mode 100644 index 000000000000..b3d5c1899e68 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfileProperties.json.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties for the container service agent pool profile. + public partial class ManagedClusterAgentPoolProfileProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfileProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAgentPoolProfileProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAgentPoolProfileProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolUpgradeSettings.FromJson(__jsonUpgradeSettings) : UpgradeSetting;} + {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerState.FromJson(__jsonPowerState) : PowerState;} + {_kubeletConfig = If( json?.PropertyT("kubeletConfig"), out var __jsonKubeletConfig) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.KubeletConfig.FromJson(__jsonKubeletConfig) : KubeletConfig;} + {_linuxOSConfig = If( json?.PropertyT("linuxOSConfig"), out var __jsonLinuxOSConfig) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LinuxOSConfig.FromJson(__jsonLinuxOSConfig) : LinuxOSConfig;} + {_creationData = If( json?.PropertyT("creationData"), out var __jsonCreationData) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData.FromJson(__jsonCreationData) : CreationData;} + {_windowsProfile = If( json?.PropertyT("windowsProfile"), out var __jsonWindowsProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolWindowsProfile.FromJson(__jsonWindowsProfile) : WindowsProfile;} + {_networkProfile = If( json?.PropertyT("networkProfile"), out var __jsonNetworkProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolNetworkProfile.FromJson(__jsonNetworkProfile) : NetworkProfile;} + {_securityProfile = If( json?.PropertyT("securityProfile"), out var __jsonSecurityProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolSecurityProfile.FromJson(__jsonSecurityProfile) : SecurityProfile;} + {_gpuProfile = If( json?.PropertyT("gpuProfile"), out var __jsonGpuProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGpuProfile.FromJson(__jsonGpuProfile) : GpuProfile;} + {_artifactStreamingProfile = If( json?.PropertyT("artifactStreamingProfile"), out var __jsonArtifactStreamingProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolArtifactStreamingProfile.FromJson(__jsonArtifactStreamingProfile) : ArtifactStreamingProfile;} + {_virtualMachinesProfile = If( json?.PropertyT("virtualMachinesProfile"), out var __jsonVirtualMachinesProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachinesProfile.FromJson(__jsonVirtualMachinesProfile) : VirtualMachinesProfile;} + {_gatewayProfile = If( json?.PropertyT("gatewayProfile"), out var __jsonGatewayProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolGatewayProfile.FromJson(__jsonGatewayProfile) : GatewayProfile;} + {_eTag = If( json?.PropertyT("eTag"), out var __jsonETag) ? (string)__jsonETag : (string)ETag;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (int?)__jsonCount : Count;} + {_vMSize = If( json?.PropertyT("vmSize"), out var __jsonVMSize) ? (string)__jsonVMSize : (string)VMSize;} + {_oSDiskSizeGb = If( json?.PropertyT("osDiskSizeGB"), out var __jsonOSDiskSizeGb) ? (int?)__jsonOSDiskSizeGb : OSDiskSizeGb;} + {_oSDiskType = If( json?.PropertyT("osDiskType"), out var __jsonOSDiskType) ? (string)__jsonOSDiskType : (string)OSDiskType;} + {_kubeletDiskType = If( json?.PropertyT("kubeletDiskType"), out var __jsonKubeletDiskType) ? (string)__jsonKubeletDiskType : (string)KubeletDiskType;} + {_workloadRuntime = If( json?.PropertyT("workloadRuntime"), out var __jsonWorkloadRuntime) ? (string)__jsonWorkloadRuntime : (string)WorkloadRuntime;} + {_messageOfTheDay = If( json?.PropertyT("messageOfTheDay"), out var __jsonMessageOfTheDay) ? (string)__jsonMessageOfTheDay : (string)MessageOfTheDay;} + {_vnetSubnetId = If( json?.PropertyT("vnetSubnetID"), out var __jsonVnetSubnetId) ? (string)__jsonVnetSubnetId : (string)VnetSubnetId;} + {_podSubnetId = If( json?.PropertyT("podSubnetID"), out var __jsonPodSubnetId) ? (string)__jsonPodSubnetId : (string)PodSubnetId;} + {_podIPAllocationMode = If( json?.PropertyT("podIPAllocationMode"), out var __jsonPodIPAllocationMode) ? (string)__jsonPodIPAllocationMode : (string)PodIPAllocationMode;} + {_maxPod = If( json?.PropertyT("maxPods"), out var __jsonMaxPods) ? (int?)__jsonMaxPods : MaxPod;} + {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)OSType;} + {_oSSku = If( json?.PropertyT("osSKU"), out var __jsonOSSku) ? (string)__jsonOSSku : (string)OSSku;} + {_maxCount = If( json?.PropertyT("maxCount"), out var __jsonMaxCount) ? (int?)__jsonMaxCount : MaxCount;} + {_minCount = If( json?.PropertyT("minCount"), out var __jsonMinCount) ? (int?)__jsonMinCount : MinCount;} + {_enableAutoScaling = If( json?.PropertyT("enableAutoScaling"), out var __jsonEnableAutoScaling) ? (bool?)__jsonEnableAutoScaling : EnableAutoScaling;} + {_scaleDownMode = If( json?.PropertyT("scaleDownMode"), out var __jsonScaleDownMode) ? (string)__jsonScaleDownMode : (string)ScaleDownMode;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} + {_orchestratorVersion = If( json?.PropertyT("orchestratorVersion"), out var __jsonOrchestratorVersion) ? (string)__jsonOrchestratorVersion : (string)OrchestratorVersion;} + {_currentOrchestratorVersion = If( json?.PropertyT("currentOrchestratorVersion"), out var __jsonCurrentOrchestratorVersion) ? (string)__jsonCurrentOrchestratorVersion : (string)CurrentOrchestratorVersion;} + {_nodeImageVersion = If( json?.PropertyT("nodeImageVersion"), out var __jsonNodeImageVersion) ? (string)__jsonNodeImageVersion : (string)NodeImageVersion;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AvailabilityZone;} + {_enableNodePublicIP = If( json?.PropertyT("enableNodePublicIP"), out var __jsonEnableNodePublicIP) ? (bool?)__jsonEnableNodePublicIP : EnableNodePublicIP;} + {_enableCustomCaTrust = If( json?.PropertyT("enableCustomCATrust"), out var __jsonEnableCustomCaTrust) ? (bool?)__jsonEnableCustomCaTrust : EnableCustomCaTrust;} + {_nodePublicIPPrefixId = If( json?.PropertyT("nodePublicIPPrefixID"), out var __jsonNodePublicIPPrefixId) ? (string)__jsonNodePublicIPPrefixId : (string)NodePublicIPPrefixId;} + {_scaleSetPriority = If( json?.PropertyT("scaleSetPriority"), out var __jsonScaleSetPriority) ? (string)__jsonScaleSetPriority : (string)ScaleSetPriority;} + {_scaleSetEvictionPolicy = If( json?.PropertyT("scaleSetEvictionPolicy"), out var __jsonScaleSetEvictionPolicy) ? (string)__jsonScaleSetEvictionPolicy : (string)ScaleSetEvictionPolicy;} + {_spotMaxPrice = If( json?.PropertyT("spotMaxPrice"), out var __jsonSpotMaxPrice) ? (float?)__jsonSpotMaxPrice : SpotMaxPrice;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTags.FromJson(__jsonTags) : Tag;} + {_nodeLabel = If( json?.PropertyT("nodeLabels"), out var __jsonNodeLabels) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabels.FromJson(__jsonNodeLabels) : NodeLabel;} + {_nodeTaint = If( json?.PropertyT("nodeTaints"), out var __jsonNodeTaints) ? If( __jsonNodeTaints as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : NodeTaint;} + {_nodeInitializationTaint = If( json?.PropertyT("nodeInitializationTaints"), out var __jsonNodeInitializationTaints) ? If( __jsonNodeInitializationTaints as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : NodeInitializationTaint;} + {_proximityPlacementGroupId = If( json?.PropertyT("proximityPlacementGroupID"), out var __jsonProximityPlacementGroupId) ? (string)__jsonProximityPlacementGroupId : (string)ProximityPlacementGroupId;} + {_enableEncryptionAtHost = If( json?.PropertyT("enableEncryptionAtHost"), out var __jsonEnableEncryptionAtHost) ? (bool?)__jsonEnableEncryptionAtHost : EnableEncryptionAtHost;} + {_enableUltraSsd = If( json?.PropertyT("enableUltraSSD"), out var __jsonEnableUltraSsd) ? (bool?)__jsonEnableUltraSsd : EnableUltraSsd;} + {_enableFips = If( json?.PropertyT("enableFIPS"), out var __jsonEnableFips) ? (bool?)__jsonEnableFips : EnableFips;} + {_gpuInstanceProfile = If( json?.PropertyT("gpuInstanceProfile"), out var __jsonGpuInstanceProfile) ? (string)__jsonGpuInstanceProfile : (string)GpuInstanceProfile;} + {_capacityReservationGroupId = If( json?.PropertyT("capacityReservationGroupID"), out var __jsonCapacityReservationGroupId) ? (string)__jsonCapacityReservationGroupId : (string)CapacityReservationGroupId;} + {_hostGroupId = If( json?.PropertyT("hostGroupID"), out var __jsonHostGroupId) ? (string)__jsonHostGroupId : (string)HostGroupId;} + {_virtualMachineNodesStatus = If( json?.PropertyT("virtualMachineNodesStatus"), out var __jsonVirtualMachineNodesStatus) ? If( __jsonVirtualMachineNodesStatus as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.VirtualMachineNodes.FromJson(__f) )) ))() : null : VirtualMachineNodesStatus;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._upgradeSetting ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._upgradeSetting.ToJson(null,serializationMode) : null, "upgradeSettings" ,container.Add ); + AddIf( null != this._powerState ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._powerState.ToJson(null,serializationMode) : null, "powerState" ,container.Add ); + AddIf( null != this._kubeletConfig ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._kubeletConfig.ToJson(null,serializationMode) : null, "kubeletConfig" ,container.Add ); + AddIf( null != this._linuxOSConfig ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._linuxOSConfig.ToJson(null,serializationMode) : null, "linuxOSConfig" ,container.Add ); + AddIf( null != this._creationData ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._creationData.ToJson(null,serializationMode) : null, "creationData" ,container.Add ); + AddIf( null != this._windowsProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._windowsProfile.ToJson(null,serializationMode) : null, "windowsProfile" ,container.Add ); + AddIf( null != this._networkProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._networkProfile.ToJson(null,serializationMode) : null, "networkProfile" ,container.Add ); + AddIf( null != this._securityProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._securityProfile.ToJson(null,serializationMode) : null, "securityProfile" ,container.Add ); + AddIf( null != this._gpuProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._gpuProfile.ToJson(null,serializationMode) : null, "gpuProfile" ,container.Add ); + AddIf( null != this._artifactStreamingProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._artifactStreamingProfile.ToJson(null,serializationMode) : null, "artifactStreamingProfile" ,container.Add ); + AddIf( null != this._virtualMachinesProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._virtualMachinesProfile.ToJson(null,serializationMode) : null, "virtualMachinesProfile" ,container.Add ); + AddIf( null != this._gatewayProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._gatewayProfile.ToJson(null,serializationMode) : null, "gatewayProfile" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._eTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._eTag.ToString()) : null, "eTag" ,container.Add ); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._count) : null, "count" ,container.Add ); + AddIf( null != (((object)this._vMSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._vMSize.ToString()) : null, "vmSize" ,container.Add ); + AddIf( null != this._oSDiskSizeGb ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._oSDiskSizeGb) : null, "osDiskSizeGB" ,container.Add ); + AddIf( null != (((object)this._oSDiskType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._oSDiskType.ToString()) : null, "osDiskType" ,container.Add ); + AddIf( null != (((object)this._kubeletDiskType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kubeletDiskType.ToString()) : null, "kubeletDiskType" ,container.Add ); + AddIf( null != (((object)this._workloadRuntime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._workloadRuntime.ToString()) : null, "workloadRuntime" ,container.Add ); + AddIf( null != (((object)this._messageOfTheDay)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._messageOfTheDay.ToString()) : null, "messageOfTheDay" ,container.Add ); + AddIf( null != (((object)this._vnetSubnetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._vnetSubnetId.ToString()) : null, "vnetSubnetID" ,container.Add ); + AddIf( null != (((object)this._podSubnetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._podSubnetId.ToString()) : null, "podSubnetID" ,container.Add ); + AddIf( null != (((object)this._podIPAllocationMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._podIPAllocationMode.ToString()) : null, "podIPAllocationMode" ,container.Add ); + AddIf( null != this._maxPod ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._maxPod) : null, "maxPods" ,container.Add ); + AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add ); + AddIf( null != (((object)this._oSSku)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._oSSku.ToString()) : null, "osSKU" ,container.Add ); + AddIf( null != this._maxCount ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._maxCount) : null, "maxCount" ,container.Add ); + AddIf( null != this._minCount ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._minCount) : null, "minCount" ,container.Add ); + AddIf( null != this._enableAutoScaling ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableAutoScaling) : null, "enableAutoScaling" ,container.Add ); + AddIf( null != (((object)this._scaleDownMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scaleDownMode.ToString()) : null, "scaleDownMode" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + AddIf( null != (((object)this._orchestratorVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._orchestratorVersion.ToString()) : null, "orchestratorVersion" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currentOrchestratorVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._currentOrchestratorVersion.ToString()) : null, "currentOrchestratorVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeImageVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nodeImageVersion.ToString()) : null, "nodeImageVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (null != this._availabilityZone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._availabilityZone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("availabilityZones",__w); + } + AddIf( null != this._enableNodePublicIP ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableNodePublicIP) : null, "enableNodePublicIP" ,container.Add ); + AddIf( null != this._enableCustomCaTrust ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableCustomCaTrust) : null, "enableCustomCATrust" ,container.Add ); + AddIf( null != (((object)this._nodePublicIPPrefixId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nodePublicIPPrefixId.ToString()) : null, "nodePublicIPPrefixID" ,container.Add ); + AddIf( null != (((object)this._scaleSetPriority)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scaleSetPriority.ToString()) : null, "scaleSetPriority" ,container.Add ); + AddIf( null != (((object)this._scaleSetEvictionPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scaleSetEvictionPolicy.ToString()) : null, "scaleSetEvictionPolicy" ,container.Add ); + AddIf( null != this._spotMaxPrice ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((float)this._spotMaxPrice) : null, "spotMaxPrice" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AddIf( null != this._nodeLabel ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._nodeLabel.ToJson(null,serializationMode) : null, "nodeLabels" ,container.Add ); + if (null != this._nodeTaint) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._nodeTaint ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("nodeTaints",__r); + } + if (null != this._nodeInitializationTaint) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __n in this._nodeInitializationTaint ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("nodeInitializationTaints",__m); + } + AddIf( null != (((object)this._proximityPlacementGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._proximityPlacementGroupId.ToString()) : null, "proximityPlacementGroupID" ,container.Add ); + AddIf( null != this._enableEncryptionAtHost ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableEncryptionAtHost) : null, "enableEncryptionAtHost" ,container.Add ); + AddIf( null != this._enableUltraSsd ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableUltraSsd) : null, "enableUltraSSD" ,container.Add ); + AddIf( null != this._enableFips ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableFips) : null, "enableFIPS" ,container.Add ); + AddIf( null != (((object)this._gpuInstanceProfile)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._gpuInstanceProfile.ToString()) : null, "gpuInstanceProfile" ,container.Add ); + AddIf( null != (((object)this._capacityReservationGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._capacityReservationGroupId.ToString()) : null, "capacityReservationGroupID" ,container.Add ); + AddIf( null != (((object)this._hostGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._hostGroupId.ToString()) : null, "hostGroupID" ,container.Add ); + if (null != this._virtualMachineNodesStatus) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __i in this._virtualMachineNodesStatus ) + { + AddIf(__i?.ToJson(null, serializationMode) ,__h.Add); + } + container.Add("virtualMachineNodesStatus",__h); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.PowerShell.cs new file mode 100644 index 000000000000..a2a5b236e7f9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The node labels to be persisted across all nodes in agent pool. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAgentPoolProfilePropertiesNodeLabelsTypeConverter))] + public partial class ManagedClusterAgentPoolProfilePropertiesNodeLabels + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAgentPoolProfilePropertiesNodeLabels(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAgentPoolProfilePropertiesNodeLabels(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAgentPoolProfilePropertiesNodeLabels(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 ManagedClusterAgentPoolProfilePropertiesNodeLabels(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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The node labels to be persisted across all nodes in agent pool. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAgentPoolProfilePropertiesNodeLabelsTypeConverter))] + public partial interface IManagedClusterAgentPoolProfilePropertiesNodeLabels + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.TypeConverter.cs new file mode 100644 index 000000000000..f349e172cf76 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAgentPoolProfilePropertiesNodeLabelsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAgentPoolProfilePropertiesNodeLabels.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAgentPoolProfilePropertiesNodeLabels.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAgentPoolProfilePropertiesNodeLabels.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.cs new file mode 100644 index 000000000000..7bd0eb95ee98 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The node labels to be persisted across all nodes in agent pool. + public partial class ManagedClusterAgentPoolProfilePropertiesNodeLabels : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabelsInternal + { + + /// + /// Creates an new instance. + /// + public ManagedClusterAgentPoolProfilePropertiesNodeLabels() + { + + } + } + /// The node labels to be persisted across all nodes in agent pool. + public partial interface IManagedClusterAgentPoolProfilePropertiesNodeLabels : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// The node labels to be persisted across all nodes in agent pool. + internal partial interface IManagedClusterAgentPoolProfilePropertiesNodeLabelsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.dictionary.cs new file mode 100644 index 000000000000..4dd02b77e3d6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterAgentPoolProfilePropertiesNodeLabels : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesNodeLabels source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.json.cs new file mode 100644 index 000000000000..6b172815fccf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesNodeLabels.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The node labels to be persisted across all nodes in agent pool. + public partial class ManagedClusterAgentPoolProfilePropertiesNodeLabels + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAgentPoolProfilePropertiesNodeLabels(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedClusterAgentPoolProfilePropertiesNodeLabels(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.PowerShell.cs new file mode 100644 index 000000000000..b11d5d1f0e17 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The tags to be persisted on the agent pool virtual machine scale set. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAgentPoolProfilePropertiesTagsTypeConverter))] + public partial class ManagedClusterAgentPoolProfilePropertiesTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAgentPoolProfilePropertiesTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAgentPoolProfilePropertiesTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAgentPoolProfilePropertiesTags(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 ManagedClusterAgentPoolProfilePropertiesTags(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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The tags to be persisted on the agent pool virtual machine scale set. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAgentPoolProfilePropertiesTagsTypeConverter))] + public partial interface IManagedClusterAgentPoolProfilePropertiesTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.TypeConverter.cs new file mode 100644 index 000000000000..c96d4cb9b083 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAgentPoolProfilePropertiesTagsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAgentPoolProfilePropertiesTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAgentPoolProfilePropertiesTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAgentPoolProfilePropertiesTags.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.cs new file mode 100644 index 000000000000..c0dc8c57507f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The tags to be persisted on the agent pool virtual machine scale set. + public partial class ManagedClusterAgentPoolProfilePropertiesTags : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTagsInternal + { + + /// + /// Creates an new instance. + /// + public ManagedClusterAgentPoolProfilePropertiesTags() + { + + } + } + /// The tags to be persisted on the agent pool virtual machine scale set. + public partial interface IManagedClusterAgentPoolProfilePropertiesTags : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// The tags to be persisted on the agent pool virtual machine scale set. + internal partial interface IManagedClusterAgentPoolProfilePropertiesTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.dictionary.cs new file mode 100644 index 000000000000..07c289d2df8e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterAgentPoolProfilePropertiesTags : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfilePropertiesTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.json.cs new file mode 100644 index 000000000000..85163e58c623 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAgentPoolProfilePropertiesTags.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The tags to be persisted on the agent pool virtual machine scale set. + public partial class ManagedClusterAgentPoolProfilePropertiesTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAgentPoolProfilePropertiesTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedClusterAgentPoolProfilePropertiesTags(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.PowerShell.cs new file mode 100644 index 000000000000..fd18001fe2bf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the cluster. The operator automates + /// the deployment of OSS models for inference and/or training purposes. It provides a set of preset models and enables distributed + /// inference against them. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAiToolchainOperatorProfileTypeConverter))] + public partial class ManagedClusterAiToolchainOperatorProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAiToolchainOperatorProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAiToolchainOperatorProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAiToolchainOperatorProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfileInternal)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 ManagedClusterAiToolchainOperatorProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfileInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the cluster. The operator automates + /// the deployment of OSS models for inference and/or training purposes. It provides a set of preset models and enables distributed + /// inference against them. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAiToolchainOperatorProfileTypeConverter))] + public partial interface IManagedClusterAiToolchainOperatorProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.TypeConverter.cs new file mode 100644 index 000000000000..14c2574eb97a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAiToolchainOperatorProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAiToolchainOperatorProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAiToolchainOperatorProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAiToolchainOperatorProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.cs new file mode 100644 index 000000000000..0938bb470d26 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the cluster. The operator automates + /// the deployment of OSS models for inference and/or training purposes. It provides a set of preset models and enables distributed + /// inference against them. + /// + public partial class ManagedClusterAiToolchainOperatorProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfileInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Indicates if AI toolchain operator enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterAiToolchainOperatorProfile() + { + + } + } + /// When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the cluster. The operator automates + /// the deployment of OSS models for inference and/or training purposes. It provides a set of preset models and enables distributed + /// inference against them. + public partial interface IManagedClusterAiToolchainOperatorProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Indicates if AI toolchain operator enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if AI toolchain operator enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the cluster. The operator automates + /// the deployment of OSS models for inference and/or training purposes. It provides a set of preset models and enables distributed + /// inference against them. + internal partial interface IManagedClusterAiToolchainOperatorProfileInternal + + { + /// Indicates if AI toolchain operator enabled or not. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.json.cs new file mode 100644 index 000000000000..58fc10f2dcc0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAiToolchainOperatorProfile.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the cluster. The operator automates + /// the deployment of OSS models for inference and/or training purposes. It provides a set of preset models and enables distributed + /// inference against them. + /// + public partial class ManagedClusterAiToolchainOperatorProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAiToolchainOperatorProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAiToolchainOperatorProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.PowerShell.cs new file mode 100644 index 000000000000..a2f5e5ac2315 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Access profile for managed cluster API server. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterApiServerAccessProfileTypeConverter))] + public partial class ManagedClusterApiServerAccessProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterApiServerAccessProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterApiServerAccessProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterApiServerAccessProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthorizedIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).AuthorizedIPRange = (string[]) content.GetValueForProperty("AuthorizedIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).AuthorizedIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnablePrivateCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnablePrivateCluster = (bool?) content.GetValueForProperty("EnablePrivateCluster",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnablePrivateCluster, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PrivateDnsZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).PrivateDnsZone = (string) content.GetValueForProperty("PrivateDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).PrivateDnsZone, global::System.Convert.ToString); + } + if (content.Contains("EnablePrivateClusterPublicFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnablePrivateClusterPublicFqdn = (bool?) content.GetValueForProperty("EnablePrivateClusterPublicFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnablePrivateClusterPublicFqdn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DisableRunCommand")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).DisableRunCommand = (bool?) content.GetValueForProperty("DisableRunCommand",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).DisableRunCommand, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableVnetIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnableVnetIntegration = (bool?) content.GetValueForProperty("EnableVnetIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnableVnetIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).SubnetId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterApiServerAccessProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AuthorizedIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).AuthorizedIPRange = (string[]) content.GetValueForProperty("AuthorizedIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).AuthorizedIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnablePrivateCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnablePrivateCluster = (bool?) content.GetValueForProperty("EnablePrivateCluster",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnablePrivateCluster, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PrivateDnsZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).PrivateDnsZone = (string) content.GetValueForProperty("PrivateDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).PrivateDnsZone, global::System.Convert.ToString); + } + if (content.Contains("EnablePrivateClusterPublicFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnablePrivateClusterPublicFqdn = (bool?) content.GetValueForProperty("EnablePrivateClusterPublicFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnablePrivateClusterPublicFqdn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DisableRunCommand")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).DisableRunCommand = (bool?) content.GetValueForProperty("DisableRunCommand",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).DisableRunCommand, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableVnetIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnableVnetIntegration = (bool?) content.GetValueForProperty("EnableVnetIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).EnableVnetIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).SubnetId = (string) content.GetValueForProperty("SubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)this).SubnetId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Access profile for managed cluster API server. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterApiServerAccessProfileTypeConverter))] + public partial interface IManagedClusterApiServerAccessProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.TypeConverter.cs new file mode 100644 index 000000000000..9da79746d3d8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterApiServerAccessProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterApiServerAccessProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterApiServerAccessProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterApiServerAccessProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.cs new file mode 100644 index 000000000000..409f28f9d835 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Access profile for managed cluster API server. + public partial class ManagedClusterApiServerAccessProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal + { + + /// Backing field for property. + private string[] _authorizedIPRange; + + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] AuthorizedIPRange { get => this._authorizedIPRange; set => this._authorizedIPRange = value; } + + /// Backing field for property. + private bool? _disableRunCommand; + + /// Whether to disable run command for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? DisableRunCommand { get => this._disableRunCommand; set => this._disableRunCommand = value; } + + /// Backing field for property. + private bool? _enablePrivateCluster; + + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnablePrivateCluster { get => this._enablePrivateCluster; set => this._enablePrivateCluster = value; } + + /// Backing field for property. + private bool? _enablePrivateClusterPublicFqdn; + + /// Whether to create additional public FQDN for private cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnablePrivateClusterPublicFqdn { get => this._enablePrivateClusterPublicFqdn; set => this._enablePrivateClusterPublicFqdn = value; } + + /// Backing field for property. + private bool? _enableVnetIntegration; + + /// Whether to enable apiserver vnet integration for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableVnetIntegration { get => this._enableVnetIntegration; set => this._enableVnetIntegration = value; } + + /// Backing field for property. + private string _privateDnsZone; + + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string PrivateDnsZone { get => this._privateDnsZone; set => this._privateDnsZone = value; } + + /// Backing field for property. + private string _subnetId; + + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string SubnetId { get => this._subnetId; set => this._subnetId = value; } + + /// Creates an new instance. + public ManagedClusterApiServerAccessProfile() + { + + } + } + /// Access profile for managed cluster API server. + public partial interface IManagedClusterApiServerAccessProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges).", + SerializedName = @"authorizedIPRanges", + PossibleTypes = new [] { typeof(string) })] + string[] AuthorizedIPRange { get; set; } + /// Whether to disable run command for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to disable run command for the cluster or not.", + SerializedName = @"disableRunCommand", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableRunCommand { get; set; } + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters).", + SerializedName = @"enablePrivateCluster", + PossibleTypes = new [] { typeof(bool) })] + bool? EnablePrivateCluster { get; set; } + /// Whether to create additional public FQDN for private cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to create additional public FQDN for private cluster or not.", + SerializedName = @"enablePrivateClusterPublicFQDN", + PossibleTypes = new [] { typeof(bool) })] + bool? EnablePrivateClusterPublicFqdn { get; set; } + /// Whether to enable apiserver vnet integration for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable apiserver vnet integration for the cluster or not.", + SerializedName = @"enableVnetIntegration", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableVnetIntegration { get; set; } + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'.", + SerializedName = @"privateDNSZone", + PossibleTypes = new [] { typeof(string) })] + string PrivateDnsZone { get; set; } + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet integration.", + SerializedName = @"subnetId", + PossibleTypes = new [] { typeof(string) })] + string SubnetId { get; set; } + + } + /// Access profile for managed cluster API server. + internal partial interface IManagedClusterApiServerAccessProfileInternal + + { + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + string[] AuthorizedIPRange { get; set; } + /// Whether to disable run command for the cluster or not. + bool? DisableRunCommand { get; set; } + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + bool? EnablePrivateCluster { get; set; } + /// Whether to create additional public FQDN for private cluster or not. + bool? EnablePrivateClusterPublicFqdn { get; set; } + /// Whether to enable apiserver vnet integration for the cluster or not. + bool? EnableVnetIntegration { get; set; } + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + string PrivateDnsZone { get; set; } + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + string SubnetId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.json.cs new file mode 100644 index 000000000000..755ddf69d20f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterApiServerAccessProfile.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Access profile for managed cluster API server. + public partial class ManagedClusterApiServerAccessProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterApiServerAccessProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterApiServerAccessProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_authorizedIPRange = If( json?.PropertyT("authorizedIPRanges"), out var __jsonAuthorizedIPRanges) ? If( __jsonAuthorizedIPRanges as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AuthorizedIPRange;} + {_enablePrivateCluster = If( json?.PropertyT("enablePrivateCluster"), out var __jsonEnablePrivateCluster) ? (bool?)__jsonEnablePrivateCluster : EnablePrivateCluster;} + {_privateDnsZone = If( json?.PropertyT("privateDNSZone"), out var __jsonPrivateDnsZone) ? (string)__jsonPrivateDnsZone : (string)PrivateDnsZone;} + {_enablePrivateClusterPublicFqdn = If( json?.PropertyT("enablePrivateClusterPublicFQDN"), out var __jsonEnablePrivateClusterPublicFqdn) ? (bool?)__jsonEnablePrivateClusterPublicFqdn : EnablePrivateClusterPublicFqdn;} + {_disableRunCommand = If( json?.PropertyT("disableRunCommand"), out var __jsonDisableRunCommand) ? (bool?)__jsonDisableRunCommand : DisableRunCommand;} + {_enableVnetIntegration = If( json?.PropertyT("enableVnetIntegration"), out var __jsonEnableVnetIntegration) ? (bool?)__jsonEnableVnetIntegration : EnableVnetIntegration;} + {_subnetId = If( json?.PropertyT("subnetId"), out var __jsonSubnetId) ? (string)__jsonSubnetId : (string)SubnetId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._authorizedIPRange) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._authorizedIPRange ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("authorizedIPRanges",__w); + } + AddIf( null != this._enablePrivateCluster ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enablePrivateCluster) : null, "enablePrivateCluster" ,container.Add ); + AddIf( null != (((object)this._privateDnsZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._privateDnsZone.ToString()) : null, "privateDNSZone" ,container.Add ); + AddIf( null != this._enablePrivateClusterPublicFqdn ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enablePrivateClusterPublicFqdn) : null, "enablePrivateClusterPublicFQDN" ,container.Add ); + AddIf( null != this._disableRunCommand ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._disableRunCommand) : null, "disableRunCommand" ,container.Add ); + AddIf( null != this._enableVnetIntegration ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableVnetIntegration) : null, "enableVnetIntegration" ,container.Add ); + AddIf( null != (((object)this._subnetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._subnetId.ToString()) : null, "subnetId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.PowerShell.cs new file mode 100644 index 000000000000..caab64aafbb5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Auto upgrade profile for a managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAutoUpgradeProfileTypeConverter))] + public partial class ManagedClusterAutoUpgradeProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAutoUpgradeProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAutoUpgradeProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAutoUpgradeProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)this).UpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel?) content.GetValueForProperty("UpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)this).UpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel.CreateFrom); + } + if (content.Contains("NodeOSUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)this).NodeOSUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel?) content.GetValueForProperty("NodeOSUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)this).NodeOSUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterAutoUpgradeProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)this).UpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel?) content.GetValueForProperty("UpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)this).UpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel.CreateFrom); + } + if (content.Contains("NodeOSUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)this).NodeOSUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel?) content.GetValueForProperty("NodeOSUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)this).NodeOSUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Auto upgrade profile for a managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAutoUpgradeProfileTypeConverter))] + public partial interface IManagedClusterAutoUpgradeProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.TypeConverter.cs new file mode 100644 index 000000000000..cc6848dca469 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAutoUpgradeProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAutoUpgradeProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAutoUpgradeProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAutoUpgradeProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.cs new file mode 100644 index 000000000000..324de4b8c446 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Auto upgrade profile for a managed cluster. + public partial class ManagedClusterAutoUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? _nodeOSUpgradeChannel; + + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? NodeOSUpgradeChannel { get => this._nodeOSUpgradeChannel; set => this._nodeOSUpgradeChannel = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? _upgradeChannel; + + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? UpgradeChannel { get => this._upgradeChannel; set => this._upgradeChannel = value; } + + /// Creates an new instance. + public ManagedClusterAutoUpgradeProfile() + { + + } + } + /// Auto upgrade profile for a managed cluster. + public partial interface IManagedClusterAutoUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA.", + SerializedName = @"nodeOSUpgradeChannel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? NodeOSUpgradeChannel { get; set; } + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel).", + SerializedName = @"upgradeChannel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? UpgradeChannel { get; set; } + + } + /// Auto upgrade profile for a managed cluster. + internal partial interface IManagedClusterAutoUpgradeProfileInternal + + { + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? NodeOSUpgradeChannel { get; set; } + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? UpgradeChannel { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.json.cs new file mode 100644 index 000000000000..158e43d4daea --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAutoUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Auto upgrade profile for a managed cluster. + public partial class ManagedClusterAutoUpgradeProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAutoUpgradeProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAutoUpgradeProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_upgradeChannel = If( json?.PropertyT("upgradeChannel"), out var __jsonUpgradeChannel) ? (string)__jsonUpgradeChannel : (string)UpgradeChannel;} + {_nodeOSUpgradeChannel = If( json?.PropertyT("nodeOSUpgradeChannel"), out var __jsonNodeOSUpgradeChannel) ? (string)__jsonNodeOSUpgradeChannel : (string)NodeOSUpgradeChannel;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._upgradeChannel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._upgradeChannel.ToString()) : null, "upgradeChannel" ,container.Add ); + AddIf( null != (((object)this._nodeOSUpgradeChannel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nodeOSUpgradeChannel.ToString()) : null, "nodeOSUpgradeChannel" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.PowerShell.cs new file mode 100644 index 000000000000..9ff2d63ecd8c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Prometheus addon profile for the container service cluster + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileTypeConverter))] + public partial class ManagedClusterAzureMonitorProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAzureMonitorProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAzureMonitorProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAzureMonitorProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerInsight")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsight = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights) content.GetValueForProperty("ContainerInsight",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsight, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsightsTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring) content.GetValueForProperty("AppMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("MetricKubeStateMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).MetricKubeStateMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics) content.GetValueForProperty("MetricKubeStateMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).MetricKubeStateMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("MetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).MetricEnabled = (bool) content.GetValueForProperty("MetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).MetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightEnabled = (bool?) content.GetValueForProperty("ContainerInsightEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("ContainerInsightLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ContainerInsightSyslogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightSyslogPort = (long?) content.GetValueForProperty("ContainerInsightSyslogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightSyslogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ContainerInsightDisableCustomMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightDisableCustomMetric = (bool?) content.GetValueForProperty("ContainerInsightDisableCustomMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightDisableCustomMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightDisablePrometheusMetricsScraping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightDisablePrometheusMetricsScraping = (bool?) content.GetValueForProperty("ContainerInsightDisablePrometheusMetricsScraping",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightDisablePrometheusMetricsScraping, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AppMonitoringAutoInstrumentation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringAutoInstrumentation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) content.GetValueForProperty("AppMonitoringAutoInstrumentation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringAutoInstrumentation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringOpenTelemetryMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) content.GetValueForProperty("AppMonitoringOpenTelemetryMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringOpenTelemetryMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringOpenTelemetryLog = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) content.GetValueForProperty("AppMonitoringOpenTelemetryLog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringOpenTelemetryLog, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter.ConvertFrom); + } + if (content.Contains("KubeStateMetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).KubeStateMetricLabelsAllowlist = (string) content.GetValueForProperty("KubeStateMetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).KubeStateMetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).KubeStateMetricAnnotationsAllowList = (string) content.GetValueForProperty("KubeStateMetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).KubeStateMetricAnnotationsAllowList, global::System.Convert.ToString); + } + if (content.Contains("AutoInstrumentationEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AutoInstrumentationEnabled = (bool?) content.GetValueForProperty("AutoInstrumentationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AutoInstrumentationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryMetricEnabled = (bool?) content.GetValueForProperty("OpenTelemetryMetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryMetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryMetricPort = (long?) content.GetValueForProperty("OpenTelemetryMetricPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryMetricPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("OpenTelemetryLogEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryLogEnabled = (bool?) content.GetValueForProperty("OpenTelemetryLogEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryLogEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryLogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryLogPort = (long?) content.GetValueForProperty("OpenTelemetryLogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryLogPort, (__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 ManagedClusterAzureMonitorProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerInsight")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsight = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights) content.GetValueForProperty("ContainerInsight",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsight, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsightsTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring) content.GetValueForProperty("AppMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("MetricKubeStateMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).MetricKubeStateMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics) content.GetValueForProperty("MetricKubeStateMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).MetricKubeStateMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("MetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).MetricEnabled = (bool) content.GetValueForProperty("MetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).MetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightEnabled = (bool?) content.GetValueForProperty("ContainerInsightEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("ContainerInsightLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ContainerInsightSyslogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightSyslogPort = (long?) content.GetValueForProperty("ContainerInsightSyslogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightSyslogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ContainerInsightDisableCustomMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightDisableCustomMetric = (bool?) content.GetValueForProperty("ContainerInsightDisableCustomMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightDisableCustomMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightDisablePrometheusMetricsScraping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightDisablePrometheusMetricsScraping = (bool?) content.GetValueForProperty("ContainerInsightDisablePrometheusMetricsScraping",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).ContainerInsightDisablePrometheusMetricsScraping, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AppMonitoringAutoInstrumentation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringAutoInstrumentation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) content.GetValueForProperty("AppMonitoringAutoInstrumentation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringAutoInstrumentation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringOpenTelemetryMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) content.GetValueForProperty("AppMonitoringOpenTelemetryMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringOpenTelemetryMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringOpenTelemetryLog = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) content.GetValueForProperty("AppMonitoringOpenTelemetryLog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AppMonitoringOpenTelemetryLog, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter.ConvertFrom); + } + if (content.Contains("KubeStateMetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).KubeStateMetricLabelsAllowlist = (string) content.GetValueForProperty("KubeStateMetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).KubeStateMetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).KubeStateMetricAnnotationsAllowList = (string) content.GetValueForProperty("KubeStateMetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).KubeStateMetricAnnotationsAllowList, global::System.Convert.ToString); + } + if (content.Contains("AutoInstrumentationEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AutoInstrumentationEnabled = (bool?) content.GetValueForProperty("AutoInstrumentationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).AutoInstrumentationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryMetricEnabled = (bool?) content.GetValueForProperty("OpenTelemetryMetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryMetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryMetricPort = (long?) content.GetValueForProperty("OpenTelemetryMetricPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryMetricPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("OpenTelemetryLogEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryLogEnabled = (bool?) content.GetValueForProperty("OpenTelemetryLogEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryLogEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryLogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryLogPort = (long?) content.GetValueForProperty("OpenTelemetryLogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)this).OpenTelemetryLogPort, (__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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Prometheus addon profile for the container service cluster + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileTypeConverter))] + public partial interface IManagedClusterAzureMonitorProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.TypeConverter.cs new file mode 100644 index 000000000000..3f15f076585d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAzureMonitorProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAzureMonitorProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.cs new file mode 100644 index 000000000000..9b28d4c182ec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Prometheus addon profile for the container service cluster + public partial class ManagedClusterAzureMonitorProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring _appMonitoring; + + /// + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring AppMonitoring { get => (this._appMonitoring = this._appMonitoring ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoring()); set => this._appMonitoring = value; } + + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoInstrumentationEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).AutoInstrumentationEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).AutoInstrumentationEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights _containerInsight; + + /// + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights ContainerInsight { get => (this._containerInsight = this._containerInsight ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsights()); set => this._containerInsight = value; } + + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ContainerInsightDisableCustomMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).DisableCustomMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).DisableCustomMetric = value ?? default(bool); } + + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ContainerInsightDisablePrometheusMetricsScraping { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).DisablePrometheusMetricsScraping; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).DisablePrometheusMetricsScraping = value ?? default(bool); } + + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ContainerInsightEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).Enabled = value ?? default(bool); } + + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ContainerInsightLogAnalyticsWorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).LogAnalyticsWorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).LogAnalyticsWorkspaceResourceId = value ?? null; } + + /// The syslog host port. If not specified, the default port is 28330. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? ContainerInsightSyslogPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).SyslogPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)ContainerInsight).SyslogPort = value ?? default(long); } + + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeStateMetricAnnotationsAllowList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)Metric).KubeStateMetricAnnotationsAllowList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)Metric).KubeStateMetricAnnotationsAllowList = value ?? null; } + + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeStateMetricLabelsAllowlist { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)Metric).KubeStateMetricLabelsAllowlist; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)Metric).KubeStateMetricLabelsAllowlist = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics _metric; + + /// Metrics profile for the prometheus service addon + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics Metric { get => (this._metric = this._metric ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetrics()); set => this._metric = value; } + + /// Whether to enable the Prometheus collector + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? MetricEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)Metric).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)Metric).Enabled = value ?? default(bool); } + + /// Internal Acessors for AppMonitoring + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal.AppMonitoring { get => (this._appMonitoring = this._appMonitoring ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoring()); set { {_appMonitoring = value;} } } + + /// Internal Acessors for AppMonitoringAutoInstrumentation + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal.AppMonitoringAutoInstrumentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).AutoInstrumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).AutoInstrumentation = value; } + + /// Internal Acessors for AppMonitoringOpenTelemetryLog + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal.AppMonitoringOpenTelemetryLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryLog = value; } + + /// Internal Acessors for AppMonitoringOpenTelemetryMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal.AppMonitoringOpenTelemetryMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryMetric = value; } + + /// Internal Acessors for ContainerInsight + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal.ContainerInsight { get => (this._containerInsight = this._containerInsight ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsights()); set { {_containerInsight = value;} } } + + /// Internal Acessors for Metric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal.Metric { get => (this._metric = this._metric ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetrics()); set { {_metric = value;} } } + + /// Internal Acessors for MetricKubeStateMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal.MetricKubeStateMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)Metric).KubeStateMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)Metric).KubeStateMetric = value; } + + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OpenTelemetryLogEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryLogEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryLogEnabled = value ?? default(bool); } + + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? OpenTelemetryLogPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryLogPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryLogPort = value ?? default(long); } + + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OpenTelemetryMetricEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryMetricEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryMetricEnabled = value ?? default(bool); } + + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? OpenTelemetryMetricPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryMetricPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)AppMonitoring).OpenTelemetryMetricPort = value ?? default(long); } + + /// Creates an new instance. + public ManagedClusterAzureMonitorProfile() + { + + } + } + /// Prometheus addon profile for the container service cluster + public partial interface IManagedClusterAzureMonitorProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Auto Instrumentation is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoInstrumentationEnabled { get; set; } + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disableCustomMetrics", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerInsightDisableCustomMetric { get; set; } + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disablePrometheusMetricsScraping", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerInsightDisablePrometheusMetricsScraping { get; set; } + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Azure Monitor Container Insights Logs Addon is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerInsightEnabled { get; set; } + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string ContainerInsightLogAnalyticsWorkspaceResourceId { get; set; } + /// The syslog host port. If not specified, the default port is 28330. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The syslog host port. If not specified, the default port is 28330.", + SerializedName = @"syslogPort", + PossibleTypes = new [] { typeof(long) })] + long? ContainerInsightSyslogPort { get; set; } + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric.", + SerializedName = @"metricAnnotationsAllowList", + PossibleTypes = new [] { typeof(string) })] + string KubeStateMetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. ", + SerializedName = @"metricLabelsAllowlist", + PossibleTypes = new [] { typeof(string) })] + string KubeStateMetricLabelsAllowlist { get; set; } + /// Whether to enable the Prometheus collector + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable the Prometheus collector", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? MetricEnabled { get; set; } + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OpenTelemetryLogEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? OpenTelemetryLogPort { get; set; } + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Metrics is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OpenTelemetryMetricEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? OpenTelemetryMetricPort { get; set; } + + } + /// Prometheus addon profile for the container service cluster + internal partial interface IManagedClusterAzureMonitorProfileInternal + + { + /// + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring AppMonitoring { get; set; } + /// + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation AppMonitoringAutoInstrumentation { get; set; } + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs AppMonitoringOpenTelemetryLog { get; set; } + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics AppMonitoringOpenTelemetryMetric { get; set; } + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + bool? AutoInstrumentationEnabled { get; set; } + /// + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights ContainerInsight { get; set; } + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + bool? ContainerInsightDisableCustomMetric { get; set; } + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + bool? ContainerInsightDisablePrometheusMetricsScraping { get; set; } + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + bool? ContainerInsightEnabled { get; set; } + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + string ContainerInsightLogAnalyticsWorkspaceResourceId { get; set; } + /// The syslog host port. If not specified, the default port is 28330. + long? ContainerInsightSyslogPort { get; set; } + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + string KubeStateMetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + string KubeStateMetricLabelsAllowlist { get; set; } + /// Metrics profile for the prometheus service addon + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics Metric { get; set; } + /// Whether to enable the Prometheus collector + bool? MetricEnabled { get; set; } + /// + /// Kube State Metrics for prometheus addon profile for the container service cluster + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics MetricKubeStateMetric { get; set; } + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + bool? OpenTelemetryLogEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + long? OpenTelemetryLogPort { get; set; } + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + bool? OpenTelemetryMetricEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + long? OpenTelemetryMetricPort { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.json.cs new file mode 100644 index 000000000000..57bf3480f22b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Prometheus addon profile for the container service cluster + public partial class ManagedClusterAzureMonitorProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAzureMonitorProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAzureMonitorProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_metric = If( json?.PropertyT("metrics"), out var __jsonMetrics) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetrics.FromJson(__jsonMetrics) : Metric;} + {_containerInsight = If( json?.PropertyT("containerInsights"), out var __jsonContainerInsights) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsights.FromJson(__jsonContainerInsights) : ContainerInsight;} + {_appMonitoring = If( json?.PropertyT("appMonitoring"), out var __jsonAppMonitoring) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoring.FromJson(__jsonAppMonitoring) : AppMonitoring;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._metric ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._metric.ToJson(null,serializationMode) : null, "metrics" ,container.Add ); + AddIf( null != this._containerInsight ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._containerInsight.ToJson(null,serializationMode) : null, "containerInsights" ,container.Add ); + AddIf( null != this._appMonitoring ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._appMonitoring.ToJson(null,serializationMode) : null, "appMonitoring" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.PowerShell.cs new file mode 100644 index 000000000000..78bb5e94f7a9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileAppMonitoringTypeConverter))] + public partial class ManagedClusterAzureMonitorProfileAppMonitoring + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAzureMonitorProfileAppMonitoring(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAzureMonitorProfileAppMonitoring(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAzureMonitorProfileAppMonitoring(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AutoInstrumentation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).AutoInstrumentation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) content.GetValueForProperty("AutoInstrumentation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).AutoInstrumentation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter.ConvertFrom); + } + if (content.Contains("OpenTelemetryMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) content.GetValueForProperty("OpenTelemetryMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("OpenTelemetryLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLog = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) content.GetValueForProperty("OpenTelemetryLog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLog, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoInstrumentationEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).AutoInstrumentationEnabled = (bool?) content.GetValueForProperty("AutoInstrumentationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).AutoInstrumentationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetricEnabled = (bool?) content.GetValueForProperty("OpenTelemetryMetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetricPort = (long?) content.GetValueForProperty("OpenTelemetryMetricPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetricPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("OpenTelemetryLogEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLogEnabled = (bool?) content.GetValueForProperty("OpenTelemetryLogEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLogEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryLogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLogPort = (long?) content.GetValueForProperty("OpenTelemetryLogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLogPort, (__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 ManagedClusterAzureMonitorProfileAppMonitoring(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AutoInstrumentation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).AutoInstrumentation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) content.GetValueForProperty("AutoInstrumentation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).AutoInstrumentation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter.ConvertFrom); + } + if (content.Contains("OpenTelemetryMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) content.GetValueForProperty("OpenTelemetryMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("OpenTelemetryLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLog = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) content.GetValueForProperty("OpenTelemetryLog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLog, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoInstrumentationEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).AutoInstrumentationEnabled = (bool?) content.GetValueForProperty("AutoInstrumentationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).AutoInstrumentationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetricEnabled = (bool?) content.GetValueForProperty("OpenTelemetryMetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetricPort = (long?) content.GetValueForProperty("OpenTelemetryMetricPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryMetricPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("OpenTelemetryLogEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLogEnabled = (bool?) content.GetValueForProperty("OpenTelemetryLogEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLogEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryLogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLogPort = (long?) content.GetValueForProperty("OpenTelemetryLogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal)this).OpenTelemetryLogPort, (__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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileAppMonitoringTypeConverter))] + public partial interface IManagedClusterAzureMonitorProfileAppMonitoring + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.TypeConverter.cs new file mode 100644 index 000000000000..726bd6a70680 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAzureMonitorProfileAppMonitoring.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileAppMonitoring.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileAppMonitoring.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.cs new file mode 100644 index 000000000000..324174f90f22 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoring : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation _autoInstrumentation; + + /// + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation AutoInstrumentation { get => (this._autoInstrumentation = this._autoInstrumentation ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation()); set => this._autoInstrumentation = value; } + + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoInstrumentationEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationInternal)AutoInstrumentation).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationInternal)AutoInstrumentation).Enabled = value ?? default(bool); } + + /// Internal Acessors for AutoInstrumentation + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal.AutoInstrumentation { get => (this._autoInstrumentation = this._autoInstrumentation ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation()); set { {_autoInstrumentation = value;} } } + + /// Internal Acessors for OpenTelemetryLog + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal.OpenTelemetryLog { get => (this._openTelemetryLog = this._openTelemetryLog ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs()); set { {_openTelemetryLog = value;} } } + + /// Internal Acessors for OpenTelemetryMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringInternal.OpenTelemetryMetric { get => (this._openTelemetryMetric = this._openTelemetryMetric ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics()); set { {_openTelemetryMetric = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs _openTelemetryLog; + + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs OpenTelemetryLog { get => (this._openTelemetryLog = this._openTelemetryLog ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs()); set => this._openTelemetryLog = value; } + + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OpenTelemetryLogEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)OpenTelemetryLog).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)OpenTelemetryLog).Enabled = value ?? default(bool); } + + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? OpenTelemetryLogPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)OpenTelemetryLog).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)OpenTelemetryLog).Port = value ?? default(long); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics _openTelemetryMetric; + + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics OpenTelemetryMetric { get => (this._openTelemetryMetric = this._openTelemetryMetric ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics()); set => this._openTelemetryMetric = value; } + + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OpenTelemetryMetricEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)OpenTelemetryMetric).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)OpenTelemetryMetric).Enabled = value ?? default(bool); } + + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? OpenTelemetryMetricPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)OpenTelemetryMetric).Port; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)OpenTelemetryMetric).Port = value ?? default(long); } + + /// + /// Creates an new instance. + /// + public ManagedClusterAzureMonitorProfileAppMonitoring() + { + + } + } + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + public partial interface IManagedClusterAzureMonitorProfileAppMonitoring : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Auto Instrumentation is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoInstrumentationEnabled { get; set; } + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OpenTelemetryLogEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? OpenTelemetryLogPort { get; set; } + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Metrics is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OpenTelemetryMetricEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? OpenTelemetryMetricPort { get; set; } + + } + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + internal partial interface IManagedClusterAzureMonitorProfileAppMonitoringInternal + + { + /// + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation AutoInstrumentation { get; set; } + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + bool? AutoInstrumentationEnabled { get; set; } + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs OpenTelemetryLog { get; set; } + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + bool? OpenTelemetryLogEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + long? OpenTelemetryLogPort { get; set; } + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics OpenTelemetryMetric { get; set; } + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + bool? OpenTelemetryMetricEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + long? OpenTelemetryMetricPort { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.json.cs new file mode 100644 index 000000000000..ce004d7d8b8a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoring.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoring + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAzureMonitorProfileAppMonitoring(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAzureMonitorProfileAppMonitoring(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_autoInstrumentation = If( json?.PropertyT("autoInstrumentation"), out var __jsonAutoInstrumentation) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.FromJson(__jsonAutoInstrumentation) : AutoInstrumentation;} + {_openTelemetryMetric = If( json?.PropertyT("openTelemetryMetrics"), out var __jsonOpenTelemetryMetrics) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.FromJson(__jsonOpenTelemetryMetrics) : OpenTelemetryMetric;} + {_openTelemetryLog = If( json?.PropertyT("openTelemetryLogs"), out var __jsonOpenTelemetryLogs) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.FromJson(__jsonOpenTelemetryLogs) : OpenTelemetryLog;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._autoInstrumentation ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._autoInstrumentation.ToJson(null,serializationMode) : null, "autoInstrumentation" ,container.Add ); + AddIf( null != this._openTelemetryMetric ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._openTelemetryMetric.ToJson(null,serializationMode) : null, "openTelemetryMetrics" ,container.Add ); + AddIf( null != this._openTelemetryLog ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._openTelemetryLog.ToJson(null,serializationMode) : null, "openTelemetryLogs" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.PowerShell.cs new file mode 100644 index 000000000000..e66124a08570 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter))] + public partial class ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationInternal)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 ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter))] + public partial interface IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.TypeConverter.cs new file mode 100644 index 000000000000..1e533cff15e8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.cs new file mode 100644 index 000000000000..52b71901153a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation() + { + + } + } + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + public partial interface IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Auto Instrumentation is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + internal partial interface IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationInternal + + { + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.json.cs new file mode 100644 index 000000000000..85e393ddf283 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.PowerShell.cs new file mode 100644 index 000000000000..edf54351de87 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter))] + public partial class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)this).Port = (long?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)this).Port, (__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 ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)this).Port = (long?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal)this).Port, (__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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter))] + public partial interface IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.TypeConverter.cs new file mode 100644 index 000000000000..de26ae83a95c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.cs new file mode 100644 index 000000000000..5742792fd990 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private long? _port; + + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public long? Port { get => this._port; set => this._port = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs() + { + + } + } + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + public partial interface IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? Port { get; set; } + + } + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + internal partial interface IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsInternal + + { + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + bool? Enabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + long? Port { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.json.cs new file mode 100644 index 000000000000..79d62c42c70d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (long?)__jsonPort : Port;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((long)this._port) : null, "port" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.PowerShell.cs new file mode 100644 index 000000000000..03c2c8db2aa8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.PowerShell.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter))] + public partial class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)this).Port = (long?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)this).Port, (__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 ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Port")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)this).Port = (long?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal)this).Port, (__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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter))] + public partial interface IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.TypeConverter.cs new file mode 100644 index 000000000000..811989803b41 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.cs new file mode 100644 index 000000000000..1a3961576307 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private long? _port; + + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public long? Port { get => this._port; set => this._port = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics() + { + + } + } + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + public partial interface IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Metrics is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? Port { get; set; } + + } + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + internal partial interface IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsInternal + + { + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + bool? Enabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + long? Port { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.json.cs new file mode 100644 index 000000000000..0020a368dcb8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (long?)__jsonPort : Port;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != this._port ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((long)this._port) : null, "port" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.PowerShell.cs new file mode 100644 index 000000000000..91a7524788d3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileContainerInsightsTypeConverter))] + public partial class ManagedClusterAzureMonitorProfileContainerInsights + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAzureMonitorProfileContainerInsights(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAzureMonitorProfileContainerInsights(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAzureMonitorProfileContainerInsights(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).LogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("LogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).LogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("SyslogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).SyslogPort = (long?) content.GetValueForProperty("SyslogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).SyslogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DisableCustomMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).DisableCustomMetric = (bool?) content.GetValueForProperty("DisableCustomMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).DisableCustomMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DisablePrometheusMetricsScraping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).DisablePrometheusMetricsScraping = (bool?) content.GetValueForProperty("DisablePrometheusMetricsScraping",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).DisablePrometheusMetricsScraping, (__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 ManagedClusterAzureMonitorProfileContainerInsights(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).LogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("LogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).LogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("SyslogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).SyslogPort = (long?) content.GetValueForProperty("SyslogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).SyslogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DisableCustomMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).DisableCustomMetric = (bool?) content.GetValueForProperty("DisableCustomMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).DisableCustomMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DisablePrometheusMetricsScraping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).DisablePrometheusMetricsScraping = (bool?) content.GetValueForProperty("DisablePrometheusMetricsScraping",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal)this).DisablePrometheusMetricsScraping, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileContainerInsightsTypeConverter))] + public partial interface IManagedClusterAzureMonitorProfileContainerInsights + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.TypeConverter.cs new file mode 100644 index 000000000000..35102bc20ed5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAzureMonitorProfileContainerInsightsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAzureMonitorProfileContainerInsights.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileContainerInsights.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileContainerInsights.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.cs new file mode 100644 index 000000000000..0ba7516b72a3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileContainerInsights : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsightsInternal + { + + /// Backing field for property. + private bool? _disableCustomMetric; + + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? DisableCustomMetric { get => this._disableCustomMetric; set => this._disableCustomMetric = value; } + + /// Backing field for property. + private bool? _disablePrometheusMetricsScraping; + + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? DisablePrometheusMetricsScraping { get => this._disablePrometheusMetricsScraping; set => this._disablePrometheusMetricsScraping = value; } + + /// Backing field for property. + private bool? _enabled; + + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _logAnalyticsWorkspaceResourceId; + + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string LogAnalyticsWorkspaceResourceId { get => this._logAnalyticsWorkspaceResourceId; set => this._logAnalyticsWorkspaceResourceId = value; } + + /// Backing field for property. + private long? _syslogPort; + + /// The syslog host port. If not specified, the default port is 28330. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public long? SyslogPort { get => this._syslogPort; set => this._syslogPort = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterAzureMonitorProfileContainerInsights() + { + + } + } + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + public partial interface IManagedClusterAzureMonitorProfileContainerInsights : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disableCustomMetrics", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableCustomMetric { get; set; } + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disablePrometheusMetricsScraping", + PossibleTypes = new [] { typeof(bool) })] + bool? DisablePrometheusMetricsScraping { get; set; } + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Azure Monitor Container Insights Logs Addon is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string LogAnalyticsWorkspaceResourceId { get; set; } + /// The syslog host port. If not specified, the default port is 28330. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The syslog host port. If not specified, the default port is 28330.", + SerializedName = @"syslogPort", + PossibleTypes = new [] { typeof(long) })] + long? SyslogPort { get; set; } + + } + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + internal partial interface IManagedClusterAzureMonitorProfileContainerInsightsInternal + + { + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + bool? DisableCustomMetric { get; set; } + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + bool? DisablePrometheusMetricsScraping { get; set; } + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + bool? Enabled { get; set; } + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + string LogAnalyticsWorkspaceResourceId { get; set; } + /// The syslog host port. If not specified, the default port is 28330. + long? SyslogPort { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.json.cs new file mode 100644 index 000000000000..e430ba00dd07 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileContainerInsights.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + /// + public partial class ManagedClusterAzureMonitorProfileContainerInsights + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAzureMonitorProfileContainerInsights(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAzureMonitorProfileContainerInsights(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_logAnalyticsWorkspaceResourceId = If( json?.PropertyT("logAnalyticsWorkspaceResourceId"), out var __jsonLogAnalyticsWorkspaceResourceId) ? (string)__jsonLogAnalyticsWorkspaceResourceId : (string)LogAnalyticsWorkspaceResourceId;} + {_syslogPort = If( json?.PropertyT("syslogPort"), out var __jsonSyslogPort) ? (long?)__jsonSyslogPort : SyslogPort;} + {_disableCustomMetric = If( json?.PropertyT("disableCustomMetrics"), out var __jsonDisableCustomMetrics) ? (bool?)__jsonDisableCustomMetrics : DisableCustomMetric;} + {_disablePrometheusMetricsScraping = If( json?.PropertyT("disablePrometheusMetricsScraping"), out var __jsonDisablePrometheusMetricsScraping) ? (bool?)__jsonDisablePrometheusMetricsScraping : DisablePrometheusMetricsScraping;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != (((object)this._logAnalyticsWorkspaceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._logAnalyticsWorkspaceResourceId.ToString()) : null, "logAnalyticsWorkspaceResourceId" ,container.Add ); + AddIf( null != this._syslogPort ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((long)this._syslogPort) : null, "syslogPort" ,container.Add ); + AddIf( null != this._disableCustomMetric ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._disableCustomMetric) : null, "disableCustomMetrics" ,container.Add ); + AddIf( null != this._disablePrometheusMetricsScraping ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._disablePrometheusMetricsScraping) : null, "disablePrometheusMetricsScraping" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.PowerShell.cs new file mode 100644 index 000000000000..6f017959164c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.PowerShell.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Kube State Metrics for prometheus addon profile for the container service cluster + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter))] + public partial class ManagedClusterAzureMonitorProfileKubeStateMetrics + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAzureMonitorProfileKubeStateMetrics(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAzureMonitorProfileKubeStateMetrics(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAzureMonitorProfileKubeStateMetrics(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)this).MetricLabelsAllowlist = (string) content.GetValueForProperty("MetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)this).MetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("MetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)this).MetricAnnotationsAllowList = (string) content.GetValueForProperty("MetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)this).MetricAnnotationsAllowList, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterAzureMonitorProfileKubeStateMetrics(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)this).MetricLabelsAllowlist = (string) content.GetValueForProperty("MetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)this).MetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("MetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)this).MetricAnnotationsAllowList = (string) content.GetValueForProperty("MetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)this).MetricAnnotationsAllowList, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Kube State Metrics for prometheus addon profile for the container service cluster + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter))] + public partial interface IManagedClusterAzureMonitorProfileKubeStateMetrics + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.TypeConverter.cs new file mode 100644 index 000000000000..6148335b3302 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAzureMonitorProfileKubeStateMetrics.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileKubeStateMetrics.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileKubeStateMetrics.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.cs new file mode 100644 index 000000000000..8d3446ce3b03 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Kube State Metrics for prometheus addon profile for the container service cluster + /// + public partial class ManagedClusterAzureMonitorProfileKubeStateMetrics : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal + { + + /// Backing field for property. + private string _metricAnnotationsAllowList; + + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string MetricAnnotationsAllowList { get => this._metricAnnotationsAllowList; set => this._metricAnnotationsAllowList = value; } + + /// Backing field for property. + private string _metricLabelsAllowlist; + + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string MetricLabelsAllowlist { get => this._metricLabelsAllowlist; set => this._metricLabelsAllowlist = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterAzureMonitorProfileKubeStateMetrics() + { + + } + } + /// Kube State Metrics for prometheus addon profile for the container service cluster + public partial interface IManagedClusterAzureMonitorProfileKubeStateMetrics : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric.", + SerializedName = @"metricAnnotationsAllowList", + PossibleTypes = new [] { typeof(string) })] + string MetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. ", + SerializedName = @"metricLabelsAllowlist", + PossibleTypes = new [] { typeof(string) })] + string MetricLabelsAllowlist { get; set; } + + } + /// Kube State Metrics for prometheus addon profile for the container service cluster + internal partial interface IManagedClusterAzureMonitorProfileKubeStateMetricsInternal + + { + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + string MetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + string MetricLabelsAllowlist { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.json.cs new file mode 100644 index 000000000000..2828a5b879cf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileKubeStateMetrics.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Kube State Metrics for prometheus addon profile for the container service cluster + /// + public partial class ManagedClusterAzureMonitorProfileKubeStateMetrics + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAzureMonitorProfileKubeStateMetrics(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAzureMonitorProfileKubeStateMetrics(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_metricLabelsAllowlist = If( json?.PropertyT("metricLabelsAllowlist"), out var __jsonMetricLabelsAllowlist) ? (string)__jsonMetricLabelsAllowlist : (string)MetricLabelsAllowlist;} + {_metricAnnotationsAllowList = If( json?.PropertyT("metricAnnotationsAllowList"), out var __jsonMetricAnnotationsAllowList) ? (string)__jsonMetricAnnotationsAllowList : (string)MetricAnnotationsAllowList;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._metricLabelsAllowlist)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._metricLabelsAllowlist.ToString()) : null, "metricLabelsAllowlist" ,container.Add ); + AddIf( null != (((object)this._metricAnnotationsAllowList)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._metricAnnotationsAllowList.ToString()) : null, "metricAnnotationsAllowList" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.PowerShell.cs new file mode 100644 index 000000000000..e9c01a917196 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Metrics profile for the prometheus service addon + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileMetricsTypeConverter))] + public partial class ManagedClusterAzureMonitorProfileMetrics + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterAzureMonitorProfileMetrics(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterAzureMonitorProfileMetrics(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterAzureMonitorProfileMetrics(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubeStateMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics) content.GetValueForProperty("KubeStateMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeStateMetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetricLabelsAllowlist = (string) content.GetValueForProperty("KubeStateMetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetricAnnotationsAllowList = (string) content.GetValueForProperty("KubeStateMetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetricAnnotationsAllowList, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterAzureMonitorProfileMetrics(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubeStateMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics) content.GetValueForProperty("KubeStateMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KubeStateMetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetricLabelsAllowlist = (string) content.GetValueForProperty("KubeStateMetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetricAnnotationsAllowList = (string) content.GetValueForProperty("KubeStateMetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal)this).KubeStateMetricAnnotationsAllowList, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metrics profile for the prometheus service addon + [System.ComponentModel.TypeConverter(typeof(ManagedClusterAzureMonitorProfileMetricsTypeConverter))] + public partial interface IManagedClusterAzureMonitorProfileMetrics + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.TypeConverter.cs new file mode 100644 index 000000000000..ce8455b3584d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterAzureMonitorProfileMetricsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterAzureMonitorProfileMetrics.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileMetrics.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterAzureMonitorProfileMetrics.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.cs new file mode 100644 index 000000000000..5da73b671b1a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Metrics profile for the prometheus service addon + public partial class ManagedClusterAzureMonitorProfileMetrics : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal + { + + /// Backing field for property. + private bool _enabled; + + /// Whether to enable the Prometheus collector + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics _kubeStateMetric; + + /// + /// Kube State Metrics for prometheus addon profile for the container service cluster + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics KubeStateMetric { get => (this._kubeStateMetric = this._kubeStateMetric ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetrics()); set => this._kubeStateMetric = value; } + + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeStateMetricAnnotationsAllowList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)KubeStateMetric).MetricAnnotationsAllowList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)KubeStateMetric).MetricAnnotationsAllowList = value ?? null; } + + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeStateMetricLabelsAllowlist { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)KubeStateMetric).MetricLabelsAllowlist; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetricsInternal)KubeStateMetric).MetricLabelsAllowlist = value ?? null; } + + /// Internal Acessors for KubeStateMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetricsInternal.KubeStateMetric { get => (this._kubeStateMetric = this._kubeStateMetric ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetrics()); set { {_kubeStateMetric = value;} } } + + /// + /// Creates an new instance. + /// + public ManagedClusterAzureMonitorProfileMetrics() + { + + } + } + /// Metrics profile for the prometheus service addon + public partial interface IManagedClusterAzureMonitorProfileMetrics : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable the Prometheus collector + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether to enable the Prometheus collector", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric.", + SerializedName = @"metricAnnotationsAllowList", + PossibleTypes = new [] { typeof(string) })] + string KubeStateMetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. ", + SerializedName = @"metricLabelsAllowlist", + PossibleTypes = new [] { typeof(string) })] + string KubeStateMetricLabelsAllowlist { get; set; } + + } + /// Metrics profile for the prometheus service addon + internal partial interface IManagedClusterAzureMonitorProfileMetricsInternal + + { + /// Whether to enable the Prometheus collector + bool Enabled { get; set; } + /// + /// Kube State Metrics for prometheus addon profile for the container service cluster + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics KubeStateMetric { get; set; } + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + string KubeStateMetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + string KubeStateMetricLabelsAllowlist { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.json.cs new file mode 100644 index 000000000000..1def511d173b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterAzureMonitorProfileMetrics.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Metrics profile for the prometheus service addon + public partial class ManagedClusterAzureMonitorProfileMetrics + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterAzureMonitorProfileMetrics(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterAzureMonitorProfileMetrics(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kubeStateMetric = If( json?.PropertyT("kubeStateMetrics"), out var __jsonKubeStateMetrics) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetrics.FromJson(__jsonKubeStateMetrics) : KubeStateMetric;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._kubeStateMetric ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._kubeStateMetric.ToJson(null,serializationMode) : null, "kubeStateMetrics" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.PowerShell.cs new file mode 100644 index 000000000000..dd6985272763 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The bootstrap profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterBootstrapProfileTypeConverter))] + public partial class ManagedClusterBootstrapProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterBootstrapProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterBootstrapProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterBootstrapProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ArtifactSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)this).ArtifactSource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource?) content.GetValueForProperty("ArtifactSource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)this).ArtifactSource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource.CreateFrom); + } + if (content.Contains("ContainerRegistryId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)this).ContainerRegistryId = (string) content.GetValueForProperty("ContainerRegistryId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)this).ContainerRegistryId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterBootstrapProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ArtifactSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)this).ArtifactSource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource?) content.GetValueForProperty("ArtifactSource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)this).ArtifactSource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource.CreateFrom); + } + if (content.Contains("ContainerRegistryId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)this).ContainerRegistryId = (string) content.GetValueForProperty("ContainerRegistryId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)this).ContainerRegistryId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The bootstrap profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterBootstrapProfileTypeConverter))] + public partial interface IManagedClusterBootstrapProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.TypeConverter.cs new file mode 100644 index 000000000000..eec252c9a49d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterBootstrapProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterBootstrapProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterBootstrapProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterBootstrapProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.cs new file mode 100644 index 000000000000..473976b589bf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The bootstrap profile. + public partial class ManagedClusterBootstrapProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? _artifactSource; + + /// The source where the artifacts are downloaded from. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? ArtifactSource { get => this._artifactSource; set => this._artifactSource = value; } + + /// Backing field for property. + private string _containerRegistryId; + + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ContainerRegistryId { get => this._containerRegistryId; set => this._containerRegistryId = value; } + + /// Creates an new instance. + public ManagedClusterBootstrapProfile() + { + + } + } + /// The bootstrap profile. + public partial interface IManagedClusterBootstrapProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The source where the artifacts are downloaded from. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source where the artifacts are downloaded from.", + SerializedName = @"artifactSource", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? ArtifactSource { get; set; } + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy.", + SerializedName = @"containerRegistryId", + PossibleTypes = new [] { typeof(string) })] + string ContainerRegistryId { get; set; } + + } + /// The bootstrap profile. + internal partial interface IManagedClusterBootstrapProfileInternal + + { + /// The source where the artifacts are downloaded from. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? ArtifactSource { get; set; } + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + string ContainerRegistryId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.json.cs new file mode 100644 index 000000000000..70b5c904f3bf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterBootstrapProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The bootstrap profile. + public partial class ManagedClusterBootstrapProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterBootstrapProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterBootstrapProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_artifactSource = If( json?.PropertyT("artifactSource"), out var __jsonArtifactSource) ? (string)__jsonArtifactSource : (string)ArtifactSource;} + {_containerRegistryId = If( json?.PropertyT("containerRegistryId"), out var __jsonContainerRegistryId) ? (string)__jsonContainerRegistryId : (string)ContainerRegistryId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._artifactSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._artifactSource.ToString()) : null, "artifactSource" ,container.Add ); + AddIf( null != (((object)this._containerRegistryId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._containerRegistryId.ToString()) : null, "containerRegistryId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.PowerShell.cs new file mode 100644 index 000000000000..7fe9cc7c91d9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The cost analysis configuration for the cluster + [System.ComponentModel.TypeConverter(typeof(ManagedClusterCostAnalysisTypeConverter))] + public partial class ManagedClusterCostAnalysis + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterCostAnalysis(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterCostAnalysis(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterCostAnalysis(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysisInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysisInternal)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 ManagedClusterCostAnalysis(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysisInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysisInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The cost analysis configuration for the cluster + [System.ComponentModel.TypeConverter(typeof(ManagedClusterCostAnalysisTypeConverter))] + public partial interface IManagedClusterCostAnalysis + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.TypeConverter.cs new file mode 100644 index 000000000000..c0d596adc7c1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterCostAnalysisTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterCostAnalysis.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterCostAnalysis.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterCostAnalysis.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.cs new file mode 100644 index 000000000000..59053dc5f5cd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The cost analysis configuration for the cluster + public partial class ManagedClusterCostAnalysis : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysisInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Creates an new instance. + public ManagedClusterCostAnalysis() + { + + } + } + /// The cost analysis configuration for the cluster + public partial interface IManagedClusterCostAnalysis : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// The cost analysis configuration for the cluster + internal partial interface IManagedClusterCostAnalysisInternal + + { + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.json.cs new file mode 100644 index 000000000000..e90e16200e24 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterCostAnalysis.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The cost analysis configuration for the cluster + public partial class ManagedClusterCostAnalysis + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterCostAnalysis(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterCostAnalysis(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.PowerShell.cs new file mode 100644 index 000000000000..5e46a4bdeddd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Cluster HTTP proxy configuration. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterHttpProxyConfigTypeConverter))] + public partial class ManagedClusterHttpProxyConfig + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterHttpProxyConfig(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterHttpProxyConfig(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterHttpProxyConfig(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HttpProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).HttpProxy = (string) content.GetValueForProperty("HttpProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).HttpProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpsProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).HttpsProxy = (string) content.GetValueForProperty("HttpsProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).HttpsProxy, global::System.Convert.ToString); + } + if (content.Contains("NoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).NoProxy = (string[]) content.GetValueForProperty("NoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).NoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EffectiveNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).EffectiveNoProxy = (string[]) content.GetValueForProperty("EffectiveNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).EffectiveNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TrustedCa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).TrustedCa = (string) content.GetValueForProperty("TrustedCa",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).TrustedCa, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterHttpProxyConfig(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HttpProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).HttpProxy = (string) content.GetValueForProperty("HttpProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).HttpProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpsProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).HttpsProxy = (string) content.GetValueForProperty("HttpsProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).HttpsProxy, global::System.Convert.ToString); + } + if (content.Contains("NoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).NoProxy = (string[]) content.GetValueForProperty("NoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).NoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("EffectiveNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).EffectiveNoProxy = (string[]) content.GetValueForProperty("EffectiveNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).EffectiveNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("TrustedCa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).TrustedCa = (string) content.GetValueForProperty("TrustedCa",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)this).TrustedCa, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Cluster HTTP proxy configuration. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterHttpProxyConfigTypeConverter))] + public partial interface IManagedClusterHttpProxyConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.TypeConverter.cs new file mode 100644 index 000000000000..639093e3dd27 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterHttpProxyConfigTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterHttpProxyConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterHttpProxyConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterHttpProxyConfig.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.cs new file mode 100644 index 000000000000..ab7adc13b431 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Cluster HTTP proxy configuration. + public partial class ManagedClusterHttpProxyConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal + { + + /// Backing field for property. + private string[] _effectiveNoProxy; + + /// + /// A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy + /// and values injected by AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] EffectiveNoProxy { get => this._effectiveNoProxy; } + + /// Backing field for property. + private string _httpProxy; + + /// The HTTP proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string HttpProxy { get => this._httpProxy; set => this._httpProxy = value; } + + /// Backing field for property. + private string _httpsProxy; + + /// The HTTPS proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string HttpsProxy { get => this._httpsProxy; set => this._httpsProxy = value; } + + /// Internal Acessors for EffectiveNoProxy + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal.EffectiveNoProxy { get => this._effectiveNoProxy; set { {_effectiveNoProxy = value;} } } + + /// Backing field for property. + private string[] _noProxy; + + /// The endpoints that should not go through proxy. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] NoProxy { get => this._noProxy; set => this._noProxy = value; } + + /// Backing field for property. + private string _trustedCa; + + /// Alternative CA cert to use for connecting to proxy servers. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string TrustedCa { get => this._trustedCa; set => this._trustedCa = value; } + + /// Creates an new instance. + public ManagedClusterHttpProxyConfig() + { + + } + } + /// Cluster HTTP proxy configuration. + public partial interface IManagedClusterHttpProxyConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy + /// and values injected by AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy and values injected by AKS.", + SerializedName = @"effectiveNoProxy", + PossibleTypes = new [] { typeof(string) })] + string[] EffectiveNoProxy { get; } + /// The HTTP proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP proxy server endpoint to use.", + SerializedName = @"httpProxy", + PossibleTypes = new [] { typeof(string) })] + string HttpProxy { get; set; } + /// The HTTPS proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTPS proxy server endpoint to use.", + SerializedName = @"httpsProxy", + PossibleTypes = new [] { typeof(string) })] + string HttpsProxy { get; set; } + /// The endpoints that should not go through proxy. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The endpoints that should not go through proxy.", + SerializedName = @"noProxy", + PossibleTypes = new [] { typeof(string) })] + string[] NoProxy { get; set; } + /// Alternative CA cert to use for connecting to proxy servers. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alternative CA cert to use for connecting to proxy servers.", + SerializedName = @"trustedCa", + PossibleTypes = new [] { typeof(string) })] + string TrustedCa { get; set; } + + } + /// Cluster HTTP proxy configuration. + internal partial interface IManagedClusterHttpProxyConfigInternal + + { + /// + /// A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy + /// and values injected by AKS. + /// + string[] EffectiveNoProxy { get; set; } + /// The HTTP proxy server endpoint to use. + string HttpProxy { get; set; } + /// The HTTPS proxy server endpoint to use. + string HttpsProxy { get; set; } + /// The endpoints that should not go through proxy. + string[] NoProxy { get; set; } + /// Alternative CA cert to use for connecting to proxy servers. + string TrustedCa { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.json.cs new file mode 100644 index 000000000000..66d709539983 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterHttpProxyConfig.json.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Cluster HTTP proxy configuration. + public partial class ManagedClusterHttpProxyConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterHttpProxyConfig(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterHttpProxyConfig(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_httpProxy = If( json?.PropertyT("httpProxy"), out var __jsonHttpProxy) ? (string)__jsonHttpProxy : (string)HttpProxy;} + {_httpsProxy = If( json?.PropertyT("httpsProxy"), out var __jsonHttpsProxy) ? (string)__jsonHttpsProxy : (string)HttpsProxy;} + {_noProxy = If( json?.PropertyT("noProxy"), out var __jsonNoProxy) ? If( __jsonNoProxy as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : NoProxy;} + {_effectiveNoProxy = If( json?.PropertyT("effectiveNoProxy"), out var __jsonEffectiveNoProxy) ? If( __jsonEffectiveNoProxy as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : EffectiveNoProxy;} + {_trustedCa = If( json?.PropertyT("trustedCa"), out var __jsonTrustedCa) ? (string)__jsonTrustedCa : (string)TrustedCa;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._httpProxy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._httpProxy.ToString()) : null, "httpProxy" ,container.Add ); + AddIf( null != (((object)this._httpsProxy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._httpsProxy.ToString()) : null, "httpsProxy" ,container.Add ); + if (null != this._noProxy) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._noProxy ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("noProxy",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._effectiveNoProxy) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._effectiveNoProxy ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("effectiveNoProxy",__r); + } + } + AddIf( null != (((object)this._trustedCa)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._trustedCa.ToString()) : null, "trustedCa" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.PowerShell.cs new file mode 100644 index 000000000000..e74787156efd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Identity for the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterIdentityTypeConverter))] + public partial class ManagedClusterIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterIdentity(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.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType.CreateFrom); + } + if (content.Contains("DelegatedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).DelegatedResource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources) content.GetValueForProperty("DelegatedResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).DelegatedResource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResourcesTypeConverter.ConvertFrom); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterIdentity(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.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType.CreateFrom); + } + if (content.Contains("DelegatedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).DelegatedResource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources) content.GetValueForProperty("DelegatedResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).DelegatedResource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResourcesTypeConverter.ConvertFrom); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentityUserAssignedIdentitiesTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Identity for the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterIdentityTypeConverter))] + public partial interface IManagedClusterIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.TypeConverter.cs new file mode 100644 index 000000000000..b4e2c83e4a96 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterIdentityTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterIdentity.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.cs new file mode 100644 index 000000000000..2fcea729259d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Identity for the managed cluster. + public partial class ManagedClusterIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources _delegatedResource; + + /// + /// The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, + /// and managed cluster only accept one delegated identity resource. Internal use only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources DelegatedResource { get => (this._delegatedResource = this._delegatedResource ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResources()); set => this._delegatedResource = value; } + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// + /// The principal id of the system assigned identity which is used by master components. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; } + + /// Backing field for property. + private string _tenantId; + + /// + /// The tenant id of the system assigned identity which is used by master components. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType? _type; + + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType? Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities _userAssignedIdentity; + + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } + + /// Creates an new instance. + public ManagedClusterIdentity() + { + + } + } + /// Identity for the managed cluster. + public partial interface IManagedClusterIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, + /// and managed cluster only accept one delegated identity resource. Internal use only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. Internal use only.", + SerializedName = @"delegatedResources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources DelegatedResource { get; set; } + /// + /// The principal id of the system assigned identity which is used by master components. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal id of the system assigned identity which is used by master components.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; } + /// + /// The tenant id of the system assigned identity which is used by master components. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The tenant id of the system assigned identity which is used by master components.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; } + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity).", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType? Type { get; set; } + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } + + } + /// Identity for the managed cluster. + internal partial interface IManagedClusterIdentityInternal + + { + /// + /// The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, + /// and managed cluster only accept one delegated identity resource. Internal use only. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources DelegatedResource { get; set; } + /// + /// The principal id of the system assigned identity which is used by master components. + /// + string PrincipalId { get; set; } + /// + /// The tenant id of the system assigned identity which is used by master components. + /// + string TenantId { get; set; } + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType? Type { get; set; } + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.json.cs new file mode 100644 index 000000000000..c08eb79981e6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentity.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Identity for the managed cluster. + public partial class ManagedClusterIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterIdentity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterIdentity(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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;} + {_delegatedResource = If( json?.PropertyT("delegatedResources"), out var __jsonDelegatedResources) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResources.FromJson(__jsonDelegatedResources) : DelegatedResource;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentityUserAssignedIdentities.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != this._delegatedResource ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._delegatedResource.ToJson(null,serializationMode) : null, "delegatedResources" ,container.Add ); + AddIf( null != this._userAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._userAssignedIdentity.ToJson(null,serializationMode) : null, "userAssignedIdentities" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 000000000000..c773d920cf12 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterIdentityUserAssignedIdentitiesTypeConverter))] + public partial class ManagedClusterIdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterIdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterIdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterIdentityUserAssignedIdentities(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 ManagedClusterIdentityUserAssignedIdentities(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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterIdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IManagedClusterIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 000000000000..6cf24414dea8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterIdentityUserAssignedIdentitiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterIdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterIdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterIdentityUserAssignedIdentities.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.cs new file mode 100644 index 000000000000..643fe41fbb3d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public partial class ManagedClusterIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentitiesInternal + { + + /// + /// Creates an new instance. + /// + public ManagedClusterIdentityUserAssignedIdentities() + { + + } + } + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public partial interface IManagedClusterIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + internal partial interface IManagedClusterIdentityUserAssignedIdentitiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.dictionary.cs new file mode 100644 index 000000000000..b5bd23065cb1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue 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.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIdentityUserAssignedIdentities source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.json.cs new file mode 100644 index 000000000000..7748abd4107b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIdentityUserAssignedIdentities.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public partial class ManagedClusterIdentityUserAssignedIdentities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterIdentityUserAssignedIdentities(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedClusterIdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedServiceIdentityUserAssignedIdentitiesValue.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.PowerShell.cs new file mode 100644 index 000000000000..b626710a5041 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Ingress profile for the container service cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterIngressProfileTypeConverter))] + public partial class ManagedClusterIngressProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterIngressProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterIngressProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterIngressProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("WebAppRouting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRouting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting) content.GetValueForProperty("WebAppRouting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRouting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRoutingTypeConverter.ConvertFrom); + } + if (content.Contains("WebAppRoutingIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("WebAppRoutingIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("WebAppRoutingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingEnabled = (bool?) content.GetValueForProperty("WebAppRoutingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingDnsZoneResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingDnsZoneResourceId = (string[]) content.GetValueForProperty("WebAppRoutingDnsZoneResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingDnsZoneResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityObjectId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterIngressProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("WebAppRouting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRouting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting) content.GetValueForProperty("WebAppRouting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRouting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRoutingTypeConverter.ConvertFrom); + } + if (content.Contains("WebAppRoutingIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("WebAppRoutingIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("WebAppRoutingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingEnabled = (bool?) content.GetValueForProperty("WebAppRoutingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingDnsZoneResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingDnsZoneResourceId = (string[]) content.GetValueForProperty("WebAppRoutingDnsZoneResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).WebAppRoutingDnsZoneResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)this).IdentityObjectId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Ingress profile for the container service cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterIngressProfileTypeConverter))] + public partial interface IManagedClusterIngressProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.TypeConverter.cs new file mode 100644 index 000000000000..dc8ce62699df --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterIngressProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterIngressProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterIngressProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterIngressProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.cs new file mode 100644 index 000000000000..d165b1b4e68a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Ingress profile for the container service cluster. + public partial class ManagedClusterIngressProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal + { + + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).IdentityClientId = value ?? null; } + + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).IdentityObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).IdentityObjectId = value ?? null; } + + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).IdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).IdentityResourceId = value ?? null; } + + /// Internal Acessors for WebAppRouting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal.WebAppRouting { get => (this._webAppRouting = this._webAppRouting ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRouting()); set { {_webAppRouting = value;} } } + + /// Internal Acessors for WebAppRoutingIdentity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal.WebAppRoutingIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).Identity = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting _webAppRouting; + + /// Web App Routing settings for the ingress profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting WebAppRouting { get => (this._webAppRouting = this._webAppRouting ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRouting()); set => this._webAppRouting = value; } + + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] WebAppRoutingDnsZoneResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).DnsZoneResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).DnsZoneResourceId = value ?? null /* arrayOf */; } + + /// Whether to enable Web App Routing. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WebAppRoutingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)WebAppRouting).Enabled = value ?? default(bool); } + + /// Creates an new instance. + public ManagedClusterIngressProfile() + { + + } + } + /// Ingress profile for the container service cluster. + public partial interface IManagedClusterIngressProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client ID of the user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object ID of the user assigned identity.", + SerializedName = @"objectId", + PossibleTypes = new [] { typeof(string) })] + string IdentityObjectId { get; set; } + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the user assigned identity.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string IdentityResourceId { get; set; } + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group.", + SerializedName = @"dnsZoneResourceIds", + PossibleTypes = new [] { typeof(string) })] + string[] WebAppRoutingDnsZoneResourceId { get; set; } + /// Whether to enable Web App Routing. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Web App Routing.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? WebAppRoutingEnabled { get; set; } + + } + /// Ingress profile for the container service cluster. + internal partial interface IManagedClusterIngressProfileInternal + + { + /// The client ID of the user assigned identity. + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + string IdentityObjectId { get; set; } + /// The resource ID of the user assigned identity. + string IdentityResourceId { get; set; } + /// Web App Routing settings for the ingress profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting WebAppRouting { get; set; } + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + string[] WebAppRoutingDnsZoneResourceId { get; set; } + /// Whether to enable Web App Routing. + bool? WebAppRoutingEnabled { get; set; } + /// + /// Managed identity of the Web Application Routing add-on. This is the identity that should be granted permissions, for example, + /// to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) + /// for more instructions. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity WebAppRoutingIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.json.cs new file mode 100644 index 000000000000..45710821958e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfile.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Ingress profile for the container service cluster. + public partial class ManagedClusterIngressProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterIngressProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterIngressProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_webAppRouting = If( json?.PropertyT("webAppRouting"), out var __jsonWebAppRouting) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRouting.FromJson(__jsonWebAppRouting) : WebAppRouting;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._webAppRouting ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._webAppRouting.ToJson(null,serializationMode) : null, "webAppRouting" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.PowerShell.cs new file mode 100644 index 000000000000..b79b5f581e1d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.PowerShell.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Web App Routing settings for the ingress profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterIngressProfileWebAppRoutingTypeConverter))] + public partial class ManagedClusterIngressProfileWebAppRouting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterIngressProfileWebAppRouting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterIngressProfileWebAppRouting(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterIngressProfileWebAppRouting(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.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsZoneResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).DnsZoneResourceId = (string[]) content.GetValueForProperty("DnsZoneResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).DnsZoneResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityObjectId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterIngressProfileWebAppRouting(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.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsZoneResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).DnsZoneResourceId = (string[]) content.GetValueForProperty("DnsZoneResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).DnsZoneResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal)this).IdentityObjectId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Web App Routing settings for the ingress profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterIngressProfileWebAppRoutingTypeConverter))] + public partial interface IManagedClusterIngressProfileWebAppRouting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.TypeConverter.cs new file mode 100644 index 000000000000..4f093c096b6a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterIngressProfileWebAppRoutingTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterIngressProfileWebAppRouting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterIngressProfileWebAppRouting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterIngressProfileWebAppRouting.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.cs new file mode 100644 index 000000000000..626ef50242ce --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Web App Routing settings for the ingress profile. + public partial class ManagedClusterIngressProfileWebAppRouting : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal + { + + /// Backing field for property. + private string[] _dnsZoneResourceId; + + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] DnsZoneResourceId { get => this._dnsZoneResourceId; set => this._dnsZoneResourceId = value; } + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable Web App Routing. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity _identity; + + /// + /// Managed identity of the Web Application Routing add-on. This is the identity that should be granted permissions, for example, + /// to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) + /// for more instructions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity()); } + + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ClientId = value ?? null; } + + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ObjectId = value ?? null; } + + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ResourceId = value ?? null; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRoutingInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity()); set { {_identity = value;} } } + + /// + /// Creates an new instance. + /// + public ManagedClusterIngressProfileWebAppRouting() + { + + } + } + /// Web App Routing settings for the ingress profile. + public partial interface IManagedClusterIngressProfileWebAppRouting : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group.", + SerializedName = @"dnsZoneResourceIds", + PossibleTypes = new [] { typeof(string) })] + string[] DnsZoneResourceId { get; set; } + /// Whether to enable Web App Routing. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Web App Routing.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client ID of the user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object ID of the user assigned identity.", + SerializedName = @"objectId", + PossibleTypes = new [] { typeof(string) })] + string IdentityObjectId { get; set; } + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the user assigned identity.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string IdentityResourceId { get; set; } + + } + /// Web App Routing settings for the ingress profile. + internal partial interface IManagedClusterIngressProfileWebAppRoutingInternal + + { + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + string[] DnsZoneResourceId { get; set; } + /// Whether to enable Web App Routing. + bool? Enabled { get; set; } + /// + /// Managed identity of the Web Application Routing add-on. This is the identity that should be granted permissions, for example, + /// to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) + /// for more instructions. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Identity { get; set; } + /// The client ID of the user assigned identity. + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + string IdentityObjectId { get; set; } + /// The resource ID of the user assigned identity. + string IdentityResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.json.cs new file mode 100644 index 000000000000..a9c2c17c3d15 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterIngressProfileWebAppRouting.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Web App Routing settings for the ingress profile. + public partial class ManagedClusterIngressProfileWebAppRouting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterIngressProfileWebAppRouting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterIngressProfileWebAppRouting(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.UserAssignedIdentity.FromJson(__jsonIdentity) : Identity;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_dnsZoneResourceId = If( json?.PropertyT("dnsZoneResourceIds"), out var __jsonDnsZoneResourceIds) ? If( __jsonDnsZoneResourceIds as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : DnsZoneResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + if (null != this._dnsZoneResourceId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._dnsZoneResourceId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("dnsZoneResourceIds",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.PowerShell.cs new file mode 100644 index 000000000000..c35074d07856 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The response from the List Managed Clusters operation. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterListResultTypeConverter))] + public partial class ManagedClusterListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterListResult(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.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal)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 ManagedClusterListResult(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.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List Managed Clusters operation. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterListResultTypeConverter))] + public partial interface IManagedClusterListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.TypeConverter.cs new file mode 100644 index 000000000000..7b59d6994602 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.cs new file mode 100644 index 000000000000..912fd5b47e66 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Managed Clusters operation. + public partial class ManagedClusterListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next set of managed cluster results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster[] _value; + + /// The list of managed clusters. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ManagedClusterListResult() + { + + } + } + /// The response from the List Managed Clusters operation. + public partial interface IManagedClusterListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next set of managed cluster results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next set of managed cluster results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of managed clusters. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of managed clusters.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster[] Value { get; set; } + + } + /// The response from the List Managed Clusters operation. + internal partial interface IManagedClusterListResultInternal + + { + /// The URL to get the next set of managed cluster results. + string NextLink { get; set; } + /// The list of managed clusters. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.json.cs new file mode 100644 index 000000000000..eea8f644c7b1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Managed Clusters operation. + public partial class ManagedClusterListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedCluster) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedCluster.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.PowerShell.cs new file mode 100644 index 000000000000..8a0e9df4dc12 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Profile of the managed cluster load balancer. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterLoadBalancerProfileTypeConverter))] + public partial class ManagedClusterLoadBalancerProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterLoadBalancerProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterLoadBalancerProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterLoadBalancerProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagedOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs) content.GetValueForProperty("ManagedOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIP, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileManagedOutboundIPsTypeConverter.ConvertFrom); + } + if (content.Contains("OutboundIPPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPrefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes) content.GetValueForProperty("OutboundIPPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPrefix, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPPrefixesTypeConverter.ConvertFrom); + } + if (content.Contains("OutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs) content.GetValueForProperty("OutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIP, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPsTypeConverter.ConvertFrom); + } + if (content.Contains("EffectiveOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).EffectiveOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("EffectiveOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).EffectiveOutboundIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("AllocatedOutboundPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).AllocatedOutboundPort = (int?) content.GetValueForProperty("AllocatedOutboundPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).AllocatedOutboundPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IdleTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnableMultipleStandardLoadBalancer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).EnableMultipleStandardLoadBalancer = (bool?) content.GetValueForProperty("EnableMultipleStandardLoadBalancer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).EnableMultipleStandardLoadBalancer, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BackendPoolType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).BackendPoolType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType?) content.GetValueForProperty("BackendPoolType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).BackendPoolType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType.CreateFrom); + } + if (content.Contains("ClusterServiceLoadBalancerHealthProbeMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ClusterServiceLoadBalancerHealthProbeMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode?) content.GetValueForProperty("ClusterServiceLoadBalancerHealthProbeMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ClusterServiceLoadBalancerHealthProbeMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode.CreateFrom); + } + if (content.Contains("ManagedOutboundIPCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIPCount = (int?) content.GetValueForProperty("ManagedOutboundIPCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIPCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagedOutboundIPCountIpv6")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIPCountIpv6 = (int?) content.GetValueForProperty("ManagedOutboundIPCountIpv6",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIPCountIpv6, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OutboundIPPrefixPublicIpprefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPrefixPublicIpprefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("OutboundIPPrefixPublicIpprefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPrefixPublicIpprefix, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("OutboundIPPublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPublicIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("OutboundIPPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPublicIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterLoadBalancerProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagedOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs) content.GetValueForProperty("ManagedOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIP, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileManagedOutboundIPsTypeConverter.ConvertFrom); + } + if (content.Contains("OutboundIPPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPrefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes) content.GetValueForProperty("OutboundIPPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPrefix, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPPrefixesTypeConverter.ConvertFrom); + } + if (content.Contains("OutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs) content.GetValueForProperty("OutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIP, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPsTypeConverter.ConvertFrom); + } + if (content.Contains("EffectiveOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).EffectiveOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("EffectiveOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).EffectiveOutboundIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("AllocatedOutboundPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).AllocatedOutboundPort = (int?) content.GetValueForProperty("AllocatedOutboundPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).AllocatedOutboundPort, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("IdleTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnableMultipleStandardLoadBalancer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).EnableMultipleStandardLoadBalancer = (bool?) content.GetValueForProperty("EnableMultipleStandardLoadBalancer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).EnableMultipleStandardLoadBalancer, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BackendPoolType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).BackendPoolType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType?) content.GetValueForProperty("BackendPoolType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).BackendPoolType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType.CreateFrom); + } + if (content.Contains("ClusterServiceLoadBalancerHealthProbeMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ClusterServiceLoadBalancerHealthProbeMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode?) content.GetValueForProperty("ClusterServiceLoadBalancerHealthProbeMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ClusterServiceLoadBalancerHealthProbeMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode.CreateFrom); + } + if (content.Contains("ManagedOutboundIPCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIPCount = (int?) content.GetValueForProperty("ManagedOutboundIPCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIPCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagedOutboundIPCountIpv6")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIPCountIpv6 = (int?) content.GetValueForProperty("ManagedOutboundIPCountIpv6",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).ManagedOutboundIPCountIpv6, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("OutboundIPPrefixPublicIpprefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPrefixPublicIpprefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("OutboundIPPrefixPublicIpprefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPrefixPublicIpprefix, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("OutboundIPPublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPublicIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("OutboundIPPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal)this).OutboundIPPublicIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Profile of the managed cluster load balancer. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterLoadBalancerProfileTypeConverter))] + public partial interface IManagedClusterLoadBalancerProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.TypeConverter.cs new file mode 100644 index 000000000000..6756b190bd42 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterLoadBalancerProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterLoadBalancerProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterLoadBalancerProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterLoadBalancerProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.cs new file mode 100644 index 000000000000..46f3187d4d6b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.cs @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of the managed cluster load balancer. + public partial class ManagedClusterLoadBalancerProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal + { + + /// Backing field for property. + private int? _allocatedOutboundPort; + + /// + /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default + /// value is 0 which results in Azure dynamically allocating ports. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? AllocatedOutboundPort { get => this._allocatedOutboundPort; set => this._allocatedOutboundPort = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType? _backendPoolType; + + /// The type of the managed inbound Load Balancer BackendPool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType? BackendPoolType { get => this._backendPoolType; set => this._backendPoolType = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode? _clusterServiceLoadBalancerHealthProbeMode; + + /// The health probing behavior for External Traffic Policy Cluster services. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode? ClusterServiceLoadBalancerHealthProbeMode { get => this._clusterServiceLoadBalancerHealthProbeMode; set => this._clusterServiceLoadBalancerHealthProbeMode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] _effectiveOutboundIP; + + /// The effective outbound IP resources of the cluster load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] EffectiveOutboundIP { get => this._effectiveOutboundIP; set => this._effectiveOutboundIP = value; } + + /// Backing field for property. + private bool? _enableMultipleStandardLoadBalancer; + + /// Enable multiple standard load balancers per AKS cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableMultipleStandardLoadBalancer { get => this._enableMultipleStandardLoadBalancer; set => this._enableMultipleStandardLoadBalancer = value; } + + /// Backing field for property. + private int? _idleTimeoutInMinute; + + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? IdleTimeoutInMinute { get => this._idleTimeoutInMinute; set => this._idleTimeoutInMinute = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs _managedOutboundIP; + + /// Desired managed outbound IPs for the cluster load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs ManagedOutboundIP { get => (this._managedOutboundIP = this._managedOutboundIP ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileManagedOutboundIPs()); set => this._managedOutboundIP = value; } + + /// + /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ManagedOutboundIPCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)ManagedOutboundIP).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)ManagedOutboundIP).Count = value ?? default(int); } + + /// + /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ManagedOutboundIPCountIpv6 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)ManagedOutboundIP).CountIPv6; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)ManagedOutboundIP).CountIPv6 = value ?? default(int); } + + /// Internal Acessors for ManagedOutboundIP + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal.ManagedOutboundIP { get => (this._managedOutboundIP = this._managedOutboundIP ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileManagedOutboundIPs()); set { {_managedOutboundIP = value;} } } + + /// Internal Acessors for OutboundIP + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal.OutboundIP { get => (this._outboundIP = this._outboundIP ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPs()); set { {_outboundIP = value;} } } + + /// Internal Acessors for OutboundIPPrefix + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileInternal.OutboundIPPrefix { get => (this._outboundIPPrefix = this._outboundIPPrefix ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPPrefixes()); set { {_outboundIPPrefix = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs _outboundIP; + + /// Desired outbound IP resources for the cluster load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs OutboundIP { get => (this._outboundIP = this._outboundIP ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPs()); set => this._outboundIP = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes _outboundIPPrefix; + + /// Desired outbound IP Prefix resources for the cluster load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes OutboundIPPrefix { get => (this._outboundIPPrefix = this._outboundIPPrefix ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPPrefixes()); set => this._outboundIPPrefix = value; } + + /// A list of public IP prefix resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPrefixPublicIpprefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixesInternal)OutboundIPPrefix).PublicIPPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixesInternal)OutboundIPPrefix).PublicIPPrefix = value ?? null /* arrayOf */; } + + /// A list of public IP resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPublicIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPsInternal)OutboundIP).PublicIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPsInternal)OutboundIP).PublicIP = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public ManagedClusterLoadBalancerProfile() + { + + } + } + /// Profile of the managed cluster load balancer. + public partial interface IManagedClusterLoadBalancerProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default + /// value is 0 which results in Azure dynamically allocating ports. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports.", + SerializedName = @"allocatedOutboundPorts", + PossibleTypes = new [] { typeof(int) })] + int? AllocatedOutboundPort { get; set; } + /// The type of the managed inbound Load Balancer BackendPool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the managed inbound Load Balancer BackendPool.", + SerializedName = @"backendPoolType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType? BackendPoolType { get; set; } + /// The health probing behavior for External Traffic Policy Cluster services. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The health probing behavior for External Traffic Policy Cluster services.", + SerializedName = @"clusterServiceLoadBalancerHealthProbeMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode? ClusterServiceLoadBalancerHealthProbeMode { get; set; } + /// The effective outbound IP resources of the cluster load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The effective outbound IP resources of the cluster load balancer.", + SerializedName = @"effectiveOutboundIPs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] EffectiveOutboundIP { get; set; } + /// Enable multiple standard load balancers per AKS cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable multiple standard load balancers per AKS cluster or not.", + SerializedName = @"enableMultipleStandardLoadBalancers", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableMultipleStandardLoadBalancer { get; set; } + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 30 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes.", + SerializedName = @"idleTimeoutInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? IdleTimeoutInMinute { get; set; } + /// + /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. ", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? ManagedOutboundIPCount { get; set; } + /// + /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. ", + SerializedName = @"countIPv6", + PossibleTypes = new [] { typeof(int) })] + int? ManagedOutboundIPCountIpv6 { get; set; } + /// A list of public IP prefix resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of public IP prefix resources.", + SerializedName = @"publicIPPrefixes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPrefixPublicIpprefix { get; set; } + /// A list of public IP resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of public IP resources.", + SerializedName = @"publicIPs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPublicIP { get; set; } + + } + /// Profile of the managed cluster load balancer. + internal partial interface IManagedClusterLoadBalancerProfileInternal + + { + /// + /// The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default + /// value is 0 which results in Azure dynamically allocating ports. + /// + int? AllocatedOutboundPort { get; set; } + /// The type of the managed inbound Load Balancer BackendPool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType? BackendPoolType { get; set; } + /// The health probing behavior for External Traffic Policy Cluster services. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode? ClusterServiceLoadBalancerHealthProbeMode { get; set; } + /// The effective outbound IP resources of the cluster load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] EffectiveOutboundIP { get; set; } + /// Enable multiple standard load balancers per AKS cluster or not. + bool? EnableMultipleStandardLoadBalancer { get; set; } + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 30 minutes. + /// + int? IdleTimeoutInMinute { get; set; } + /// Desired managed outbound IPs for the cluster load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs ManagedOutboundIP { get; set; } + /// + /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 1. + /// + int? ManagedOutboundIPCount { get; set; } + /// + /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + /// + int? ManagedOutboundIPCountIpv6 { get; set; } + /// Desired outbound IP resources for the cluster load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs OutboundIP { get; set; } + /// Desired outbound IP Prefix resources for the cluster load balancer. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes OutboundIPPrefix { get; set; } + /// A list of public IP prefix resources. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPrefixPublicIpprefix { get; set; } + /// A list of public IP resources. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] OutboundIPPublicIP { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.json.cs new file mode 100644 index 000000000000..a7b8cfa6291b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of the managed cluster load balancer. + public partial class ManagedClusterLoadBalancerProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterLoadBalancerProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterLoadBalancerProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_managedOutboundIP = If( json?.PropertyT("managedOutboundIPs"), out var __jsonManagedOutboundIPs) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileManagedOutboundIPs.FromJson(__jsonManagedOutboundIPs) : ManagedOutboundIP;} + {_outboundIPPrefix = If( json?.PropertyT("outboundIPPrefixes"), out var __jsonOutboundIPPrefixes) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPPrefixes.FromJson(__jsonOutboundIPPrefixes) : OutboundIPPrefix;} + {_outboundIP = If( json?.PropertyT("outboundIPs"), out var __jsonOutboundIPs) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterLoadBalancerProfileOutboundIPs.FromJson(__jsonOutboundIPs) : OutboundIP;} + {_effectiveOutboundIP = If( json?.PropertyT("effectiveOutboundIPs"), out var __jsonEffectiveOutboundIPs) ? If( __jsonEffectiveOutboundIPs as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IResourceReference) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReference.FromJson(__u) )) ))() : null : EffectiveOutboundIP;} + {_allocatedOutboundPort = If( json?.PropertyT("allocatedOutboundPorts"), out var __jsonAllocatedOutboundPorts) ? (int?)__jsonAllocatedOutboundPorts : AllocatedOutboundPort;} + {_idleTimeoutInMinute = If( json?.PropertyT("idleTimeoutInMinutes"), out var __jsonIdleTimeoutInMinutes) ? (int?)__jsonIdleTimeoutInMinutes : IdleTimeoutInMinute;} + {_enableMultipleStandardLoadBalancer = If( json?.PropertyT("enableMultipleStandardLoadBalancers"), out var __jsonEnableMultipleStandardLoadBalancers) ? (bool?)__jsonEnableMultipleStandardLoadBalancers : EnableMultipleStandardLoadBalancer;} + {_backendPoolType = If( json?.PropertyT("backendPoolType"), out var __jsonBackendPoolType) ? (string)__jsonBackendPoolType : (string)BackendPoolType;} + {_clusterServiceLoadBalancerHealthProbeMode = If( json?.PropertyT("clusterServiceLoadBalancerHealthProbeMode"), out var __jsonClusterServiceLoadBalancerHealthProbeMode) ? (string)__jsonClusterServiceLoadBalancerHealthProbeMode : (string)ClusterServiceLoadBalancerHealthProbeMode;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._managedOutboundIP ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._managedOutboundIP.ToJson(null,serializationMode) : null, "managedOutboundIPs" ,container.Add ); + AddIf( null != this._outboundIPPrefix ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._outboundIPPrefix.ToJson(null,serializationMode) : null, "outboundIPPrefixes" ,container.Add ); + AddIf( null != this._outboundIP ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._outboundIP.ToJson(null,serializationMode) : null, "outboundIPs" ,container.Add ); + if (null != this._effectiveOutboundIP) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._effectiveOutboundIP ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("effectiveOutboundIPs",__w); + } + AddIf( null != this._allocatedOutboundPort ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._allocatedOutboundPort) : null, "allocatedOutboundPorts" ,container.Add ); + AddIf( null != this._idleTimeoutInMinute ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._idleTimeoutInMinute) : null, "idleTimeoutInMinutes" ,container.Add ); + AddIf( null != this._enableMultipleStandardLoadBalancer ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableMultipleStandardLoadBalancer) : null, "enableMultipleStandardLoadBalancers" ,container.Add ); + AddIf( null != (((object)this._backendPoolType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._backendPoolType.ToString()) : null, "backendPoolType" ,container.Add ); + AddIf( null != (((object)this._clusterServiceLoadBalancerHealthProbeMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._clusterServiceLoadBalancerHealthProbeMode.ToString()) : null, "clusterServiceLoadBalancerHealthProbeMode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.PowerShell.cs new file mode 100644 index 000000000000..d85129e7b7cf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.PowerShell.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Desired managed outbound IPs for the cluster load balancer. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterLoadBalancerProfileManagedOutboundIPsTypeConverter))] + public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterLoadBalancerProfileManagedOutboundIPs(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterLoadBalancerProfileManagedOutboundIPs(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterLoadBalancerProfileManagedOutboundIPs(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CountIPv6")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)this).CountIPv6 = (int?) content.GetValueForProperty("CountIPv6",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)this).CountIPv6, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterLoadBalancerProfileManagedOutboundIPs(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CountIPv6")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)this).CountIPv6 = (int?) content.GetValueForProperty("CountIPv6",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal)this).CountIPv6, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Desired managed outbound IPs for the cluster load balancer. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterLoadBalancerProfileManagedOutboundIPsTypeConverter))] + public partial interface IManagedClusterLoadBalancerProfileManagedOutboundIPs + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.TypeConverter.cs new file mode 100644 index 000000000000..bac7cffe9af8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterLoadBalancerProfileManagedOutboundIPs.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterLoadBalancerProfileManagedOutboundIPs.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterLoadBalancerProfileManagedOutboundIPs.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs new file mode 100644 index 000000000000..dec38639a679 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Desired managed outbound IPs for the cluster load balancer. + public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal + { + + /// Backing field for property. + private int? _count; + + /// + /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private int? _countIPv6; + + /// + /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? CountIPv6 { get => this._countIPv6; set => this._countIPv6 = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterLoadBalancerProfileManagedOutboundIPs() + { + + } + } + /// Desired managed outbound IPs for the cluster load balancer. + public partial interface IManagedClusterLoadBalancerProfileManagedOutboundIPs : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. ", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? Count { get; set; } + /// + /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. ", + SerializedName = @"countIPv6", + PossibleTypes = new [] { typeof(int) })] + int? CountIPv6 { get; set; } + + } + /// Desired managed outbound IPs for the cluster load balancer. + internal partial interface IManagedClusterLoadBalancerProfileManagedOutboundIPsInternal + + { + /// + /// The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 1. + /// + int? Count { get; set; } + /// + /// The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be + /// in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + /// + int? CountIPv6 { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.json.cs new file mode 100644 index 000000000000..816d75fe6e30 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileManagedOutboundIPs.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Desired managed outbound IPs for the cluster load balancer. + public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileManagedOutboundIPs FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterLoadBalancerProfileManagedOutboundIPs(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterLoadBalancerProfileManagedOutboundIPs(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (int?)__jsonCount : Count;} + {_countIPv6 = If( json?.PropertyT("countIPv6"), out var __jsonCountIPv6) ? (int?)__jsonCountIPv6 : CountIPv6;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._count) : null, "count" ,container.Add ); + AddIf( null != this._countIPv6 ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._countIPv6) : null, "countIPv6" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.PowerShell.cs new file mode 100644 index 000000000000..1d72d7415c91 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Desired outbound IP Prefix resources for the cluster load balancer. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterLoadBalancerProfileOutboundIPPrefixesTypeConverter))] + public partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterLoadBalancerProfileOutboundIPPrefixes(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterLoadBalancerProfileOutboundIPPrefixes(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterLoadBalancerProfileOutboundIPPrefixes(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicIPPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixesInternal)this).PublicIPPrefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("PublicIPPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixesInternal)this).PublicIPPrefix, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterLoadBalancerProfileOutboundIPPrefixes(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicIPPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixesInternal)this).PublicIPPrefix = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("PublicIPPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixesInternal)this).PublicIPPrefix, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Desired outbound IP Prefix resources for the cluster load balancer. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterLoadBalancerProfileOutboundIPPrefixesTypeConverter))] + public partial interface IManagedClusterLoadBalancerProfileOutboundIPPrefixes + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.TypeConverter.cs new file mode 100644 index 000000000000..624acce4c658 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterLoadBalancerProfileOutboundIPPrefixes.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterLoadBalancerProfileOutboundIPPrefixes.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterLoadBalancerProfileOutboundIPPrefixes.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs new file mode 100644 index 000000000000..e4c67f5d20b2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Desired outbound IP Prefix resources for the cluster load balancer. + public partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] _publicIPPrefix; + + /// A list of public IP prefix resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] PublicIPPrefix { get => this._publicIPPrefix; set => this._publicIPPrefix = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes() + { + + } + } + /// Desired outbound IP Prefix resources for the cluster load balancer. + public partial interface IManagedClusterLoadBalancerProfileOutboundIPPrefixes : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// A list of public IP prefix resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of public IP prefix resources.", + SerializedName = @"publicIPPrefixes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] PublicIPPrefix { get; set; } + + } + /// Desired outbound IP Prefix resources for the cluster load balancer. + internal partial interface IManagedClusterLoadBalancerProfileOutboundIPPrefixesInternal + + { + /// A list of public IP prefix resources. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] PublicIPPrefix { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.json.cs new file mode 100644 index 000000000000..a8525a2b7c90 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Desired outbound IP Prefix resources for the cluster load balancer. + public partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPPrefixes FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterLoadBalancerProfileOutboundIPPrefixes(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterLoadBalancerProfileOutboundIPPrefixes(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_publicIPPrefix = If( json?.PropertyT("publicIPPrefixes"), out var __jsonPublicIPPrefixes) ? If( __jsonPublicIPPrefixes as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IResourceReference) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReference.FromJson(__u) )) ))() : null : PublicIPPrefix;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._publicIPPrefix) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._publicIPPrefix ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("publicIPPrefixes",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.PowerShell.cs new file mode 100644 index 000000000000..d92fe33499e6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Desired outbound IP resources for the cluster load balancer. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterLoadBalancerProfileOutboundIPsTypeConverter))] + public partial class ManagedClusterLoadBalancerProfileOutboundIPs + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterLoadBalancerProfileOutboundIPs(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterLoadBalancerProfileOutboundIPs(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterLoadBalancerProfileOutboundIPs(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPsInternal)this).PublicIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("PublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPsInternal)this).PublicIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterLoadBalancerProfileOutboundIPs(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PublicIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPsInternal)this).PublicIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("PublicIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPsInternal)this).PublicIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Desired outbound IP resources for the cluster load balancer. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterLoadBalancerProfileOutboundIPsTypeConverter))] + public partial interface IManagedClusterLoadBalancerProfileOutboundIPs + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.TypeConverter.cs new file mode 100644 index 000000000000..757aa975af48 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterLoadBalancerProfileOutboundIPsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterLoadBalancerProfileOutboundIPs.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterLoadBalancerProfileOutboundIPs.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterLoadBalancerProfileOutboundIPs.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.cs new file mode 100644 index 000000000000..e0c8175bf6d7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Desired outbound IP resources for the cluster load balancer. + public partial class ManagedClusterLoadBalancerProfileOutboundIPs : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] _publicIP; + + /// A list of public IP resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] PublicIP { get => this._publicIP; set => this._publicIP = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterLoadBalancerProfileOutboundIPs() + { + + } + } + /// Desired outbound IP resources for the cluster load balancer. + public partial interface IManagedClusterLoadBalancerProfileOutboundIPs : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// A list of public IP resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of public IP resources.", + SerializedName = @"publicIPs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] PublicIP { get; set; } + + } + /// Desired outbound IP resources for the cluster load balancer. + internal partial interface IManagedClusterLoadBalancerProfileOutboundIPsInternal + + { + /// A list of public IP resources. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] PublicIP { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.json.cs new file mode 100644 index 000000000000..de91a699814f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterLoadBalancerProfileOutboundIPs.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Desired outbound IP resources for the cluster load balancer. + public partial class ManagedClusterLoadBalancerProfileOutboundIPs + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterLoadBalancerProfileOutboundIPs FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterLoadBalancerProfileOutboundIPs(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterLoadBalancerProfileOutboundIPs(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_publicIP = If( json?.PropertyT("publicIPs"), out var __jsonPublicIPs) ? If( __jsonPublicIPs as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IResourceReference) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReference.FromJson(__u) )) ))() : null : PublicIP;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._publicIP) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._publicIP ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("publicIPs",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.PowerShell.cs new file mode 100644 index 000000000000..c0a10f228d09 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Profile of the managed outbound IP resources of the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterManagedOutboundIPProfileTypeConverter))] + public partial class ManagedClusterManagedOutboundIPProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterManagedOutboundIPProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterManagedOutboundIPProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterManagedOutboundIPProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfileInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfileInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterManagedOutboundIPProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfileInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfileInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Profile of the managed outbound IP resources of the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterManagedOutboundIPProfileTypeConverter))] + public partial interface IManagedClusterManagedOutboundIPProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.TypeConverter.cs new file mode 100644 index 000000000000..ffff6627d5c6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterManagedOutboundIPProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterManagedOutboundIPProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterManagedOutboundIPProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterManagedOutboundIPProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.cs new file mode 100644 index 000000000000..b355c8c389f2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of the managed outbound IP resources of the managed cluster. + public partial class ManagedClusterManagedOutboundIPProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfileInternal + { + + /// Backing field for property. + private int? _count; + + /// + /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). + /// The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? Count { get => this._count; set => this._count = value; } + + /// Creates an new instance. + public ManagedClusterManagedOutboundIPProfile() + { + + } + } + /// Profile of the managed outbound IP resources of the managed cluster. + public partial interface IManagedClusterManagedOutboundIPProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). + /// The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. ", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? Count { get; set; } + + } + /// Profile of the managed outbound IP resources of the managed cluster. + internal partial interface IManagedClusterManagedOutboundIPProfileInternal + + { + /// + /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). + /// The default value is 1. + /// + int? Count { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.json.cs new file mode 100644 index 000000000000..aaaea6e5f796 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterManagedOutboundIPProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of the managed outbound IP resources of the managed cluster. + public partial class ManagedClusterManagedOutboundIPProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterManagedOutboundIPProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterManagedOutboundIPProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (int?)__jsonCount : Count;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._count) : null, "count" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.PowerShell.cs new file mode 100644 index 000000000000..fd78d9337919 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The metrics profile for the ManagedCluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterMetricsProfileTypeConverter))] + public partial class ManagedClusterMetricsProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterMetricsProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterMetricsProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterMetricsProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CostAnalysis")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)this).CostAnalysis = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis) content.GetValueForProperty("CostAnalysis",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)this).CostAnalysis, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysisTypeConverter.ConvertFrom); + } + if (content.Contains("CostAnalysisEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)this).CostAnalysisEnabled = (bool?) content.GetValueForProperty("CostAnalysisEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)this).CostAnalysisEnabled, (__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 ManagedClusterMetricsProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CostAnalysis")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)this).CostAnalysis = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis) content.GetValueForProperty("CostAnalysis",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)this).CostAnalysis, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysisTypeConverter.ConvertFrom); + } + if (content.Contains("CostAnalysisEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)this).CostAnalysisEnabled = (bool?) content.GetValueForProperty("CostAnalysisEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)this).CostAnalysisEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The metrics profile for the ManagedCluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterMetricsProfileTypeConverter))] + public partial interface IManagedClusterMetricsProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.TypeConverter.cs new file mode 100644 index 000000000000..d0cffe36ff46 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterMetricsProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterMetricsProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterMetricsProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterMetricsProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.cs new file mode 100644 index 000000000000..2f2c57090dd2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The metrics profile for the ManagedCluster. + public partial class ManagedClusterMetricsProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis _costAnalysis; + + /// The cost analysis configuration for the cluster + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis CostAnalysis { get => (this._costAnalysis = this._costAnalysis ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysis()); set => this._costAnalysis = value; } + + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? CostAnalysisEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysisInternal)CostAnalysis).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysisInternal)CostAnalysis).Enabled = value ?? default(bool); } + + /// Internal Acessors for CostAnalysis + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal.CostAnalysis { get => (this._costAnalysis = this._costAnalysis ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysis()); set { {_costAnalysis = value;} } } + + /// Creates an new instance. + public ManagedClusterMetricsProfile() + { + + } + } + /// The metrics profile for the ManagedCluster. + public partial interface IManagedClusterMetricsProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? CostAnalysisEnabled { get; set; } + + } + /// The metrics profile for the ManagedCluster. + internal partial interface IManagedClusterMetricsProfileInternal + + { + /// The cost analysis configuration for the cluster + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis CostAnalysis { get; set; } + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + bool? CostAnalysisEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.json.cs new file mode 100644 index 000000000000..9143f496756f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterMetricsProfile.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The metrics profile for the ManagedCluster. + public partial class ManagedClusterMetricsProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterMetricsProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterMetricsProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_costAnalysis = If( json?.PropertyT("costAnalysis"), out var __jsonCostAnalysis) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysis.FromJson(__jsonCostAnalysis) : CostAnalysis;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._costAnalysis ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._costAnalysis.ToJson(null,serializationMode) : null, "costAnalysis" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.PowerShell.cs new file mode 100644 index 000000000000..8d54a9edeef6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Profile of the managed cluster NAT gateway. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterNatGatewayProfileTypeConverter))] + public partial class ManagedClusterNatGatewayProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterNatGatewayProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterNatGatewayProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterNatGatewayProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagedOutboundIPProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).ManagedOutboundIPProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile) content.GetValueForProperty("ManagedOutboundIPProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).ManagedOutboundIPProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterManagedOutboundIPProfileTypeConverter.ConvertFrom); + } + if (content.Contains("EffectiveOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).EffectiveOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("EffectiveOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).EffectiveOutboundIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("IdleTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagedOutboundIPProfileCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).ManagedOutboundIPProfileCount = (int?) content.GetValueForProperty("ManagedOutboundIPProfileCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).ManagedOutboundIPProfileCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterNatGatewayProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagedOutboundIPProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).ManagedOutboundIPProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile) content.GetValueForProperty("ManagedOutboundIPProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).ManagedOutboundIPProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterManagedOutboundIPProfileTypeConverter.ConvertFrom); + } + if (content.Contains("EffectiveOutboundIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).EffectiveOutboundIP = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[]) content.GetValueForProperty("EffectiveOutboundIP",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).EffectiveOutboundIP, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReferenceTypeConverter.ConvertFrom)); + } + if (content.Contains("IdleTimeoutInMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).IdleTimeoutInMinute = (int?) content.GetValueForProperty("IdleTimeoutInMinute",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).IdleTimeoutInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagedOutboundIPProfileCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).ManagedOutboundIPProfileCount = (int?) content.GetValueForProperty("ManagedOutboundIPProfileCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal)this).ManagedOutboundIPProfileCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Profile of the managed cluster NAT gateway. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterNatGatewayProfileTypeConverter))] + public partial interface IManagedClusterNatGatewayProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.TypeConverter.cs new file mode 100644 index 000000000000..a7290edd36f7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterNatGatewayProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterNatGatewayProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterNatGatewayProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterNatGatewayProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.cs new file mode 100644 index 000000000000..8541d18f864f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of the managed cluster NAT gateway. + public partial class ManagedClusterNatGatewayProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] _effectiveOutboundIP; + + /// The effective outbound IP resources of the cluster NAT gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] EffectiveOutboundIP { get => this._effectiveOutboundIP; set => this._effectiveOutboundIP = value; } + + /// Backing field for property. + private int? _idleTimeoutInMinute; + + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 4 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? IdleTimeoutInMinute { get => this._idleTimeoutInMinute; set => this._idleTimeoutInMinute = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile _managedOutboundIPProfile; + + /// Profile of the managed outbound IP resources of the cluster NAT gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile ManagedOutboundIPProfile { get => (this._managedOutboundIPProfile = this._managedOutboundIPProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterManagedOutboundIPProfile()); set => this._managedOutboundIPProfile = value; } + + /// + /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). + /// The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ManagedOutboundIPProfileCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfileInternal)ManagedOutboundIPProfile).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfileInternal)ManagedOutboundIPProfile).Count = value ?? default(int); } + + /// Internal Acessors for ManagedOutboundIPProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfileInternal.ManagedOutboundIPProfile { get => (this._managedOutboundIPProfile = this._managedOutboundIPProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterManagedOutboundIPProfile()); set { {_managedOutboundIPProfile = value;} } } + + /// Creates an new instance. + public ManagedClusterNatGatewayProfile() + { + + } + } + /// Profile of the managed cluster NAT gateway. + public partial interface IManagedClusterNatGatewayProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The effective outbound IP resources of the cluster NAT gateway. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The effective outbound IP resources of the cluster NAT gateway.", + SerializedName = @"effectiveOutboundIPs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] EffectiveOutboundIP { get; set; } + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 4 minutes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes.", + SerializedName = @"idleTimeoutInMinutes", + PossibleTypes = new [] { typeof(int) })] + int? IdleTimeoutInMinute { get; set; } + /// + /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). + /// The default value is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. ", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? ManagedOutboundIPProfileCount { get; set; } + + } + /// Profile of the managed cluster NAT gateway. + internal partial interface IManagedClusterNatGatewayProfileInternal + + { + /// The effective outbound IP resources of the cluster NAT gateway. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference[] EffectiveOutboundIP { get; set; } + /// + /// Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value + /// is 4 minutes. + /// + int? IdleTimeoutInMinute { get; set; } + /// Profile of the managed outbound IP resources of the cluster NAT gateway. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterManagedOutboundIPProfile ManagedOutboundIPProfile { get; set; } + /// + /// The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). + /// The default value is 1. + /// + int? ManagedOutboundIPProfileCount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.json.cs new file mode 100644 index 000000000000..7c3530f5a6f6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNatGatewayProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile of the managed cluster NAT gateway. + public partial class ManagedClusterNatGatewayProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNatGatewayProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterNatGatewayProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterNatGatewayProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_managedOutboundIPProfile = If( json?.PropertyT("managedOutboundIPProfile"), out var __jsonManagedOutboundIPProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterManagedOutboundIPProfile.FromJson(__jsonManagedOutboundIPProfile) : ManagedOutboundIPProfile;} + {_effectiveOutboundIP = If( json?.PropertyT("effectiveOutboundIPs"), out var __jsonEffectiveOutboundIPs) ? If( __jsonEffectiveOutboundIPs as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IResourceReference) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ResourceReference.FromJson(__u) )) ))() : null : EffectiveOutboundIP;} + {_idleTimeoutInMinute = If( json?.PropertyT("idleTimeoutInMinutes"), out var __jsonIdleTimeoutInMinutes) ? (int?)__jsonIdleTimeoutInMinutes : IdleTimeoutInMinute;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._managedOutboundIPProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._managedOutboundIPProfile.ToJson(null,serializationMode) : null, "managedOutboundIPProfile" ,container.Add ); + if (null != this._effectiveOutboundIP) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._effectiveOutboundIP ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("effectiveOutboundIPs",__w); + } + AddIf( null != this._idleTimeoutInMinute ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._idleTimeoutInMinute) : null, "idleTimeoutInMinutes" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.PowerShell.cs new file mode 100644 index 000000000000..3d2fca155afb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClusterNodeProvisioningProfileTypeConverter))] + public partial class ManagedClusterNodeProvisioningProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterNodeProvisioningProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterNodeProvisioningProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterNodeProvisioningProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfileInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfileInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterNodeProvisioningProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfileInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfileInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClusterNodeProvisioningProfileTypeConverter))] + public partial interface IManagedClusterNodeProvisioningProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.TypeConverter.cs new file mode 100644 index 000000000000..655d5fb7e01f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterNodeProvisioningProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterNodeProvisioningProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterNodeProvisioningProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterNodeProvisioningProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.cs new file mode 100644 index 000000000000..f49028580e68 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterNodeProvisioningProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? _mode; + + /// Once the mode it set to Auto, it cannot be changed back to Manual. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? Mode { get => this._mode; set => this._mode = value; } + + /// Creates an new instance. + public ManagedClusterNodeProvisioningProfile() + { + + } + } + public partial interface IManagedClusterNodeProvisioningProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Once the mode it set to Auto, it cannot be changed back to Manual. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Once the mode it set to Auto, it cannot be changed back to Manual.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? Mode { get; set; } + + } + internal partial interface IManagedClusterNodeProvisioningProfileInternal + + { + /// Once the mode it set to Auto, it cannot be changed back to Manual. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? Mode { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.json.cs new file mode 100644 index 000000000000..d7ff760af1ab --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeProvisioningProfile.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterNodeProvisioningProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterNodeProvisioningProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterNodeProvisioningProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.PowerShell.cs new file mode 100644 index 000000000000..639bbe9fe386 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Node resource group lockdown profile for a managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterNodeResourceGroupProfileTypeConverter))] + public partial class ManagedClusterNodeResourceGroupProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterNodeResourceGroupProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterNodeResourceGroupProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterNodeResourceGroupProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RestrictionLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfileInternal)this).RestrictionLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel?) content.GetValueForProperty("RestrictionLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfileInternal)this).RestrictionLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterNodeResourceGroupProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RestrictionLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfileInternal)this).RestrictionLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel?) content.GetValueForProperty("RestrictionLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfileInternal)this).RestrictionLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Node resource group lockdown profile for a managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterNodeResourceGroupProfileTypeConverter))] + public partial interface IManagedClusterNodeResourceGroupProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.TypeConverter.cs new file mode 100644 index 000000000000..cc0ee6ca679d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterNodeResourceGroupProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterNodeResourceGroupProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterNodeResourceGroupProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterNodeResourceGroupProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.cs new file mode 100644 index 000000000000..332cb2e91a98 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Node resource group lockdown profile for a managed cluster. + public partial class ManagedClusterNodeResourceGroupProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? _restrictionLevel; + + /// The restriction level applied to the cluster's node resource group + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? RestrictionLevel { get => this._restrictionLevel; set => this._restrictionLevel = value; } + + /// Creates an new instance. + public ManagedClusterNodeResourceGroupProfile() + { + + } + } + /// Node resource group lockdown profile for a managed cluster. + public partial interface IManagedClusterNodeResourceGroupProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The restriction level applied to the cluster's node resource group + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The restriction level applied to the cluster's node resource group", + SerializedName = @"restrictionLevel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? RestrictionLevel { get; set; } + + } + /// Node resource group lockdown profile for a managed cluster. + internal partial interface IManagedClusterNodeResourceGroupProfileInternal + + { + /// The restriction level applied to the cluster's node resource group + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? RestrictionLevel { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.json.cs new file mode 100644 index 000000000000..75fdd8a964e4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterNodeResourceGroupProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Node resource group lockdown profile for a managed cluster. + public partial class ManagedClusterNodeResourceGroupProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterNodeResourceGroupProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterNodeResourceGroupProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_restrictionLevel = If( json?.PropertyT("restrictionLevel"), out var __jsonRestrictionLevel) ? (string)__jsonRestrictionLevel : (string)RestrictionLevel;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._restrictionLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._restrictionLevel.ToString()) : null, "restrictionLevel" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.PowerShell.cs new file mode 100644 index 000000000000..12bdfd02bc12 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The OIDC issuer profile of the Managed Cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterOidcIssuerProfileTypeConverter))] + public partial class ManagedClusterOidcIssuerProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterOidcIssuerProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterOidcIssuerProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterOidcIssuerProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IssuerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)this).IssuerUrl = (string) content.GetValueForProperty("IssuerUrl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)this).IssuerUrl, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)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 ManagedClusterOidcIssuerProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IssuerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)this).IssuerUrl = (string) content.GetValueForProperty("IssuerUrl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)this).IssuerUrl, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The OIDC issuer profile of the Managed Cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterOidcIssuerProfileTypeConverter))] + public partial interface IManagedClusterOidcIssuerProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.TypeConverter.cs new file mode 100644 index 000000000000..ff9f66c6fe15 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterOidcIssuerProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterOidcIssuerProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterOidcIssuerProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterOidcIssuerProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.cs new file mode 100644 index 000000000000..9a25cf259edc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The OIDC issuer profile of the Managed Cluster. + public partial class ManagedClusterOidcIssuerProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether the OIDC issuer is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _issuerUrl; + + /// The OIDC issuer url of the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string IssuerUrl { get => this._issuerUrl; } + + /// Internal Acessors for IssuerUrl + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal.IssuerUrl { get => this._issuerUrl; set { {_issuerUrl = value;} } } + + /// Creates an new instance. + public ManagedClusterOidcIssuerProfile() + { + + } + } + /// The OIDC issuer profile of the Managed Cluster. + public partial interface IManagedClusterOidcIssuerProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether the OIDC issuer is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the OIDC issuer is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// The OIDC issuer url of the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The OIDC issuer url of the Managed Cluster.", + SerializedName = @"issuerURL", + PossibleTypes = new [] { typeof(string) })] + string IssuerUrl { get; } + + } + /// The OIDC issuer profile of the Managed Cluster. + internal partial interface IManagedClusterOidcIssuerProfileInternal + + { + /// Whether the OIDC issuer is enabled. + bool? Enabled { get; set; } + /// The OIDC issuer url of the Managed Cluster. + string IssuerUrl { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.json.cs new file mode 100644 index 000000000000..4917b4d0c8d1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterOidcIssuerProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The OIDC issuer profile of the Managed Cluster. + public partial class ManagedClusterOidcIssuerProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterOidcIssuerProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterOidcIssuerProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_issuerUrl = If( json?.PropertyT("issuerURL"), out var __jsonIssuerUrl) ? (string)__jsonIssuerUrl : (string)IssuerUrl;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._issuerUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._issuerUrl.ToString()) : null, "issuerURL" ,container.Add ); + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.PowerShell.cs new file mode 100644 index 000000000000..56d6136d6aa9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.PowerShell.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Details about the pod identity assigned to the Managed Cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityTypeConverter))] + public partial class ManagedClusterPodIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPodIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPodIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPodIdentity(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningInfo = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo) content.GetValueForProperty("ProvisioningInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningInfo, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Namespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Namespace = (string) content.GetValueForProperty("Namespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Namespace, global::System.Convert.ToString); + } + if (content.Contains("BindingSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).BindingSelector = (string) content.GetValueForProperty("BindingSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).BindingSelector, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState.CreateFrom); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityObjectId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningInfoError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningInfoError = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError) content.GetValueForProperty("ProvisioningInfoError",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningInfoError, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningErrorBodyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningErrorBodyError = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) content.GetValueForProperty("ProvisioningErrorBodyError",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningErrorBodyError, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterPodIdentity(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningInfo = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo) content.GetValueForProperty("ProvisioningInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningInfo, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Namespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Namespace = (string) content.GetValueForProperty("Namespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Namespace, global::System.Convert.ToString); + } + if (content.Contains("BindingSelector")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).BindingSelector = (string) content.GetValueForProperty("BindingSelector",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).BindingSelector, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState.CreateFrom); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).IdentityObjectId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningInfoError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningInfoError = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError) content.GetValueForProperty("ProvisioningInfoError",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningInfoError, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningErrorBodyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningErrorBodyError = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) content.GetValueForProperty("ProvisioningErrorBodyError",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).ProvisioningErrorBodyError, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Details about the pod identity assigned to the Managed Cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityTypeConverter))] + public partial interface IManagedClusterPodIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.TypeConverter.cs new file mode 100644 index 000000000000..e85a0865987a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPodIdentityTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPodIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentity.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.cs new file mode 100644 index 000000000000..28d65d130469 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Details about the pod identity assigned to the Managed Cluster. + public partial class ManagedClusterPodIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal + { + + /// Backing field for property. + private string _bindingSelector; + + /// The binding selector to use for the AzureIdentityBinding resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string BindingSelector { get => this._bindingSelector; set => this._bindingSelector = value; } + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Code = value ?? null; } + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity _identity; + + /// The user assigned identity details. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity()); set => this._identity = value; } + + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ClientId = value ?? null; } + + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ObjectId = value ?? null; } + + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)Identity).ResourceId = value ?? null; } + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Message = value ?? null; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for ProvisioningErrorBodyError + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal.ProvisioningErrorBodyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).ManagedClusterPodIdentityProvisioningErrorBodyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).ManagedClusterPodIdentityProvisioningErrorBodyError = value; } + + /// Internal Acessors for ProvisioningInfo + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal.ProvisioningInfo { get => (this._provisioningInfo = this._provisioningInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningInfo()); set { {_provisioningInfo = value;} } } + + /// Internal Acessors for ProvisioningInfoError + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal.ProvisioningInfoError { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Error = value; } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the pod identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _namespace; + + /// The namespace of the pod identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Namespace { get => this._namespace; set => this._namespace = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo _provisioningInfo; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo ProvisioningInfo { get => (this._provisioningInfo = this._provisioningInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningInfo()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState? _provisioningState; + + /// The current provisioning state of the pod identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)ProvisioningInfo).Target = value ?? null; } + + /// Creates an new instance. + public ManagedClusterPodIdentity() + { + + } + } + /// Details about the pod identity assigned to the Managed Cluster. + public partial interface IManagedClusterPodIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The binding selector to use for the AzureIdentityBinding resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The binding selector to use for the AzureIdentityBinding resource.", + SerializedName = @"bindingSelector", + PossibleTypes = new [] { typeof(string) })] + string BindingSelector { get; set; } + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get; set; } + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client ID of the user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object ID of the user assigned identity.", + SerializedName = @"objectId", + PossibleTypes = new [] { typeof(string) })] + string IdentityObjectId { get; set; } + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the user assigned identity.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string IdentityResourceId { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// The name of the pod identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the pod identity.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The namespace of the pod identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The namespace of the pod identity.", + SerializedName = @"namespace", + PossibleTypes = new [] { typeof(string) })] + string Namespace { get; set; } + /// The current provisioning state of the pod identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state of the pod identity.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState? ProvisioningState { get; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; set; } + + } + /// Details about the pod identity assigned to the Managed Cluster. + internal partial interface IManagedClusterPodIdentityInternal + + { + /// The binding selector to use for the AzureIdentityBinding resource. + string BindingSelector { get; set; } + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get; set; } + /// The user assigned identity details. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Identity { get; set; } + /// The client ID of the user assigned identity. + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + string IdentityObjectId { get; set; } + /// The resource ID of the user assigned identity. + string IdentityResourceId { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// The name of the pod identity. + string Name { get; set; } + /// The namespace of the pod identity. + string Namespace { get; set; } + /// Details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody ProvisioningErrorBodyError { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo ProvisioningInfo { get; set; } + /// Pod identity assignment error (if any). + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError ProvisioningInfoError { get; set; } + /// The current provisioning state of the pod identity. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState? ProvisioningState { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.json.cs new file mode 100644 index 000000000000..be92ed17524a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentity.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Details about the pod identity assigned to the Managed Cluster. + public partial class ManagedClusterPodIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPodIdentity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPodIdentity(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.UserAssignedIdentity.FromJson(__jsonIdentity) : Identity;} + {_provisioningInfo = If( json?.PropertyT("provisioningInfo"), out var __jsonProvisioningInfo) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningInfo.FromJson(__jsonProvisioningInfo) : ProvisioningInfo;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_namespace = If( json?.PropertyT("namespace"), out var __jsonNamespace) ? (string)__jsonNamespace : (string)Namespace;} + {_bindingSelector = If( json?.PropertyT("bindingSelector"), out var __jsonBindingSelector) ? (string)__jsonBindingSelector : (string)BindingSelector;} + {_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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._provisioningInfo ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._provisioningInfo.ToJson(null,serializationMode) : null, "provisioningInfo" ,container.Add ); + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._namespace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._namespace.ToString()) : null, "namespace" ,container.Add ); + AddIf( null != (((object)this._bindingSelector)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._bindingSelector.ToString()) : null, "bindingSelector" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.PowerShell.cs new file mode 100644 index 000000000000..624c5b6b7e0a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// See [disable AAD Pod Identity for a specific Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) + /// for more details. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityExceptionTypeConverter))] + public partial class ManagedClusterPodIdentityException + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPodIdentityException(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPodIdentityException(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPodIdentityException(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Namespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).Namespace = (string) content.GetValueForProperty("Namespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).Namespace, global::System.Convert.ToString); + } + if (content.Contains("PodLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).PodLabel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels) content.GetValueForProperty("PodLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).PodLabel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionPodLabelsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterPodIdentityException(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Namespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).Namespace = (string) content.GetValueForProperty("Namespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).Namespace, global::System.Convert.ToString); + } + if (content.Contains("PodLabel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).PodLabel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels) content.GetValueForProperty("PodLabel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal)this).PodLabel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionPodLabelsTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// See [disable AAD Pod Identity for a specific Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) + /// for more details. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityExceptionTypeConverter))] + public partial interface IManagedClusterPodIdentityException + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.TypeConverter.cs new file mode 100644 index 000000000000..143711f12a7e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPodIdentityExceptionTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPodIdentityException.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityException.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityException.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.cs new file mode 100644 index 000000000000..6625ad8e02ba --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [disable AAD Pod Identity for a specific Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) + /// for more details. + /// + public partial class ManagedClusterPodIdentityException : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionInternal + { + + /// Backing field for property. + private string _name; + + /// The name of the pod identity exception. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _namespace; + + /// The namespace of the pod identity exception. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Namespace { get => this._namespace; set => this._namespace = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels _podLabel; + + /// The pod labels to match. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels PodLabel { get => (this._podLabel = this._podLabel ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionPodLabels()); set => this._podLabel = value; } + + /// Creates an new instance. + public ManagedClusterPodIdentityException() + { + + } + } + /// See [disable AAD Pod Identity for a specific Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) + /// for more details. + public partial interface IManagedClusterPodIdentityException : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The name of the pod identity exception. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the pod identity exception.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The namespace of the pod identity exception. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The namespace of the pod identity exception.", + SerializedName = @"namespace", + PossibleTypes = new [] { typeof(string) })] + string Namespace { get; set; } + /// The pod labels to match. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The pod labels to match.", + SerializedName = @"podLabels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels PodLabel { get; set; } + + } + /// See [disable AAD Pod Identity for a specific Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) + /// for more details. + internal partial interface IManagedClusterPodIdentityExceptionInternal + + { + /// The name of the pod identity exception. + string Name { get; set; } + /// The namespace of the pod identity exception. + string Namespace { get; set; } + /// The pod labels to match. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels PodLabel { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.json.cs new file mode 100644 index 000000000000..c2ab908c82bb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityException.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [disable AAD Pod Identity for a specific Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) + /// for more details. + /// + public partial class ManagedClusterPodIdentityException + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPodIdentityException(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPodIdentityException(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_namespace = If( json?.PropertyT("namespace"), out var __jsonNamespace) ? (string)__jsonNamespace : (string)Namespace;} + {_podLabel = If( json?.PropertyT("podLabels"), out var __jsonPodLabels) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionPodLabels.FromJson(__jsonPodLabels) : PodLabel;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._namespace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._namespace.ToString()) : null, "namespace" ,container.Add ); + AddIf( null != this._podLabel ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._podLabel.ToJson(null,serializationMode) : null, "podLabels" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.PowerShell.cs new file mode 100644 index 000000000000..1f3a2b8afebe --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The pod labels to match. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityExceptionPodLabelsTypeConverter))] + public partial class ManagedClusterPodIdentityExceptionPodLabels + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPodIdentityExceptionPodLabels(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPodIdentityExceptionPodLabels(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPodIdentityExceptionPodLabels(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 ManagedClusterPodIdentityExceptionPodLabels(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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The pod labels to match. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityExceptionPodLabelsTypeConverter))] + public partial interface IManagedClusterPodIdentityExceptionPodLabels + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.TypeConverter.cs new file mode 100644 index 000000000000..e4ad3b26dabc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPodIdentityExceptionPodLabelsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPodIdentityExceptionPodLabels.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityExceptionPodLabels.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityExceptionPodLabels.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.cs new file mode 100644 index 000000000000..4e2f2ebfe59b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The pod labels to match. + public partial class ManagedClusterPodIdentityExceptionPodLabels : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabelsInternal + { + + /// + /// Creates an new instance. + /// + public ManagedClusterPodIdentityExceptionPodLabels() + { + + } + } + /// The pod labels to match. + public partial interface IManagedClusterPodIdentityExceptionPodLabels : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// The pod labels to match. + internal partial interface IManagedClusterPodIdentityExceptionPodLabelsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.dictionary.cs new file mode 100644 index 000000000000..36c3ce80b3f7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterPodIdentityExceptionPodLabels : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionPodLabels source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.json.cs new file mode 100644 index 000000000000..3891fbee8cc2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityExceptionPodLabels.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The pod labels to match. + public partial class ManagedClusterPodIdentityExceptionPodLabels + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityExceptionPodLabels FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPodIdentityExceptionPodLabels(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedClusterPodIdentityExceptionPodLabels(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.PowerShell.cs new file mode 100644 index 000000000000..75c5488c1b8b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod identity + /// integration. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityProfileTypeConverter))] + public partial class ManagedClusterPodIdentityProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPodIdentityProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPodIdentityProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPodIdentityProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowNetworkPluginKubenet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).AllowNetworkPluginKubenet = (bool?) content.GetValueForProperty("AllowNetworkPluginKubenet",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).AllowNetworkPluginKubenet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[]) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).UserAssignedIdentity, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityTypeConverter.ConvertFrom)); + } + if (content.Contains("UserAssignedIdentityException")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).UserAssignedIdentityException = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[]) content.GetValueForProperty("UserAssignedIdentityException",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).UserAssignedIdentityException, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterPodIdentityProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowNetworkPluginKubenet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).AllowNetworkPluginKubenet = (bool?) content.GetValueForProperty("AllowNetworkPluginKubenet",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).AllowNetworkPluginKubenet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[]) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).UserAssignedIdentity, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityTypeConverter.ConvertFrom)); + } + if (content.Contains("UserAssignedIdentityException")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).UserAssignedIdentityException = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[]) content.GetValueForProperty("UserAssignedIdentityException",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)this).UserAssignedIdentityException, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod identity + /// integration. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityProfileTypeConverter))] + public partial interface IManagedClusterPodIdentityProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.TypeConverter.cs new file mode 100644 index 000000000000..ffa894b31990 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPodIdentityProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPodIdentityProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.cs new file mode 100644 index 000000000000..0ef81fffaac2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod identity + /// integration. + /// + public partial class ManagedClusterPodIdentityProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal + { + + /// Backing field for property. + private bool? _allowNetworkPluginKubenet; + + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? AllowNetworkPluginKubenet { get => this._allowNetworkPluginKubenet; set => this._allowNetworkPluginKubenet = value; } + + /// Backing field for property. + private bool? _enabled; + + /// Whether the pod identity addon is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] _userAssignedIdentity; + + /// The pod identities to use in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] UserAssignedIdentity { get => this._userAssignedIdentity; set => this._userAssignedIdentity = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] _userAssignedIdentityException; + + /// The pod identity exceptions to allow. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] UserAssignedIdentityException { get => this._userAssignedIdentityException; set => this._userAssignedIdentityException = value; } + + /// Creates an new instance. + public ManagedClusterPodIdentityProfile() + { + + } + } + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod identity + /// integration. + public partial interface IManagedClusterPodIdentityProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information.", + SerializedName = @"allowNetworkPluginKubenet", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowNetworkPluginKubenet { get; set; } + /// Whether the pod identity addon is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the pod identity addon is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// The pod identities to use in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The pod identities to use in the cluster.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] UserAssignedIdentity { get; set; } + /// The pod identity exceptions to allow. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The pod identity exceptions to allow.", + SerializedName = @"userAssignedIdentityExceptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] UserAssignedIdentityException { get; set; } + + } + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod identity + /// integration. + internal partial interface IManagedClusterPodIdentityProfileInternal + + { + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + bool? AllowNetworkPluginKubenet { get; set; } + /// Whether the pod identity addon is enabled. + bool? Enabled { get; set; } + /// The pod identities to use in the cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] UserAssignedIdentity { get; set; } + /// The pod identity exceptions to allow. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] UserAssignedIdentityException { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.json.cs new file mode 100644 index 000000000000..0892d88d0536 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod identity + /// integration. + /// + public partial class ManagedClusterPodIdentityProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPodIdentityProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPodIdentityProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_allowNetworkPluginKubenet = If( json?.PropertyT("allowNetworkPluginKubenet"), out var __jsonAllowNetworkPluginKubenet) ? (bool?)__jsonAllowNetworkPluginKubenet : AllowNetworkPluginKubenet;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? If( __jsonUserAssignedIdentities as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentity.FromJson(__u) )) ))() : null : UserAssignedIdentity;} + {_userAssignedIdentityException = If( json?.PropertyT("userAssignedIdentityExceptions"), out var __jsonUserAssignedIdentityExceptions) ? If( __jsonUserAssignedIdentityExceptions as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityException.FromJson(__p) )) ))() : null : UserAssignedIdentityException;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != this._allowNetworkPluginKubenet ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._allowNetworkPluginKubenet) : null, "allowNetworkPluginKubenet" ,container.Add ); + if (null != this._userAssignedIdentity) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._userAssignedIdentity ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("userAssignedIdentities",__w); + } + if (null != this._userAssignedIdentityException) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._userAssignedIdentityException ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("userAssignedIdentityExceptions",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.PowerShell.cs new file mode 100644 index 000000000000..97b64ee81777 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// An error response from the pod identity provisioning. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityProvisioningErrorTypeConverter))] + public partial class ManagedClusterPodIdentityProvisioningError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPodIdentityProvisioningError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPodIdentityProvisioningError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPodIdentityProvisioningError(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterPodIdentityProvisioningError(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An error response from the pod identity provisioning. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityProvisioningErrorTypeConverter))] + public partial interface IManagedClusterPodIdentityProvisioningError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.TypeConverter.cs new file mode 100644 index 000000000000..1c258520c624 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPodIdentityProvisioningErrorTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPodIdentityProvisioningError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityProvisioningError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityProvisioningError.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.cs new file mode 100644 index 000000000000..b28090761c8e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// An error response from the pod identity provisioning. + public partial class ManagedClusterPodIdentityProvisioningError : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal + { + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)Error).Code = value ?? null; } + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody _error; + + /// Details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBody()); set => this._error = value; } + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBody()); set { {_error = value;} } } + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)Error).Target = value ?? null; } + + /// + /// Creates an new instance. + /// + public ManagedClusterPodIdentityProvisioningError() + { + + } + } + /// An error response from the pod identity provisioning. + public partial interface IManagedClusterPodIdentityProvisioningError : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; set; } + + } + /// An error response from the pod identity provisioning. + internal partial interface IManagedClusterPodIdentityProvisioningErrorInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get; set; } + /// Details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody Error { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.json.cs new file mode 100644 index 000000000000..4bea963088c1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningError.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// An error response from the pod identity provisioning. + public partial class ManagedClusterPodIdentityProvisioningError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPodIdentityProvisioningError(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPodIdentityProvisioningError(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.PowerShell.cs new file mode 100644 index 000000000000..aa18dbf08360 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// An error response from the pod identity provisioning. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter))] + public partial class ManagedClusterPodIdentityProvisioningErrorBody + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPodIdentityProvisioningErrorBody(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPodIdentityProvisioningErrorBody(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPodIdentityProvisioningErrorBody(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterPodIdentityProvisioningErrorBody(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An error response from the pod identity provisioning. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter))] + public partial interface IManagedClusterPodIdentityProvisioningErrorBody + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.TypeConverter.cs new file mode 100644 index 000000000000..d6587dbd6432 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPodIdentityProvisioningErrorBody.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityProvisioningErrorBody.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityProvisioningErrorBody.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.cs new file mode 100644 index 000000000000..db10ff0ff8c8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// An error response from the pod identity provisioning. + public partial class ManagedClusterPodIdentityProvisioningErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBodyInternal + { + + /// Backing field for property. + private string _code; + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] _detail; + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get => this._detail; set => this._detail = value; } + + /// Backing field for property. + private string _message; + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private string _target; + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Target { get => this._target; set => this._target = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterPodIdentityProvisioningErrorBody() + { + + } + } + /// An error response from the pod identity provisioning. + public partial interface IManagedClusterPodIdentityProvisioningErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; set; } + + } + /// An error response from the pod identity provisioning. + internal partial interface IManagedClusterPodIdentityProvisioningErrorBodyInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.json.cs new file mode 100644 index 000000000000..c3283480ab5f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningErrorBody.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// An error response from the pod identity provisioning. + public partial class ManagedClusterPodIdentityProvisioningErrorBody + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPodIdentityProvisioningErrorBody(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPodIdentityProvisioningErrorBody(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBody.FromJson(__u) )) ))() : null : Detail;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.PowerShell.cs new file mode 100644 index 000000000000..9f5ec19f0e8e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityProvisioningInfoTypeConverter))] + public partial class ManagedClusterPodIdentityProvisioningInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPodIdentityProvisioningInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPodIdentityProvisioningInfo(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPodIdentityProvisioningInfo(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPodIdentityProvisioningErrorBodyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).ManagedClusterPodIdentityProvisioningErrorBodyError = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) content.GetValueForProperty("ManagedClusterPodIdentityProvisioningErrorBodyError",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).ManagedClusterPodIdentityProvisioningErrorBodyError, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterPodIdentityProvisioningInfo(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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPodIdentityProvisioningErrorBodyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).ManagedClusterPodIdentityProvisioningErrorBodyError = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) content.GetValueForProperty("ManagedClusterPodIdentityProvisioningErrorBodyError",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).ManagedClusterPodIdentityProvisioningErrorBodyError, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningErrorBodyTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPodIdentityProvisioningInfoTypeConverter))] + public partial interface IManagedClusterPodIdentityProvisioningInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.TypeConverter.cs new file mode 100644 index 000000000000..12cb4e63aa9e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPodIdentityProvisioningInfoTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPodIdentityProvisioningInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityProvisioningInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPodIdentityProvisioningInfo.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.cs new file mode 100644 index 000000000000..dff518fc619b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterPodIdentityProvisioningInfo : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal + { + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Code = value ?? null; } + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError _error; + + /// Pod identity assignment error (if any). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningError()); set => this._error = value; } + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningError()); set { {_error = value;} } } + + /// Internal Acessors for ManagedClusterPodIdentityProvisioningErrorBodyError + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfoInternal.ManagedClusterPodIdentityProvisioningErrorBodyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Error = value; } + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorInternal)Error).Target = value ?? null; } + + /// + /// Creates an new instance. + /// + public ManagedClusterPodIdentityProvisioningInfo() + { + + } + } + public partial interface IManagedClusterPodIdentityProvisioningInfo : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; set; } + + } + internal partial interface IManagedClusterPodIdentityProvisioningInfoInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody[] Detail { get; set; } + /// Pod identity assignment error (if any). + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningError Error { get; set; } + /// Details about the error. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningErrorBody ManagedClusterPodIdentityProvisioningErrorBodyError { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.json.cs new file mode 100644 index 000000000000..d52347c677ad --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPodIdentityProvisioningInfo.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterPodIdentityProvisioningInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProvisioningInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPodIdentityProvisioningInfo(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPodIdentityProvisioningInfo(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProvisioningError.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.PowerShell.cs new file mode 100644 index 000000000000..c7f43496a763 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The list of available upgrade versions. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPoolUpgradeProfileTypeConverter))] + public partial class ManagedClusterPoolUpgradeProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPoolUpgradeProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPoolUpgradeProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPoolUpgradeProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).Upgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileUpgradesItemTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterPoolUpgradeProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).Upgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileUpgradesItemTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of available upgrade versions. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPoolUpgradeProfileTypeConverter))] + public partial interface IManagedClusterPoolUpgradeProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.TypeConverter.cs new file mode 100644 index 000000000000..3e3f37d889d0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPoolUpgradeProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPoolUpgradeProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPoolUpgradeProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPoolUpgradeProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.cs new file mode 100644 index 000000000000..e7a447269e41 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available upgrade versions. + public partial class ManagedClusterPoolUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal + { + + /// Backing field for property. + private string _kubernetesVersion; + + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } + + /// Backing field for property. + private string _name; + + /// The Agent Pool name. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType _oSType; + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get => this._oSType; set => this._oSType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] _upgrade; + + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] Upgrade { get => this._upgrade; set => this._upgrade = value; } + + /// Creates an new instance. + public ManagedClusterPoolUpgradeProfile() + { + + } + } + /// The list of available upgrade versions. + public partial interface IManagedClusterPoolUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Kubernetes version (major.minor.patch).", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// The Agent Pool name. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Agent Pool name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get; set; } + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of orchestrator types and versions available for upgrade.", + SerializedName = @"upgrades", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] Upgrade { get; set; } + + } + /// The list of available upgrade versions. + internal partial interface IManagedClusterPoolUpgradeProfileInternal + + { + /// The Kubernetes version (major.minor.patch). + string KubernetesVersion { get; set; } + /// The Agent Pool name. + string Name { get; set; } + /// The operating system type. The default is Linux. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get; set; } + /// List of orchestrator types and versions available for upgrade. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] Upgrade { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.json.cs new file mode 100644 index 000000000000..3c0bab1f7a0a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfile.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available upgrade versions. + public partial class ManagedClusterPoolUpgradeProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPoolUpgradeProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPoolUpgradeProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)OSType;} + {_upgrade = If( json?.PropertyT("upgrades"), out var __jsonUpgrades) ? If( __jsonUpgrades as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileUpgradesItem.FromJson(__u) )) ))() : null : Upgrade;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add ); + if (null != this._upgrade) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._upgrade ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("upgrades",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.PowerShell.cs new file mode 100644 index 000000000000..dfae67e7a917 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPoolUpgradeProfileUpgradesItemTypeConverter))] + public partial class ManagedClusterPoolUpgradeProfileUpgradesItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPoolUpgradeProfileUpgradesItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPoolUpgradeProfileUpgradesItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPoolUpgradeProfileUpgradesItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItemInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItemInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("IsPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItemInternal)this).IsPreview = (bool?) content.GetValueForProperty("IsPreview",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItemInternal)this).IsPreview, (__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 ManagedClusterPoolUpgradeProfileUpgradesItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItemInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItemInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("IsPreview")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItemInternal)this).IsPreview = (bool?) content.GetValueForProperty("IsPreview",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItemInternal)this).IsPreview, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPoolUpgradeProfileUpgradesItemTypeConverter))] + public partial interface IManagedClusterPoolUpgradeProfileUpgradesItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.TypeConverter.cs new file mode 100644 index 000000000000..12f1e346a044 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPoolUpgradeProfileUpgradesItemTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPoolUpgradeProfileUpgradesItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPoolUpgradeProfileUpgradesItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPoolUpgradeProfileUpgradesItem.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.cs new file mode 100644 index 000000000000..fa5caa0561c0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterPoolUpgradeProfileUpgradesItem : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItemInternal + { + + /// Backing field for property. + private bool? _isPreview; + + /// Whether the Kubernetes version is currently in preview. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? IsPreview { get => this._isPreview; set => this._isPreview = value; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterPoolUpgradeProfileUpgradesItem() + { + + } + } + public partial interface IManagedClusterPoolUpgradeProfileUpgradesItem : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether the Kubernetes version is currently in preview. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the Kubernetes version is currently in preview.", + SerializedName = @"isPreview", + PossibleTypes = new [] { typeof(bool) })] + bool? IsPreview { get; set; } + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Kubernetes version (major.minor.patch).", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + + } + internal partial interface IManagedClusterPoolUpgradeProfileUpgradesItemInternal + + { + /// Whether the Kubernetes version is currently in preview. + bool? IsPreview { get; set; } + /// The Kubernetes version (major.minor.patch). + string KubernetesVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.json.cs new file mode 100644 index 000000000000..b9ae8630ba37 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPoolUpgradeProfileUpgradesItem.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterPoolUpgradeProfileUpgradesItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPoolUpgradeProfileUpgradesItem(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPoolUpgradeProfileUpgradesItem(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} + {_isPreview = If( json?.PropertyT("isPreview"), out var __jsonIsPreview) ? (bool?)__jsonIsPreview : IsPreview;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + AddIf( null != this._isPreview ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._isPreview) : null, "isPreview" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.PowerShell.cs new file mode 100644 index 000000000000..1c98bac71d12 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.PowerShell.cs @@ -0,0 +1,1714 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Properties of the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesTypeConverter))] + public partial class ManagedClusterProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile) content.GetValueForProperty("LinuxProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceLinuxProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ServicePrincipalProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile) content.GetValueForProperty("ServicePrincipalProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PodIdentityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile) content.GetValueForProperty("PodIdentityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("OidcIssuerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile) content.GetValueForProperty("OidcIssuerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterOidcIssuerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NodeResourceGroupProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroupProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile) content.GetValueForProperty("NodeResourceGroupProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroupProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeResourceGroupProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AadProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile) content.GetValueForProperty("AadProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AutoUpgradeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile) content.GetValueForProperty("AutoUpgradeProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAutoUpgradeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ClusterUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoScalerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile) content.GetValueForProperty("AutoScalerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAutoScalerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ApiServerAccessProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile) content.GetValueForProperty("ApiServerAccessProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterApiServerAccessProfileTypeConverter.ConvertFrom); + } + if (content.Contains("HttpProxyConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig) content.GetValueForProperty("HttpProxyConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterHttpProxyConfigTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("IngressProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IngressProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile) content.GetValueForProperty("IngressProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IngressProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile) content.GetValueForProperty("WorkloadAutoScalerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile) content.GetValueForProperty("AzureMonitorProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SafeguardsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile) content.GetValueForProperty("SafeguardsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceMeshProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile) content.GetValueForProperty("ServiceMeshProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ServiceMeshProfileTypeConverter.ConvertFrom); + } + if (content.Contains("MetricsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile) content.GetValueForProperty("MetricsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterMetricsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AiToolchainOperatorProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AiToolchainOperatorProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile) content.GetValueForProperty("AiToolchainOperatorProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AiToolchainOperatorProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAiToolchainOperatorProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NodeProvisioningProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeProvisioningProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile) content.GetValueForProperty("NodeProvisioningProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeProvisioningProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeProvisioningProfileTypeConverter.ConvertFrom); + } + if (content.Contains("BootstrapProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile) content.GetValueForProperty("BootstrapProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterBootstrapProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MaxAgentPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MaxAgentPool = (int?) content.GetValueForProperty("MaxAgentPool",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MaxAgentPool, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CurrentKubernetesVersion = (string) content.GetValueForProperty("CurrentKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CurrentKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("DnsPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DnsPrefix = (string) content.GetValueForProperty("DnsPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DnsPrefix, global::System.Convert.ToString); + } + if (content.Contains("FqdnSubdomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).FqdnSubdomain = (string) content.GetValueForProperty("FqdnSubdomain",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).FqdnSubdomain, global::System.Convert.ToString); + } + if (content.Contains("Fqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).Fqdn = (string) content.GetValueForProperty("Fqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).Fqdn, global::System.Convert.ToString); + } + if (content.Contains("PrivateFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PrivateFqdn = (string) content.GetValueForProperty("PrivateFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PrivateFqdn, global::System.Convert.ToString); + } + if (content.Contains("AzurePortalFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzurePortalFqdn = (string) content.GetValueForProperty("AzurePortalFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzurePortalFqdn, global::System.Convert.ToString); + } + if (content.Contains("AgentPoolProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AgentPoolProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[]) content.GetValueForProperty("AgentPoolProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AgentPoolProfile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("AddonProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AddonProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles) content.GetValueForProperty("AddonProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AddonProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAddonProfilesTypeConverter.ConvertFrom); + } + if (content.Contains("NodeResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroup = (string) content.GetValueForProperty("NodeResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("EnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnableRbac = (bool?) content.GetValueForProperty("EnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SupportPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SupportPlan = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan?) content.GetValueForProperty("SupportPlan",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SupportPlan, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan.CreateFrom); + } + if (content.Contains("EnablePodSecurityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnablePodSecurityPolicy = (bool?) content.GetValueForProperty("EnablePodSecurityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnablePodSecurityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNamespaceResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnableNamespaceResource = (bool?) content.GetValueForProperty("EnableNamespaceResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnableNamespaceResource, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskEncryptionSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskEncryptionSetId = (string) content.GetValueForProperty("DiskEncryptionSetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskEncryptionSetId, global::System.Convert.ToString); + } + if (content.Contains("IdentityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile) content.GetValueForProperty("IdentityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesIdentityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PrivateLinkResource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[]) content.GetValueForProperty("PrivateLinkResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PrivateLinkResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DisableLocalAccount = (bool?) content.GetValueForProperty("DisableLocalAccount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DisableLocalAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("ResourceUid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ResourceUid = (string) content.GetValueForProperty("ResourceUid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ResourceUid, global::System.Convert.ToString); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("WindowProfileLicenseType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileLicenseType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType?) content.GetValueForProperty("WindowProfileLicenseType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileLicenseType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType.CreateFrom); + } + if (content.Contains("NodeResourceGroupProfileRestrictionLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroupProfileRestrictionLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel?) content.GetValueForProperty("NodeResourceGroupProfileRestrictionLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroupProfileRestrictionLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel.CreateFrom); + } + if (content.Contains("AutoUpgradeProfileUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfileUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel?) content.GetValueForProperty("AutoUpgradeProfileUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfileUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel.CreateFrom); + } + if (content.Contains("AutoScalerProfileExpander")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileExpander = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander?) content.GetValueForProperty("AutoScalerProfileExpander",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileExpander, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander.CreateFrom); + } + if (content.Contains("SafeguardProfileVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileVersion = (string) content.GetValueForProperty("SafeguardProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileVersion, global::System.Convert.ToString); + } + if (content.Contains("SafeguardProfileLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) content.GetValueForProperty("SafeguardProfileLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level.CreateFrom); + } + if (content.Contains("SafeguardProfileExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileExcludedNamespace = (string[]) content.GetValueForProperty("SafeguardProfileExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BootstrapProfileArtifactSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfileArtifactSource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource?) content.GetValueForProperty("BootstrapProfileArtifactSource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfileArtifactSource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource.CreateFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LinuxProfileSsh")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfileSsh = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration) content.GetValueForProperty("LinuxProfileSsh",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfileSsh, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxProfileAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfileAdminUsername = (string) content.GetValueForProperty("LinuxProfileAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfileAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileGmsaProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileGmsaProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile) content.GetValueForProperty("WindowProfileGmsaProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileGmsaProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WindowProfileAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileAdminUsername = (string) content.GetValueForProperty("WindowProfileAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileAdminPassword = (string) content.GetValueForProperty("WindowProfileAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileAdminPassword, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileEnableCsiProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileEnableCsiProxy = (bool?) content.GetValueForProperty("WindowProfileEnableCsiProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileEnableCsiProxy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServicePrincipalProfileClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfileClientId = (string) content.GetValueForProperty("ServicePrincipalProfileClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfileClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalProfileSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfileSecret = (string) content.GetValueForProperty("ServicePrincipalProfileSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfileSecret, global::System.Convert.ToString); + } + if (content.Contains("PodIdentityProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileEnabled = (bool?) content.GetValueForProperty("PodIdentityProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PodIdentityProfileAllowNetworkPluginKubenet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileAllowNetworkPluginKubenet = (bool?) content.GetValueForProperty("PodIdentityProfileAllowNetworkPluginKubenet",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileAllowNetworkPluginKubenet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PodIdentityProfileUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[]) content.GetValueForProperty("PodIdentityProfileUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileUserAssignedIdentity, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityTypeConverter.ConvertFrom)); + } + if (content.Contains("PodIdentityProfileUserAssignedIdentityException")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileUserAssignedIdentityException = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[]) content.GetValueForProperty("PodIdentityProfileUserAssignedIdentityException",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileUserAssignedIdentityException, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("OidcIssuerProfileIssuerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfileIssuerUrl = (string) content.GetValueForProperty("OidcIssuerProfileIssuerUrl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfileIssuerUrl, global::System.Convert.ToString); + } + if (content.Contains("OidcIssuerProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfileEnabled = (bool?) content.GetValueForProperty("OidcIssuerProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileManaged")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileManaged = (bool?) content.GetValueForProperty("AadProfileManaged",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileEnableAzureRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileEnableAzureRbac = (bool?) content.GetValueForProperty("AadProfileEnableAzureRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileEnableAzureRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileAdminGroupObjectID")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileAdminGroupObjectID = (string[]) content.GetValueForProperty("AadProfileAdminGroupObjectID",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileAdminGroupObjectID, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AadProfileClientAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileClientAppId = (string) content.GetValueForProperty("AadProfileClientAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileClientAppId, global::System.Convert.ToString); + } + if (content.Contains("AadProfileServerAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileServerAppId = (string) content.GetValueForProperty("AadProfileServerAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileServerAppId, global::System.Convert.ToString); + } + if (content.Contains("AadProfileServerAppSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileServerAppSecret = (string) content.GetValueForProperty("AadProfileServerAppSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileServerAppSecret, global::System.Convert.ToString); + } + if (content.Contains("AadProfileTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileTenantId = (string) content.GetValueForProperty("AadProfileTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileTenantId, global::System.Convert.ToString); + } + if (content.Contains("AutoUpgradeProfileNodeOSUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfileNodeOSUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel?) content.GetValueForProperty("AutoUpgradeProfileNodeOSUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfileNodeOSUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel.CreateFrom); + } + if (content.Contains("UpgradeSettingOverrideSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).UpgradeSettingOverrideSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings) content.GetValueForProperty("UpgradeSettingOverrideSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).UpgradeSettingOverrideSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoScalerProfileBalanceSimilarNodeGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileBalanceSimilarNodeGroup = (string) content.GetValueForProperty("AutoScalerProfileBalanceSimilarNodeGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileBalanceSimilarNodeGroup, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileDaemonsetEvictionForEmptyNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileDaemonsetEvictionForEmptyNode = (bool?) content.GetValueForProperty("AutoScalerProfileDaemonsetEvictionForEmptyNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileDaemonsetEvictionForEmptyNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileDaemonsetEvictionForOccupiedNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileDaemonsetEvictionForOccupiedNode = (bool?) content.GetValueForProperty("AutoScalerProfileDaemonsetEvictionForOccupiedNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileDaemonsetEvictionForOccupiedNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileIgnoreDaemonsetsUtilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileIgnoreDaemonsetsUtilization = (bool?) content.GetValueForProperty("AutoScalerProfileIgnoreDaemonsetsUtilization",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileIgnoreDaemonsetsUtilization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileMaxEmptyBulkDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxEmptyBulkDelete = (string) content.GetValueForProperty("AutoScalerProfileMaxEmptyBulkDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxEmptyBulkDelete, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxGracefulTerminationSec")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxGracefulTerminationSec = (string) content.GetValueForProperty("AutoScalerProfileMaxGracefulTerminationSec",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxGracefulTerminationSec, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxNodeProvisionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxNodeProvisionTime = (string) content.GetValueForProperty("AutoScalerProfileMaxNodeProvisionTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxNodeProvisionTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxTotalUnreadyPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxTotalUnreadyPercentage = (string) content.GetValueForProperty("AutoScalerProfileMaxTotalUnreadyPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxTotalUnreadyPercentage, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileNewPodScaleUpDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileNewPodScaleUpDelay = (string) content.GetValueForProperty("AutoScalerProfileNewPodScaleUpDelay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileNewPodScaleUpDelay, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileOkTotalUnreadyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileOkTotalUnreadyCount = (string) content.GetValueForProperty("AutoScalerProfileOkTotalUnreadyCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileOkTotalUnreadyCount, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScanInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScanInterval = (string) content.GetValueForProperty("AutoScalerProfileScanInterval",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScanInterval, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterAdd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterAdd = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterAdd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterAdd, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterDelete = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterDelete, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterFailure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterFailure = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterFailure",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterFailure, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUnneededTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUnneededTime = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUnneededTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUnneededTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUnreadyTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUnreadyTime = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUnreadyTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUnreadyTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUtilizationThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUtilizationThreshold = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUtilizationThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUtilizationThreshold, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileSkipNodesWithLocalStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileSkipNodesWithLocalStorage = (string) content.GetValueForProperty("AutoScalerProfileSkipNodesWithLocalStorage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileSkipNodesWithLocalStorage, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileSkipNodesWithSystemPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileSkipNodesWithSystemPod = (string) content.GetValueForProperty("AutoScalerProfileSkipNodesWithSystemPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileSkipNodesWithSystemPod, global::System.Convert.ToString); + } + if (content.Contains("ApiServerAccessProfileAuthorizedIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileAuthorizedIPRange = (string[]) content.GetValueForProperty("ApiServerAccessProfileAuthorizedIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileAuthorizedIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiServerAccessProfileEnablePrivateCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnablePrivateCluster = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnablePrivateCluster",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnablePrivateCluster, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfilePrivateDnsZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfilePrivateDnsZone = (string) content.GetValueForProperty("ApiServerAccessProfilePrivateDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfilePrivateDnsZone, global::System.Convert.ToString); + } + if (content.Contains("ApiServerAccessProfileEnablePrivateClusterPublicFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnablePrivateClusterPublicFqdn = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnablePrivateClusterPublicFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnablePrivateClusterPublicFqdn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileDisableRunCommand")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileDisableRunCommand = (bool?) content.GetValueForProperty("ApiServerAccessProfileDisableRunCommand",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileDisableRunCommand, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileEnableVnetIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnableVnetIntegration = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnableVnetIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnableVnetIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileSubnetId = (string) content.GetValueForProperty("ApiServerAccessProfileSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileSubnetId, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigHttpProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigHttpProxy = (string) content.GetValueForProperty("HttpProxyConfigHttpProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigHttpProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigHttpsProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigHttpsProxy = (string) content.GetValueForProperty("HttpProxyConfigHttpsProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigHttpsProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigNoProxy = (string[]) content.GetValueForProperty("HttpProxyConfigNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("HttpProxyConfigEffectiveNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigEffectiveNoProxy = (string[]) content.GetValueForProperty("HttpProxyConfigEffectiveNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigEffectiveNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("HttpProxyConfigTrustedCa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigTrustedCa = (string) content.GetValueForProperty("HttpProxyConfigTrustedCa",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigTrustedCa, global::System.Convert.ToString); + } + if (content.Contains("SecurityProfileDefender")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileDefender = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender) content.GetValueForProperty("SecurityProfileDefender",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileDefender, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileAzureKeyVaultKm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileAzureKeyVaultKm = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms) content.GetValueForProperty("SecurityProfileAzureKeyVaultKm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileAzureKeyVaultKm, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKmsTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileWorkloadIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileWorkloadIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity) content.GetValueForProperty("SecurityProfileWorkloadIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileWorkloadIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileImageCleaner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileImageCleaner = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner) content.GetValueForProperty("SecurityProfileImageCleaner",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileImageCleaner, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleanerTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileImageIntegrity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileImageIntegrity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity) content.GetValueForProperty("SecurityProfileImageIntegrity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileImageIntegrity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrityTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileNodeRestriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileNodeRestriction = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction) content.GetValueForProperty("SecurityProfileNodeRestriction",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileNodeRestriction, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestrictionTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileCustomCaTrustCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileCustomCaTrustCertificate = (byte[][]) content.GetValueForProperty("SecurityProfileCustomCaTrustCertificate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileCustomCaTrustCertificate, __y => TypeConverterExtensions.SelectToArray(__y, i => i)); + } + if (content.Contains("AzureKeyVaultKmKeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyId, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileDiskCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileDiskCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver) content.GetValueForProperty("StorageProfileDiskCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileDiskCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileFileCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileFileCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver) content.GetValueForProperty("StorageProfileFileCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileFileCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileSnapshotController")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileSnapshotController = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController) content.GetValueForProperty("StorageProfileSnapshotController",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileSnapshotController, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotControllerTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileBlobCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileBlobCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver) content.GetValueForProperty("StorageProfileBlobCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileBlobCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("IngressProfileWebAppRouting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IngressProfileWebAppRouting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting) content.GetValueForProperty("IngressProfileWebAppRouting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IngressProfileWebAppRouting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRoutingTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfileKeda")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfileKeda = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda) content.GetValueForProperty("WorkloadAutoScalerProfileKeda",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfileKeda, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKedaTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfileVerticalPodAutoscaler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfileVerticalPodAutoscaler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler) content.GetValueForProperty("WorkloadAutoScalerProfileVerticalPodAutoscaler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfileVerticalPodAutoscaler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTypeConverter.ConvertFrom); + } + if (content.Contains("VerticalPodAutoscalerAddonAutoscaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).VerticalPodAutoscalerAddonAutoscaling = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling?) content.GetValueForProperty("VerticalPodAutoscalerAddonAutoscaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).VerticalPodAutoscalerAddonAutoscaling, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling.CreateFrom); + } + if (content.Contains("AzureMonitorProfileMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics) content.GetValueForProperty("AzureMonitorProfileMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfileContainerInsight")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileContainerInsight = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights) content.GetValueForProperty("AzureMonitorProfileContainerInsight",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileContainerInsight, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsightsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfileAppMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileAppMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring) content.GetValueForProperty("AzureMonitorProfileAppMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileAppMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("SafeguardProfileSystemExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileSystemExcludedNamespace = (string[]) content.GetValueForProperty("SafeguardProfileSystemExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileSystemExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceMeshProfileIstio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfileIstio = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh) content.GetValueForProperty("ServiceMeshProfileIstio",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfileIstio, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMeshTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceMeshProfileMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfileMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) content.GetValueForProperty("ServiceMeshProfileMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfileMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode.CreateFrom); + } + if (content.Contains("IstioComponent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioComponent = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents) content.GetValueForProperty("IstioComponent",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioComponent, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponentsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioCertificateAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioCertificateAuthority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority) content.GetValueForProperty("IstioCertificateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioCertificateAuthority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("MetricProfileCostAnalysis")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricProfileCostAnalysis = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis) content.GetValueForProperty("MetricProfileCostAnalysis",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricProfileCostAnalysis, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysisTypeConverter.ConvertFrom); + } + if (content.Contains("AiToolchainOperatorProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AiToolchainOperatorProfileEnabled = (bool?) content.GetValueForProperty("AiToolchainOperatorProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AiToolchainOperatorProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeProvisioningProfileMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeProvisioningProfileMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode?) content.GetValueForProperty("NodeProvisioningProfileMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeProvisioningProfileMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode.CreateFrom); + } + if (content.Contains("BootstrapProfileContainerRegistryId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfileContainerRegistryId = (string) content.GetValueForProperty("BootstrapProfileContainerRegistryId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfileContainerRegistryId, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("GmsaProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileEnabled = (bool?) content.GetValueForProperty("GmsaProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GmsaProfileDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileDnsServer = (string) content.GetValueForProperty("GmsaProfileDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileDnsServer, global::System.Convert.ToString); + } + if (content.Contains("GmsaProfileRootDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileRootDomainName = (string) content.GetValueForProperty("GmsaProfileRootDomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileRootDomainName, global::System.Convert.ToString); + } + if (content.Contains("OverrideSettingForceUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OverrideSettingForceUpgrade = (bool?) content.GetValueForProperty("OverrideSettingForceUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OverrideSettingForceUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OverrideSettingUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OverrideSettingUntil = (global::System.DateTime?) content.GetValueForProperty("OverrideSettingUntil",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OverrideSettingUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DefenderSecurityMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DefenderSecurityMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring) content.GetValueForProperty("DefenderSecurityMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DefenderSecurityMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("DefenderLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DefenderLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("DefenderLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DefenderLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureKeyVaultKmEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmEnabled = (bool?) content.GetValueForProperty("AzureKeyVaultKmEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureKeyVaultKmKeyVaultNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes?) content.GetValueForProperty("AzureKeyVaultKmKeyVaultNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes.CreateFrom); + } + if (content.Contains("AzureKeyVaultKmKeyVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyVaultResourceId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("WorkloadIdentityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadIdentityEnabled = (bool?) content.GetValueForProperty("WorkloadIdentityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadIdentityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageCleanerEnabled = (bool?) content.GetValueForProperty("ImageCleanerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageCleanerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerIntervalHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageCleanerIntervalHour = (int?) content.GetValueForProperty("ImageCleanerIntervalHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageCleanerIntervalHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImageIntegrityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageIntegrityEnabled = (bool?) content.GetValueForProperty("ImageIntegrityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageIntegrityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeRestrictionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeRestrictionEnabled = (bool?) content.GetValueForProperty("NodeRestrictionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeRestrictionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskCsiDriverEnabled = (bool?) content.GetValueForProperty("DiskCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskCsiDriverVersion = (string) content.GetValueForProperty("DiskCsiDriverVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskCsiDriverVersion, global::System.Convert.ToString); + } + if (content.Contains("FileCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).FileCsiDriverEnabled = (bool?) content.GetValueForProperty("FileCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).FileCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SnapshotControllerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SnapshotControllerEnabled = (bool?) content.GetValueForProperty("SnapshotControllerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SnapshotControllerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BlobCsiDriverEnabled = (bool?) content.GetValueForProperty("BlobCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BlobCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("WebAppRoutingIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("WebAppRoutingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingEnabled = (bool?) content.GetValueForProperty("WebAppRoutingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingDnsZoneResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingDnsZoneResourceId = (string[]) content.GetValueForProperty("WebAppRoutingDnsZoneResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingDnsZoneResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KedaEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KedaEnabled = (bool) content.GetValueForProperty("KedaEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KedaEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VerticalPodAutoscalerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).VerticalPodAutoscalerEnabled = (bool) content.GetValueForProperty("VerticalPodAutoscalerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).VerticalPodAutoscalerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MetricKubeStateMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricKubeStateMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics) content.GetValueForProperty("MetricKubeStateMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricKubeStateMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("MetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricEnabled = (bool) content.GetValueForProperty("MetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightEnabled = (bool?) content.GetValueForProperty("ContainerInsightEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("ContainerInsightLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ContainerInsightSyslogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightSyslogPort = (long?) content.GetValueForProperty("ContainerInsightSyslogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightSyslogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ContainerInsightDisableCustomMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightDisableCustomMetric = (bool?) content.GetValueForProperty("ContainerInsightDisableCustomMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightDisableCustomMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightDisablePrometheusMetricsScraping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightDisablePrometheusMetricsScraping = (bool?) content.GetValueForProperty("ContainerInsightDisablePrometheusMetricsScraping",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightDisablePrometheusMetricsScraping, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AppMonitoringAutoInstrumentation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringAutoInstrumentation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) content.GetValueForProperty("AppMonitoringAutoInstrumentation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringAutoInstrumentation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringOpenTelemetryMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) content.GetValueForProperty("AppMonitoringOpenTelemetryMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringOpenTelemetryMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringOpenTelemetryLog = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) content.GetValueForProperty("AppMonitoringOpenTelemetryLog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringOpenTelemetryLog, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioRevision = (string[]) content.GetValueForProperty("IstioRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioRevision, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ComponentIngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ComponentIngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("ComponentIngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ComponentIngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("ComponentEgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ComponentEgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("ComponentEgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ComponentEgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("CostAnalysisEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CostAnalysisEnabled = (bool?) content.GetValueForProperty("CostAnalysisEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CostAnalysisEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityMonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityMonitoringEnabled = (bool?) content.GetValueForProperty("SecurityMonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityMonitoringEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityObjectId, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubeStateMetricLabelsAllowlist = (string) content.GetValueForProperty("KubeStateMetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubeStateMetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubeStateMetricAnnotationsAllowList = (string) content.GetValueForProperty("KubeStateMetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubeStateMetricAnnotationsAllowList, global::System.Convert.ToString); + } + if (content.Contains("AutoInstrumentationEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoInstrumentationEnabled = (bool?) content.GetValueForProperty("AutoInstrumentationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoInstrumentationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryMetricEnabled = (bool?) content.GetValueForProperty("OpenTelemetryMetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryMetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryMetricPort = (long?) content.GetValueForProperty("OpenTelemetryMetricPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryMetricPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("OpenTelemetryLogEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryLogEnabled = (bool?) content.GetValueForProperty("OpenTelemetryLogEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryLogEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryLogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryLogPort = (long?) content.GetValueForProperty("OpenTelemetryLogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryLogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CertificateAuthorityPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CertificateAuthorityPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("CertificateAuthorityPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CertificateAuthorityPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginCertChainObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerStateTypeConverter.ConvertFrom); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile) content.GetValueForProperty("LinuxProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceLinuxProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WindowsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile) content.GetValueForProperty("WindowsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWindowsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ServicePrincipalProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile) content.GetValueForProperty("ServicePrincipalProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PodIdentityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile) content.GetValueForProperty("PodIdentityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("OidcIssuerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile) content.GetValueForProperty("OidcIssuerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterOidcIssuerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NodeResourceGroupProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroupProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile) content.GetValueForProperty("NodeResourceGroupProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroupProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeResourceGroupProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AadProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile) content.GetValueForProperty("AadProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AutoUpgradeProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile) content.GetValueForProperty("AutoUpgradeProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAutoUpgradeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ClusterUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoScalerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile) content.GetValueForProperty("AutoScalerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAutoScalerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ApiServerAccessProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile) content.GetValueForProperty("ApiServerAccessProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterApiServerAccessProfileTypeConverter.ConvertFrom); + } + if (content.Contains("HttpProxyConfig")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfig = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig) content.GetValueForProperty("HttpProxyConfig",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfig, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterHttpProxyConfigTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile) content.GetValueForProperty("SecurityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("IngressProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IngressProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile) content.GetValueForProperty("IngressProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IngressProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile) content.GetValueForProperty("WorkloadAutoScalerProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile) content.GetValueForProperty("AzureMonitorProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileTypeConverter.ConvertFrom); + } + if (content.Contains("SafeguardsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile) content.GetValueForProperty("SafeguardsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceMeshProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile) content.GetValueForProperty("ServiceMeshProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ServiceMeshProfileTypeConverter.ConvertFrom); + } + if (content.Contains("MetricsProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricsProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile) content.GetValueForProperty("MetricsProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricsProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterMetricsProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AiToolchainOperatorProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AiToolchainOperatorProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile) content.GetValueForProperty("AiToolchainOperatorProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AiToolchainOperatorProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAiToolchainOperatorProfileTypeConverter.ConvertFrom); + } + if (content.Contains("NodeProvisioningProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeProvisioningProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile) content.GetValueForProperty("NodeProvisioningProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeProvisioningProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeProvisioningProfileTypeConverter.ConvertFrom); + } + if (content.Contains("BootstrapProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile) content.GetValueForProperty("BootstrapProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterBootstrapProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MaxAgentPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MaxAgentPool = (int?) content.GetValueForProperty("MaxAgentPool",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MaxAgentPool, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("CurrentKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CurrentKubernetesVersion = (string) content.GetValueForProperty("CurrentKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CurrentKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("DnsPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DnsPrefix = (string) content.GetValueForProperty("DnsPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DnsPrefix, global::System.Convert.ToString); + } + if (content.Contains("FqdnSubdomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).FqdnSubdomain = (string) content.GetValueForProperty("FqdnSubdomain",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).FqdnSubdomain, global::System.Convert.ToString); + } + if (content.Contains("Fqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).Fqdn = (string) content.GetValueForProperty("Fqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).Fqdn, global::System.Convert.ToString); + } + if (content.Contains("PrivateFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PrivateFqdn = (string) content.GetValueForProperty("PrivateFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PrivateFqdn, global::System.Convert.ToString); + } + if (content.Contains("AzurePortalFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzurePortalFqdn = (string) content.GetValueForProperty("AzurePortalFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzurePortalFqdn, global::System.Convert.ToString); + } + if (content.Contains("AgentPoolProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AgentPoolProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[]) content.GetValueForProperty("AgentPoolProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AgentPoolProfile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("AddonProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AddonProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles) content.GetValueForProperty("AddonProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AddonProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAddonProfilesTypeConverter.ConvertFrom); + } + if (content.Contains("NodeResourceGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroup = (string) content.GetValueForProperty("NodeResourceGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroup, global::System.Convert.ToString); + } + if (content.Contains("EnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnableRbac = (bool?) content.GetValueForProperty("EnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SupportPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SupportPlan = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan?) content.GetValueForProperty("SupportPlan",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SupportPlan, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan.CreateFrom); + } + if (content.Contains("EnablePodSecurityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnablePodSecurityPolicy = (bool?) content.GetValueForProperty("EnablePodSecurityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnablePodSecurityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNamespaceResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnableNamespaceResource = (bool?) content.GetValueForProperty("EnableNamespaceResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).EnableNamespaceResource, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskEncryptionSetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskEncryptionSetId = (string) content.GetValueForProperty("DiskEncryptionSetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskEncryptionSetId, global::System.Convert.ToString); + } + if (content.Contains("IdentityProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile) content.GetValueForProperty("IdentityProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesIdentityProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PrivateLinkResource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[]) content.GetValueForProperty("PrivateLinkResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PrivateLinkResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResourceTypeConverter.ConvertFrom)); + } + if (content.Contains("DisableLocalAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DisableLocalAccount = (bool?) content.GetValueForProperty("DisableLocalAccount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DisableLocalAccount, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("ResourceUid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ResourceUid = (string) content.GetValueForProperty("ResourceUid",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ResourceUid, global::System.Convert.ToString); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfileTypeConverter.ConvertFrom); + } + if (content.Contains("PowerStateCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PowerStateCode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("PowerStateCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PowerStateCode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + if (content.Contains("WindowProfileLicenseType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileLicenseType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType?) content.GetValueForProperty("WindowProfileLicenseType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileLicenseType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType.CreateFrom); + } + if (content.Contains("NodeResourceGroupProfileRestrictionLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroupProfileRestrictionLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel?) content.GetValueForProperty("NodeResourceGroupProfileRestrictionLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeResourceGroupProfileRestrictionLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel.CreateFrom); + } + if (content.Contains("AutoUpgradeProfileUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfileUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel?) content.GetValueForProperty("AutoUpgradeProfileUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfileUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel.CreateFrom); + } + if (content.Contains("AutoScalerProfileExpander")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileExpander = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander?) content.GetValueForProperty("AutoScalerProfileExpander",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileExpander, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander.CreateFrom); + } + if (content.Contains("SafeguardProfileVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileVersion = (string) content.GetValueForProperty("SafeguardProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileVersion, global::System.Convert.ToString); + } + if (content.Contains("SafeguardProfileLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileLevel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) content.GetValueForProperty("SafeguardProfileLevel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileLevel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level.CreateFrom); + } + if (content.Contains("SafeguardProfileExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileExcludedNamespace = (string[]) content.GetValueForProperty("SafeguardProfileExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BootstrapProfileArtifactSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfileArtifactSource = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource?) content.GetValueForProperty("BootstrapProfileArtifactSource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfileArtifactSource, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource.CreateFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("LinuxProfileSsh")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfileSsh = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration) content.GetValueForProperty("LinuxProfileSsh",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfileSsh, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("LinuxProfileAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfileAdminUsername = (string) content.GetValueForProperty("LinuxProfileAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).LinuxProfileAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileGmsaProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileGmsaProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile) content.GetValueForProperty("WindowProfileGmsaProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileGmsaProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfileTypeConverter.ConvertFrom); + } + if (content.Contains("WindowProfileAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileAdminUsername = (string) content.GetValueForProperty("WindowProfileAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileAdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileAdminPassword = (string) content.GetValueForProperty("WindowProfileAdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileAdminPassword, global::System.Convert.ToString); + } + if (content.Contains("WindowProfileEnableCsiProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileEnableCsiProxy = (bool?) content.GetValueForProperty("WindowProfileEnableCsiProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WindowProfileEnableCsiProxy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServicePrincipalProfileClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfileClientId = (string) content.GetValueForProperty("ServicePrincipalProfileClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfileClientId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalProfileSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfileSecret = (string) content.GetValueForProperty("ServicePrincipalProfileSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServicePrincipalProfileSecret, global::System.Convert.ToString); + } + if (content.Contains("PodIdentityProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileEnabled = (bool?) content.GetValueForProperty("PodIdentityProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PodIdentityProfileAllowNetworkPluginKubenet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileAllowNetworkPluginKubenet = (bool?) content.GetValueForProperty("PodIdentityProfileAllowNetworkPluginKubenet",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileAllowNetworkPluginKubenet, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PodIdentityProfileUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[]) content.GetValueForProperty("PodIdentityProfileUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileUserAssignedIdentity, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityTypeConverter.ConvertFrom)); + } + if (content.Contains("PodIdentityProfileUserAssignedIdentityException")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileUserAssignedIdentityException = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[]) content.GetValueForProperty("PodIdentityProfileUserAssignedIdentityException",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PodIdentityProfileUserAssignedIdentityException, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityExceptionTypeConverter.ConvertFrom)); + } + if (content.Contains("OidcIssuerProfileIssuerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfileIssuerUrl = (string) content.GetValueForProperty("OidcIssuerProfileIssuerUrl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfileIssuerUrl, global::System.Convert.ToString); + } + if (content.Contains("OidcIssuerProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfileEnabled = (bool?) content.GetValueForProperty("OidcIssuerProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OidcIssuerProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileManaged")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileManaged = (bool?) content.GetValueForProperty("AadProfileManaged",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileEnableAzureRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileEnableAzureRbac = (bool?) content.GetValueForProperty("AadProfileEnableAzureRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileEnableAzureRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AadProfileAdminGroupObjectID")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileAdminGroupObjectID = (string[]) content.GetValueForProperty("AadProfileAdminGroupObjectID",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileAdminGroupObjectID, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AadProfileClientAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileClientAppId = (string) content.GetValueForProperty("AadProfileClientAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileClientAppId, global::System.Convert.ToString); + } + if (content.Contains("AadProfileServerAppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileServerAppId = (string) content.GetValueForProperty("AadProfileServerAppId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileServerAppId, global::System.Convert.ToString); + } + if (content.Contains("AadProfileServerAppSecret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileServerAppSecret = (string) content.GetValueForProperty("AadProfileServerAppSecret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileServerAppSecret, global::System.Convert.ToString); + } + if (content.Contains("AadProfileTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileTenantId = (string) content.GetValueForProperty("AadProfileTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AadProfileTenantId, global::System.Convert.ToString); + } + if (content.Contains("AutoUpgradeProfileNodeOSUpgradeChannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfileNodeOSUpgradeChannel = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel?) content.GetValueForProperty("AutoUpgradeProfileNodeOSUpgradeChannel",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoUpgradeProfileNodeOSUpgradeChannel, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel.CreateFrom); + } + if (content.Contains("UpgradeSettingOverrideSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).UpgradeSettingOverrideSetting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings) content.GetValueForProperty("UpgradeSettingOverrideSetting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).UpgradeSettingOverrideSetting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UpgradeOverrideSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AutoScalerProfileBalanceSimilarNodeGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileBalanceSimilarNodeGroup = (string) content.GetValueForProperty("AutoScalerProfileBalanceSimilarNodeGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileBalanceSimilarNodeGroup, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileDaemonsetEvictionForEmptyNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileDaemonsetEvictionForEmptyNode = (bool?) content.GetValueForProperty("AutoScalerProfileDaemonsetEvictionForEmptyNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileDaemonsetEvictionForEmptyNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileDaemonsetEvictionForOccupiedNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileDaemonsetEvictionForOccupiedNode = (bool?) content.GetValueForProperty("AutoScalerProfileDaemonsetEvictionForOccupiedNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileDaemonsetEvictionForOccupiedNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileIgnoreDaemonsetsUtilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileIgnoreDaemonsetsUtilization = (bool?) content.GetValueForProperty("AutoScalerProfileIgnoreDaemonsetsUtilization",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileIgnoreDaemonsetsUtilization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoScalerProfileMaxEmptyBulkDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxEmptyBulkDelete = (string) content.GetValueForProperty("AutoScalerProfileMaxEmptyBulkDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxEmptyBulkDelete, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxGracefulTerminationSec")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxGracefulTerminationSec = (string) content.GetValueForProperty("AutoScalerProfileMaxGracefulTerminationSec",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxGracefulTerminationSec, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxNodeProvisionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxNodeProvisionTime = (string) content.GetValueForProperty("AutoScalerProfileMaxNodeProvisionTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxNodeProvisionTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileMaxTotalUnreadyPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxTotalUnreadyPercentage = (string) content.GetValueForProperty("AutoScalerProfileMaxTotalUnreadyPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileMaxTotalUnreadyPercentage, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileNewPodScaleUpDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileNewPodScaleUpDelay = (string) content.GetValueForProperty("AutoScalerProfileNewPodScaleUpDelay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileNewPodScaleUpDelay, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileOkTotalUnreadyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileOkTotalUnreadyCount = (string) content.GetValueForProperty("AutoScalerProfileOkTotalUnreadyCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileOkTotalUnreadyCount, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScanInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScanInterval = (string) content.GetValueForProperty("AutoScalerProfileScanInterval",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScanInterval, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterAdd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterAdd = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterAdd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterAdd, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterDelete = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterDelete, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownDelayAfterFailure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterFailure = (string) content.GetValueForProperty("AutoScalerProfileScaleDownDelayAfterFailure",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownDelayAfterFailure, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUnneededTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUnneededTime = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUnneededTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUnneededTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUnreadyTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUnreadyTime = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUnreadyTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUnreadyTime, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileScaleDownUtilizationThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUtilizationThreshold = (string) content.GetValueForProperty("AutoScalerProfileScaleDownUtilizationThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileScaleDownUtilizationThreshold, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileSkipNodesWithLocalStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileSkipNodesWithLocalStorage = (string) content.GetValueForProperty("AutoScalerProfileSkipNodesWithLocalStorage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileSkipNodesWithLocalStorage, global::System.Convert.ToString); + } + if (content.Contains("AutoScalerProfileSkipNodesWithSystemPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileSkipNodesWithSystemPod = (string) content.GetValueForProperty("AutoScalerProfileSkipNodesWithSystemPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoScalerProfileSkipNodesWithSystemPod, global::System.Convert.ToString); + } + if (content.Contains("ApiServerAccessProfileAuthorizedIPRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileAuthorizedIPRange = (string[]) content.GetValueForProperty("ApiServerAccessProfileAuthorizedIPRange",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileAuthorizedIPRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiServerAccessProfileEnablePrivateCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnablePrivateCluster = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnablePrivateCluster",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnablePrivateCluster, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfilePrivateDnsZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfilePrivateDnsZone = (string) content.GetValueForProperty("ApiServerAccessProfilePrivateDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfilePrivateDnsZone, global::System.Convert.ToString); + } + if (content.Contains("ApiServerAccessProfileEnablePrivateClusterPublicFqdn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnablePrivateClusterPublicFqdn = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnablePrivateClusterPublicFqdn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnablePrivateClusterPublicFqdn, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileDisableRunCommand")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileDisableRunCommand = (bool?) content.GetValueForProperty("ApiServerAccessProfileDisableRunCommand",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileDisableRunCommand, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileEnableVnetIntegration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnableVnetIntegration = (bool?) content.GetValueForProperty("ApiServerAccessProfileEnableVnetIntegration",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileEnableVnetIntegration, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ApiServerAccessProfileSubnetId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileSubnetId = (string) content.GetValueForProperty("ApiServerAccessProfileSubnetId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ApiServerAccessProfileSubnetId, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigHttpProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigHttpProxy = (string) content.GetValueForProperty("HttpProxyConfigHttpProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigHttpProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigHttpsProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigHttpsProxy = (string) content.GetValueForProperty("HttpProxyConfigHttpsProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigHttpsProxy, global::System.Convert.ToString); + } + if (content.Contains("HttpProxyConfigNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigNoProxy = (string[]) content.GetValueForProperty("HttpProxyConfigNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("HttpProxyConfigEffectiveNoProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigEffectiveNoProxy = (string[]) content.GetValueForProperty("HttpProxyConfigEffectiveNoProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigEffectiveNoProxy, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("HttpProxyConfigTrustedCa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigTrustedCa = (string) content.GetValueForProperty("HttpProxyConfigTrustedCa",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).HttpProxyConfigTrustedCa, global::System.Convert.ToString); + } + if (content.Contains("SecurityProfileDefender")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileDefender = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender) content.GetValueForProperty("SecurityProfileDefender",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileDefender, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileAzureKeyVaultKm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileAzureKeyVaultKm = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms) content.GetValueForProperty("SecurityProfileAzureKeyVaultKm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileAzureKeyVaultKm, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKmsTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileWorkloadIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileWorkloadIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity) content.GetValueForProperty("SecurityProfileWorkloadIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileWorkloadIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileImageCleaner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileImageCleaner = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner) content.GetValueForProperty("SecurityProfileImageCleaner",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileImageCleaner, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleanerTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileImageIntegrity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileImageIntegrity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity) content.GetValueForProperty("SecurityProfileImageIntegrity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileImageIntegrity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrityTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileNodeRestriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileNodeRestriction = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction) content.GetValueForProperty("SecurityProfileNodeRestriction",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileNodeRestriction, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestrictionTypeConverter.ConvertFrom); + } + if (content.Contains("SecurityProfileCustomCaTrustCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileCustomCaTrustCertificate = (byte[][]) content.GetValueForProperty("SecurityProfileCustomCaTrustCertificate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityProfileCustomCaTrustCertificate, __y => TypeConverterExtensions.SelectToArray(__y, i => i)); + } + if (content.Contains("AzureKeyVaultKmKeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyId, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileDiskCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileDiskCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver) content.GetValueForProperty("StorageProfileDiskCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileDiskCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileFileCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileFileCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver) content.GetValueForProperty("StorageProfileFileCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileFileCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileSnapshotController")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileSnapshotController = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController) content.GetValueForProperty("StorageProfileSnapshotController",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileSnapshotController, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotControllerTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileBlobCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileBlobCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver) content.GetValueForProperty("StorageProfileBlobCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).StorageProfileBlobCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("IngressProfileWebAppRouting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IngressProfileWebAppRouting = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting) content.GetValueForProperty("IngressProfileWebAppRouting",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IngressProfileWebAppRouting, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfileWebAppRoutingTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfileKeda")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfileKeda = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda) content.GetValueForProperty("WorkloadAutoScalerProfileKeda",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfileKeda, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKedaTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadAutoScalerProfileVerticalPodAutoscaler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfileVerticalPodAutoscaler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler) content.GetValueForProperty("WorkloadAutoScalerProfileVerticalPodAutoscaler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadAutoScalerProfileVerticalPodAutoscaler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTypeConverter.ConvertFrom); + } + if (content.Contains("VerticalPodAutoscalerAddonAutoscaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).VerticalPodAutoscalerAddonAutoscaling = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling?) content.GetValueForProperty("VerticalPodAutoscalerAddonAutoscaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).VerticalPodAutoscalerAddonAutoscaling, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling.CreateFrom); + } + if (content.Contains("AzureMonitorProfileMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics) content.GetValueForProperty("AzureMonitorProfileMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfileContainerInsight")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileContainerInsight = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights) content.GetValueForProperty("AzureMonitorProfileContainerInsight",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileContainerInsight, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileContainerInsightsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureMonitorProfileAppMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileAppMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring) content.GetValueForProperty("AzureMonitorProfileAppMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureMonitorProfileAppMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("SafeguardProfileSystemExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileSystemExcludedNamespace = (string[]) content.GetValueForProperty("SafeguardProfileSystemExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SafeguardProfileSystemExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceMeshProfileIstio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfileIstio = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh) content.GetValueForProperty("ServiceMeshProfileIstio",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfileIstio, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMeshTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceMeshProfileMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfileMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) content.GetValueForProperty("ServiceMeshProfileMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ServiceMeshProfileMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode.CreateFrom); + } + if (content.Contains("IstioComponent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioComponent = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents) content.GetValueForProperty("IstioComponent",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioComponent, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponentsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioCertificateAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioCertificateAuthority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority) content.GetValueForProperty("IstioCertificateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioCertificateAuthority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("MetricProfileCostAnalysis")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricProfileCostAnalysis = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis) content.GetValueForProperty("MetricProfileCostAnalysis",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricProfileCostAnalysis, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterCostAnalysisTypeConverter.ConvertFrom); + } + if (content.Contains("AiToolchainOperatorProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AiToolchainOperatorProfileEnabled = (bool?) content.GetValueForProperty("AiToolchainOperatorProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AiToolchainOperatorProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeProvisioningProfileMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeProvisioningProfileMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode?) content.GetValueForProperty("NodeProvisioningProfileMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeProvisioningProfileMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode.CreateFrom); + } + if (content.Contains("BootstrapProfileContainerRegistryId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfileContainerRegistryId = (string) content.GetValueForProperty("BootstrapProfileContainerRegistryId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BootstrapProfileContainerRegistryId, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceSshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("GmsaProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileEnabled = (bool?) content.GetValueForProperty("GmsaProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GmsaProfileDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileDnsServer = (string) content.GetValueForProperty("GmsaProfileDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileDnsServer, global::System.Convert.ToString); + } + if (content.Contains("GmsaProfileRootDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileRootDomainName = (string) content.GetValueForProperty("GmsaProfileRootDomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).GmsaProfileRootDomainName, global::System.Convert.ToString); + } + if (content.Contains("OverrideSettingForceUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OverrideSettingForceUpgrade = (bool?) content.GetValueForProperty("OverrideSettingForceUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OverrideSettingForceUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OverrideSettingUntil")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OverrideSettingUntil = (global::System.DateTime?) content.GetValueForProperty("OverrideSettingUntil",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OverrideSettingUntil, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DefenderSecurityMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DefenderSecurityMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring) content.GetValueForProperty("DefenderSecurityMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DefenderSecurityMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("DefenderLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DefenderLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("DefenderLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DefenderLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureKeyVaultKmEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmEnabled = (bool?) content.GetValueForProperty("AzureKeyVaultKmEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureKeyVaultKmKeyVaultNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes?) content.GetValueForProperty("AzureKeyVaultKmKeyVaultNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes.CreateFrom); + } + if (content.Contains("AzureKeyVaultKmKeyVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyVaultResourceId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AzureKeyVaultKmKeyVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("WorkloadIdentityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadIdentityEnabled = (bool?) content.GetValueForProperty("WorkloadIdentityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WorkloadIdentityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageCleanerEnabled = (bool?) content.GetValueForProperty("ImageCleanerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageCleanerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerIntervalHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageCleanerIntervalHour = (int?) content.GetValueForProperty("ImageCleanerIntervalHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageCleanerIntervalHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImageIntegrityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageIntegrityEnabled = (bool?) content.GetValueForProperty("ImageIntegrityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ImageIntegrityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeRestrictionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeRestrictionEnabled = (bool?) content.GetValueForProperty("NodeRestrictionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).NodeRestrictionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskCsiDriverEnabled = (bool?) content.GetValueForProperty("DiskCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskCsiDriverVersion = (string) content.GetValueForProperty("DiskCsiDriverVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).DiskCsiDriverVersion, global::System.Convert.ToString); + } + if (content.Contains("FileCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).FileCsiDriverEnabled = (bool?) content.GetValueForProperty("FileCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).FileCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SnapshotControllerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SnapshotControllerEnabled = (bool?) content.GetValueForProperty("SnapshotControllerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SnapshotControllerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BlobCsiDriverEnabled = (bool?) content.GetValueForProperty("BlobCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).BlobCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity) content.GetValueForProperty("WebAppRoutingIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("WebAppRoutingEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingEnabled = (bool?) content.GetValueForProperty("WebAppRoutingEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("WebAppRoutingDnsZoneResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingDnsZoneResourceId = (string[]) content.GetValueForProperty("WebAppRoutingDnsZoneResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).WebAppRoutingDnsZoneResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("KedaEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KedaEnabled = (bool) content.GetValueForProperty("KedaEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KedaEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VerticalPodAutoscalerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).VerticalPodAutoscalerEnabled = (bool) content.GetValueForProperty("VerticalPodAutoscalerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).VerticalPodAutoscalerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MetricKubeStateMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricKubeStateMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics) content.GetValueForProperty("MetricKubeStateMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricKubeStateMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileKubeStateMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("MetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricEnabled = (bool) content.GetValueForProperty("MetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).MetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightEnabled = (bool?) content.GetValueForProperty("ContainerInsightEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("ContainerInsightLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ContainerInsightSyslogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightSyslogPort = (long?) content.GetValueForProperty("ContainerInsightSyslogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightSyslogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ContainerInsightDisableCustomMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightDisableCustomMetric = (bool?) content.GetValueForProperty("ContainerInsightDisableCustomMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightDisableCustomMetric, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerInsightDisablePrometheusMetricsScraping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightDisablePrometheusMetricsScraping = (bool?) content.GetValueForProperty("ContainerInsightDisablePrometheusMetricsScraping",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ContainerInsightDisablePrometheusMetricsScraping, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AppMonitoringAutoInstrumentation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringAutoInstrumentation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) content.GetValueForProperty("AppMonitoringAutoInstrumentation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringAutoInstrumentation, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentationTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringOpenTelemetryMetric = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) content.GetValueForProperty("AppMonitoringOpenTelemetryMetric",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringOpenTelemetryMetric, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("AppMonitoringOpenTelemetryLog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringOpenTelemetryLog = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) content.GetValueForProperty("AppMonitoringOpenTelemetryLog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AppMonitoringOpenTelemetryLog, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioRevision = (string[]) content.GetValueForProperty("IstioRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IstioRevision, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ComponentIngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ComponentIngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("ComponentIngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ComponentIngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("ComponentEgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ComponentEgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("ComponentEgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).ComponentEgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("CostAnalysisEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CostAnalysisEnabled = (bool?) content.GetValueForProperty("CostAnalysisEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CostAnalysisEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityMonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityMonitoringEnabled = (bool?) content.GetValueForProperty("SecurityMonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).SecurityMonitoringEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityResourceId = (string) content.GetValueForProperty("IdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("IdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityClientId = (string) content.GetValueForProperty("IdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("IdentityObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityObjectId = (string) content.GetValueForProperty("IdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).IdentityObjectId, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricLabelsAllowlist")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubeStateMetricLabelsAllowlist = (string) content.GetValueForProperty("KubeStateMetricLabelsAllowlist",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubeStateMetricLabelsAllowlist, global::System.Convert.ToString); + } + if (content.Contains("KubeStateMetricAnnotationsAllowList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubeStateMetricAnnotationsAllowList = (string) content.GetValueForProperty("KubeStateMetricAnnotationsAllowList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).KubeStateMetricAnnotationsAllowList, global::System.Convert.ToString); + } + if (content.Contains("AutoInstrumentationEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoInstrumentationEnabled = (bool?) content.GetValueForProperty("AutoInstrumentationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).AutoInstrumentationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryMetricEnabled = (bool?) content.GetValueForProperty("OpenTelemetryMetricEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryMetricEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryMetricPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryMetricPort = (long?) content.GetValueForProperty("OpenTelemetryMetricPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryMetricPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("OpenTelemetryLogEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryLogEnabled = (bool?) content.GetValueForProperty("OpenTelemetryLogEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryLogEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("OpenTelemetryLogPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryLogPort = (long?) content.GetValueForProperty("OpenTelemetryLogPort",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).OpenTelemetryLogPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CertificateAuthorityPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CertificateAuthorityPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("CertificateAuthorityPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).CertificateAuthorityPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal)this).PluginCertChainObjectName, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesTypeConverter))] + public partial interface IManagedClusterProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.TypeConverter.cs new file mode 100644 index 000000000000..ba7506ba16d0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.cs new file mode 100644 index 000000000000..0361500faa19 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.cs @@ -0,0 +1,3119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties of the managed cluster. + public partial class ManagedClusterProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile _aadProfile; + + /// The Azure Active Directory configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile AadProfile { get => (this._aadProfile = this._aadProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfile()); set => this._aadProfile = value; } + + /// The list of AAD group object IDs that will have admin role of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] AadProfileAdminGroupObjectID { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).AdminGroupObjectID; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).AdminGroupObjectID = value ?? null /* arrayOf */; } + + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AadProfileClientAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).ClientAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).ClientAppId = value ?? null; } + + /// Whether to enable Azure RBAC for Kubernetes authorization. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AadProfileEnableAzureRbac { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).EnableAzureRbac; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).EnableAzureRbac = value ?? default(bool); } + + /// Whether to enable managed AAD. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AadProfileManaged { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).Managed; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).Managed = value ?? default(bool); } + + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AadProfileServerAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).ServerAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).ServerAppId = value ?? null; } + + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AadProfileServerAppSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).ServerAppSecret; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).ServerAppSecret = value ?? null; } + + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AadProfileTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfileInternal)AadProfile).TenantId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles _addonProfile; + + /// The profile of managed cluster add-on. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles AddonProfile { get => (this._addonProfile = this._addonProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAddonProfiles()); set => this._addonProfile = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[] _agentPoolProfile; + + /// The agent pool properties. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[] AgentPoolProfile { get => this._agentPoolProfile; set => this._agentPoolProfile = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile _aiToolchainOperatorProfile; + + /// AI toolchain operator settings that apply to the whole cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile AiToolchainOperatorProfile { get => (this._aiToolchainOperatorProfile = this._aiToolchainOperatorProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAiToolchainOperatorProfile()); set => this._aiToolchainOperatorProfile = value; } + + /// Indicates if AI toolchain operator enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AiToolchainOperatorProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfileInternal)AiToolchainOperatorProfile).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfileInternal)AiToolchainOperatorProfile).Enabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile _apiServerAccessProfile; + + /// The access profile for managed cluster API server. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile ApiServerAccessProfile { get => (this._apiServerAccessProfile = this._apiServerAccessProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterApiServerAccessProfile()); set => this._apiServerAccessProfile = value; } + + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] ApiServerAccessProfileAuthorizedIPRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).AuthorizedIPRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).AuthorizedIPRange = value ?? null /* arrayOf */; } + + /// Whether to disable run command for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ApiServerAccessProfileDisableRunCommand { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).DisableRunCommand; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).DisableRunCommand = value ?? default(bool); } + + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ApiServerAccessProfileEnablePrivateCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).EnablePrivateCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).EnablePrivateCluster = value ?? default(bool); } + + /// Whether to create additional public FQDN for private cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ApiServerAccessProfileEnablePrivateClusterPublicFqdn { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).EnablePrivateClusterPublicFqdn; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).EnablePrivateClusterPublicFqdn = value ?? default(bool); } + + /// Whether to enable apiserver vnet integration for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ApiServerAccessProfileEnableVnetIntegration { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).EnableVnetIntegration; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).EnableVnetIntegration = value ?? default(bool); } + + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ApiServerAccessProfilePrivateDnsZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).PrivateDnsZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).PrivateDnsZone = value ?? null; } + + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ApiServerAccessProfileSubnetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).SubnetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfileInternal)ApiServerAccessProfile).SubnetId = value ?? null; } + + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoInstrumentationEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AutoInstrumentationEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AutoInstrumentationEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile _autoScalerProfile; + + /// Parameters to be applied to the cluster-autoscaler when enabled + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile AutoScalerProfile { get => (this._autoScalerProfile = this._autoScalerProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAutoScalerProfile()); set => this._autoScalerProfile = value; } + + /// Valid values are 'true' and 'false' + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileBalanceSimilarNodeGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).BalanceSimilarNodeGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).BalanceSimilarNodeGroup = value ?? null; } + + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoScalerProfileDaemonsetEvictionForEmptyNode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).DaemonsetEvictionForEmptyNode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).DaemonsetEvictionForEmptyNode = value ?? default(bool); } + + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoScalerProfileDaemonsetEvictionForOccupiedNode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).DaemonsetEvictionForOccupiedNode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).DaemonsetEvictionForOccupiedNode = value ?? default(bool); } + + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? AutoScalerProfileExpander { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).Expander; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).Expander = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander)""); } + + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AutoScalerProfileIgnoreDaemonsetsUtilization { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).IgnoreDaemonsetsUtilization; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).IgnoreDaemonsetsUtilization = value ?? default(bool); } + + /// The default is 10. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileMaxEmptyBulkDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).MaxEmptyBulkDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).MaxEmptyBulkDelete = value ?? null; } + + /// The default is 600. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileMaxGracefulTerminationSec { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).MaxGracefulTerminationSec; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).MaxGracefulTerminationSec = value ?? null; } + + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileMaxNodeProvisionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).MaxNodeProvisionTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).MaxNodeProvisionTime = value ?? null; } + + /// The default is 45. The maximum is 100 and the minimum is 0. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileMaxTotalUnreadyPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).MaxTotalUnreadyPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).MaxTotalUnreadyPercentage = value ?? null; } + + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileNewPodScaleUpDelay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).NewPodScaleUpDelay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).NewPodScaleUpDelay = value ?? null; } + + /// This must be an integer. The default is 3. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileOkTotalUnreadyCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).OkTotalUnreadyCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).OkTotalUnreadyCount = value ?? null; } + + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownDelayAfterAdd { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownDelayAfterAdd; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownDelayAfterAdd = value ?? null; } + + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownDelayAfterDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownDelayAfterDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownDelayAfterDelete = value ?? null; } + + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownDelayAfterFailure { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownDelayAfterFailure; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownDelayAfterFailure = value ?? null; } + + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownUnneededTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownUnneededTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownUnneededTime = value ?? null; } + + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownUnreadyTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownUnreadyTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownUnreadyTime = value ?? null; } + + /// The default is '0.5'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScaleDownUtilizationThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownUtilizationThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScaleDownUtilizationThreshold = value ?? null; } + + /// The default is '10'. Values must be an integer number of seconds. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileScanInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScanInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).ScanInterval = value ?? null; } + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileSkipNodesWithLocalStorage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).SkipNodesWithLocalStorage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).SkipNodesWithLocalStorage = value ?? null; } + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AutoScalerProfileSkipNodesWithSystemPod { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).SkipNodesWithSystemPod; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)AutoScalerProfile).SkipNodesWithSystemPod = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile _autoUpgradeProfile; + + /// The auto upgrade configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile AutoUpgradeProfile { get => (this._autoUpgradeProfile = this._autoUpgradeProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAutoUpgradeProfile()); set => this._autoUpgradeProfile = value; } + + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? AutoUpgradeProfileNodeOSUpgradeChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)AutoUpgradeProfile).NodeOSUpgradeChannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)AutoUpgradeProfile).NodeOSUpgradeChannel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel)""); } + + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? AutoUpgradeProfileUpgradeChannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)AutoUpgradeProfile).UpgradeChannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfileInternal)AutoUpgradeProfile).UpgradeChannel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel)""); } + + /// Whether to enable Azure Key Vault key management service. The default is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AzureKeyVaultKmEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKmEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKmEnabled = value ?? default(bool); } + + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AzureKeyVaultKmKeyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKmKeyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKmKeyId = value ?? null; } + + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? AzureKeyVaultKmKeyVaultNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKmKeyVaultNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKmKeyVaultNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes)""); } + + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AzureKeyVaultKmKeyVaultResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKmKeyVaultResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKmKeyVaultResourceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile _azureMonitorProfile; + + /// Prometheus addon profile for the container service cluster + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile AzureMonitorProfile { get => (this._azureMonitorProfile = this._azureMonitorProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfile()); set => this._azureMonitorProfile = value; } + + /// Backing field for property. + private string _azurePortalFqdn; + + /// + /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes + /// APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string AzurePortalFqdn { get => this._azurePortalFqdn; } + + /// Whether to enable AzureBlob CSI Driver. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? BlobCsiDriverEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).BlobCsiDriverEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).BlobCsiDriverEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile _bootstrapProfile; + + /// Profile of the cluster bootstrap configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile BootstrapProfile { get => (this._bootstrapProfile = this._bootstrapProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterBootstrapProfile()); set => this._bootstrapProfile = value; } + + /// The source where the artifacts are downloaded from. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? BootstrapProfileArtifactSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)BootstrapProfile).ArtifactSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)BootstrapProfile).ArtifactSource = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource)""); } + + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string BootstrapProfileContainerRegistryId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)BootstrapProfile).ContainerRegistryId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfileInternal)BootstrapProfile).ContainerRegistryId = value ?? null; } + + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).ComponentEgressGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).ComponentEgressGateway = value ?? null /* arrayOf */; } + + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).ComponentIngressGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).ComponentIngressGateway = value ?? null /* arrayOf */; } + + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ContainerInsightDisableCustomMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightDisableCustomMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightDisableCustomMetric = value ?? default(bool); } + + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ContainerInsightDisablePrometheusMetricsScraping { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightDisablePrometheusMetricsScraping; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightDisablePrometheusMetricsScraping = value ?? default(bool); } + + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ContainerInsightEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightEnabled = value ?? default(bool); } + + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ContainerInsightLogAnalyticsWorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightLogAnalyticsWorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightLogAnalyticsWorkspaceResourceId = value ?? null; } + + /// The syslog host port. If not specified, the default port is 28330. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? ContainerInsightSyslogPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightSyslogPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsightSyslogPort = value ?? default(long); } + + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? CostAnalysisEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)MetricsProfile).CostAnalysisEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)MetricsProfile).CostAnalysisEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData _creationData; + + /// + /// CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get => (this._creationData = this._creationData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData()); set => this._creationData = value; } + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CreationDataSourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)CreationData).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)CreationData).SourceResourceId = value ?? null; } + + /// Backing field for property. + private string _currentKubernetesVersion; + + /// The version of Kubernetes the Managed Cluster is running. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string CurrentKubernetesVersion { get => this._currentKubernetesVersion; } + + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DefenderLogAnalyticsWorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).DefenderLogAnalyticsWorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).DefenderLogAnalyticsWorkspaceResourceId = value ?? null; } + + /// Backing field for property. + private bool? _disableLocalAccount; + + /// + /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + /// that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? DisableLocalAccount { get => this._disableLocalAccount; set => this._disableLocalAccount = value; } + + /// Whether to enable AzureDisk CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? DiskCsiDriverEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).DiskCsiDriverEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).DiskCsiDriverEnabled = value ?? default(bool); } + + /// The version of AzureDisk CSI Driver. The default value is v1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DiskCsiDriverVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).DiskCsiDriverVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).DiskCsiDriverVersion = value ?? null; } + + /// Backing field for property. + private string _diskEncryptionSetId; + + /// + /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string DiskEncryptionSetId { get => this._diskEncryptionSetId; set => this._diskEncryptionSetId = value; } + + /// Backing field for property. + private string _dnsPrefix; + + /// This cannot be updated once the Managed Cluster has been created. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string DnsPrefix { get => this._dnsPrefix; set => this._dnsPrefix = value; } + + /// Backing field for property. + private bool? _enableNamespaceResource; + + /// + /// The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) + /// for more details on Namespace as a ARM Resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableNamespaceResource { get => this._enableNamespaceResource; set => this._enableNamespaceResource = value; } + + /// Backing field for property. + private bool? _enablePodSecurityPolicy; + + /// + /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes + /// v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnablePodSecurityPolicy { get => this._enablePodSecurityPolicy; set => this._enablePodSecurityPolicy = value; } + + /// Backing field for property. + private bool? _enableRbac; + + /// Whether to enable Kubernetes Role-Based Access Control. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableRbac { get => this._enableRbac; set => this._enableRbac = value; } + + /// Whether to enable AzureFile CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? FileCsiDriverEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).FileCsiDriverEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).FileCsiDriverEnabled = value ?? default(bool); } + + /// Backing field for property. + private string _fqdn; + + /// The FQDN of the master pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Fqdn { get => this._fqdn; } + + /// Backing field for property. + private string _fqdnSubdomain; + + /// This cannot be updated once the Managed Cluster has been created. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string FqdnSubdomain { get => this._fqdnSubdomain; set => this._fqdnSubdomain = value; } + + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string GmsaProfileDnsServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).GmsaProfileDnsServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).GmsaProfileDnsServer = value ?? null; } + + /// Specifies whether to enable Windows gMSA in the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? GmsaProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).GmsaProfileEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).GmsaProfileEnabled = value ?? default(bool); } + + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string GmsaProfileRootDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).GmsaProfileRootDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).GmsaProfileRootDomainName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig _httpProxyConfig; + + /// Configurations for provisioning the cluster with HTTP proxy servers. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig HttpProxyConfig { get => (this._httpProxyConfig = this._httpProxyConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterHttpProxyConfig()); set => this._httpProxyConfig = value; } + + /// + /// A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy + /// and values injected by AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] HttpProxyConfigEffectiveNoProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).EffectiveNoProxy; } + + /// The HTTP proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string HttpProxyConfigHttpProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).HttpProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).HttpProxy = value ?? null; } + + /// The HTTPS proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string HttpProxyConfigHttpsProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).HttpsProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).HttpsProxy = value ?? null; } + + /// The endpoints that should not go through proxy. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] HttpProxyConfigNoProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).NoProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).NoProxy = value ?? null /* arrayOf */; } + + /// Alternative CA cert to use for connecting to proxy servers. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string HttpProxyConfigTrustedCa { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).TrustedCa; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).TrustedCa = value ?? null; } + + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).IdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).IdentityClientId = value ?? null; } + + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).IdentityObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).IdentityObjectId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile _identityProfile; + + /// Identities associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile IdentityProfile { get => (this._identityProfile = this._identityProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesIdentityProfile()); set => this._identityProfile = value; } + + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string IdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).IdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).IdentityResourceId = value ?? null; } + + /// Whether to enable Image Cleaner on AKS cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ImageCleanerEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageCleanerEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageCleanerEnabled = value ?? default(bool); } + + /// Image Cleaner scanning interval in hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ImageCleanerIntervalHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageCleanerIntervalHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageCleanerIntervalHour = value ?? default(int); } + + /// Whether to enable image integrity. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ImageIntegrityEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageIntegrityEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageIntegrityEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile _ingressProfile; + + /// Ingress profile for the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile IngressProfile { get => (this._ingressProfile = this._ingressProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfile()); set => this._ingressProfile = value; } + + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] IstioRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).IstioRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).IstioRevision = value ?? null /* arrayOf */; } + + /// Whether to enable KEDA. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? KedaEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).KedaEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).KedaEnabled = value ?? default(bool); } + + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeStateMetricAnnotationsAllowList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).KubeStateMetricAnnotationsAllowList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).KubeStateMetricAnnotationsAllowList = value ?? null; } + + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubeStateMetricLabelsAllowlist { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).KubeStateMetricLabelsAllowlist; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).KubeStateMetricLabelsAllowlist = value ?? null; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// + /// When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed + /// sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + /// however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile _linuxProfile; + + /// The profile for Linux VMs in the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile LinuxProfile { get => (this._linuxProfile = this._linuxProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceLinuxProfile()); set => this._linuxProfile = value; } + + /// The administrator username to use for Linux VMs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string LinuxProfileAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)LinuxProfile).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)LinuxProfile).AdminUsername = value ?? null; } + + /// Backing field for property. + private int? _maxAgentPool; + + /// The max number of agent pools for the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? MaxAgentPool { get => this._maxAgentPool; } + + /// Whether to enable the Prometheus collector + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? MetricEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).MetricEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).MetricEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile _metricsProfile; + + /// Optional cluster metrics configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile MetricsProfile { get => (this._metricsProfile = this._metricsProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterMetricsProfile()); set => this._metricsProfile = value; } + + /// Internal Acessors for AadProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AadProfile { get => (this._aadProfile = this._aadProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfile()); set { {_aadProfile = value;} } } + + /// Internal Acessors for AiToolchainOperatorProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AiToolchainOperatorProfile { get => (this._aiToolchainOperatorProfile = this._aiToolchainOperatorProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAiToolchainOperatorProfile()); set { {_aiToolchainOperatorProfile = value;} } } + + /// Internal Acessors for ApiServerAccessProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.ApiServerAccessProfile { get => (this._apiServerAccessProfile = this._apiServerAccessProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterApiServerAccessProfile()); set { {_apiServerAccessProfile = value;} } } + + /// Internal Acessors for AppMonitoringAutoInstrumentation + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AppMonitoringAutoInstrumentation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AppMonitoringAutoInstrumentation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AppMonitoringAutoInstrumentation = value; } + + /// Internal Acessors for AppMonitoringOpenTelemetryLog + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AppMonitoringOpenTelemetryLog { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AppMonitoringOpenTelemetryLog; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AppMonitoringOpenTelemetryLog = value; } + + /// Internal Acessors for AppMonitoringOpenTelemetryMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AppMonitoringOpenTelemetryMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AppMonitoringOpenTelemetryMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AppMonitoringOpenTelemetryMetric = value; } + + /// Internal Acessors for AutoScalerProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AutoScalerProfile { get => (this._autoScalerProfile = this._autoScalerProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAutoScalerProfile()); set { {_autoScalerProfile = value;} } } + + /// Internal Acessors for AutoUpgradeProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AutoUpgradeProfile { get => (this._autoUpgradeProfile = this._autoUpgradeProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAutoUpgradeProfile()); set { {_autoUpgradeProfile = value;} } } + + /// Internal Acessors for AzureMonitorProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AzureMonitorProfile { get => (this._azureMonitorProfile = this._azureMonitorProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfile()); set { {_azureMonitorProfile = value;} } } + + /// Internal Acessors for AzureMonitorProfileAppMonitoring + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AzureMonitorProfileAppMonitoring { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AppMonitoring; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).AppMonitoring = value; } + + /// Internal Acessors for AzureMonitorProfileContainerInsight + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AzureMonitorProfileContainerInsight { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsight; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).ContainerInsight = value; } + + /// Internal Acessors for AzureMonitorProfileMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AzureMonitorProfileMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).Metric = value; } + + /// Internal Acessors for AzurePortalFqdn + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.AzurePortalFqdn { get => this._azurePortalFqdn; set { {_azurePortalFqdn = value;} } } + + /// Internal Acessors for BootstrapProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.BootstrapProfile { get => (this._bootstrapProfile = this._bootstrapProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterBootstrapProfile()); set { {_bootstrapProfile = value;} } } + + /// Internal Acessors for CertificateAuthorityPlugin + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.CertificateAuthorityPlugin { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).CertificateAuthorityPlugin; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).CertificateAuthorityPlugin = value; } + + /// Internal Acessors for CreationData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.CreationData { get => (this._creationData = this._creationData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData()); set { {_creationData = value;} } } + + /// Internal Acessors for CurrentKubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.CurrentKubernetesVersion { get => this._currentKubernetesVersion; set { {_currentKubernetesVersion = value;} } } + + /// Internal Acessors for DefenderSecurityMonitoring + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.DefenderSecurityMonitoring { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).DefenderSecurityMonitoring; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).DefenderSecurityMonitoring = value; } + + /// Internal Acessors for Fqdn + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.Fqdn { get => this._fqdn; set { {_fqdn = value;} } } + + /// Internal Acessors for HttpProxyConfig + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.HttpProxyConfig { get => (this._httpProxyConfig = this._httpProxyConfig ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterHttpProxyConfig()); set { {_httpProxyConfig = value;} } } + + /// Internal Acessors for HttpProxyConfigEffectiveNoProxy + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.HttpProxyConfigEffectiveNoProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).EffectiveNoProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfigInternal)HttpProxyConfig).EffectiveNoProxy = value; } + + /// Internal Acessors for IngressProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.IngressProfile { get => (this._ingressProfile = this._ingressProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfile()); set { {_ingressProfile = value;} } } + + /// Internal Acessors for IngressProfileWebAppRouting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.IngressProfileWebAppRouting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).WebAppRouting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).WebAppRouting = value; } + + /// Internal Acessors for IstioCertificateAuthority + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.IstioCertificateAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).IstioCertificateAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).IstioCertificateAuthority = value; } + + /// Internal Acessors for IstioComponent + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.IstioComponent { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).IstioComponent; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).IstioComponent = value; } + + /// Internal Acessors for LinuxProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.LinuxProfile { get => (this._linuxProfile = this._linuxProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceLinuxProfile()); set { {_linuxProfile = value;} } } + + /// Internal Acessors for LinuxProfileSsh + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.LinuxProfileSsh { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)LinuxProfile).Ssh; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)LinuxProfile).Ssh = value; } + + /// Internal Acessors for MaxAgentPool + int? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.MaxAgentPool { get => this._maxAgentPool; set { {_maxAgentPool = value;} } } + + /// Internal Acessors for MetricKubeStateMetric + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.MetricKubeStateMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).MetricKubeStateMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).MetricKubeStateMetric = value; } + + /// Internal Acessors for MetricProfileCostAnalysis + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.MetricProfileCostAnalysis { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)MetricsProfile).CostAnalysis; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfileInternal)MetricsProfile).CostAnalysis = value; } + + /// Internal Acessors for MetricsProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.MetricsProfile { get => (this._metricsProfile = this._metricsProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterMetricsProfile()); set { {_metricsProfile = value;} } } + + /// Internal Acessors for NodeProvisioningProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.NodeProvisioningProfile { get => (this._nodeProvisioningProfile = this._nodeProvisioningProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeProvisioningProfile()); set { {_nodeProvisioningProfile = value;} } } + + /// Internal Acessors for NodeResourceGroupProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.NodeResourceGroupProfile { get => (this._nodeResourceGroupProfile = this._nodeResourceGroupProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeResourceGroupProfile()); set { {_nodeResourceGroupProfile = value;} } } + + /// Internal Acessors for OidcIssuerProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.OidcIssuerProfile { get => (this._oidcIssuerProfile = this._oidcIssuerProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterOidcIssuerProfile()); set { {_oidcIssuerProfile = value;} } } + + /// Internal Acessors for OidcIssuerProfileIssuerUrl + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.OidcIssuerProfileIssuerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)OidcIssuerProfile).IssuerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)OidcIssuerProfile).IssuerUrl = value; } + + /// Internal Acessors for PodIdentityProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.PodIdentityProfile { get => (this._podIdentityProfile = this._podIdentityProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProfile()); set { {_podIdentityProfile = value;} } } + + /// Internal Acessors for PowerState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.PowerState { get => (this._powerState = this._powerState ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerState()); set { {_powerState = value;} } } + + /// Internal Acessors for PrivateFqdn + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.PrivateFqdn { get => this._privateFqdn; set { {_privateFqdn = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for ResourceUid + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.ResourceUid { get => this._resourceUid; set { {_resourceUid = value;} } } + + /// Internal Acessors for SafeguardProfileSystemExcludedNamespace + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.SafeguardProfileSystemExcludedNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)SafeguardsProfile).SystemExcludedNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)SafeguardsProfile).SystemExcludedNamespace = value; } + + /// Internal Acessors for SafeguardsProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.SafeguardsProfile { get => (this._safeguardsProfile = this._safeguardsProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsProfile()); set { {_safeguardsProfile = value;} } } + + /// Internal Acessors for SecurityProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.SecurityProfile { get => (this._securityProfile = this._securityProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfile()); set { {_securityProfile = value;} } } + + /// Internal Acessors for SecurityProfileAzureKeyVaultKm + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.SecurityProfileAzureKeyVaultKm { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKm; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).AzureKeyVaultKm = value; } + + /// Internal Acessors for SecurityProfileDefender + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.SecurityProfileDefender { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).Defender; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).Defender = value; } + + /// Internal Acessors for SecurityProfileImageCleaner + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.SecurityProfileImageCleaner { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageCleaner; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageCleaner = value; } + + /// Internal Acessors for SecurityProfileImageIntegrity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.SecurityProfileImageIntegrity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageIntegrity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).ImageIntegrity = value; } + + /// Internal Acessors for SecurityProfileNodeRestriction + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.SecurityProfileNodeRestriction { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).NodeRestriction; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).NodeRestriction = value; } + + /// Internal Acessors for SecurityProfileWorkloadIdentity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.SecurityProfileWorkloadIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).WorkloadIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).WorkloadIdentity = value; } + + /// Internal Acessors for ServiceMeshProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.ServiceMeshProfile { get => (this._serviceMeshProfile = this._serviceMeshProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ServiceMeshProfile()); set { {_serviceMeshProfile = value;} } } + + /// Internal Acessors for ServiceMeshProfileIstio + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.ServiceMeshProfileIstio { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).Istio; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).Istio = value; } + + /// Internal Acessors for ServicePrincipalProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.ServicePrincipalProfile { get => (this._servicePrincipalProfile = this._servicePrincipalProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfile()); set { {_servicePrincipalProfile = value;} } } + + /// Internal Acessors for StorageProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfile()); set { {_storageProfile = value;} } } + + /// Internal Acessors for StorageProfileBlobCsiDriver + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.StorageProfileBlobCsiDriver { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).BlobCsiDriver; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).BlobCsiDriver = value; } + + /// Internal Acessors for StorageProfileDiskCsiDriver + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.StorageProfileDiskCsiDriver { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).DiskCsiDriver; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).DiskCsiDriver = value; } + + /// Internal Acessors for StorageProfileFileCsiDriver + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.StorageProfileFileCsiDriver { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).FileCsiDriver; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).FileCsiDriver = value; } + + /// Internal Acessors for StorageProfileSnapshotController + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.StorageProfileSnapshotController { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).SnapshotController; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).SnapshotController = value; } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ClusterUpgradeSettings()); set { {_upgradeSetting = value;} } } + + /// Internal Acessors for UpgradeSettingOverrideSetting + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.UpgradeSettingOverrideSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)UpgradeSetting).OverrideSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)UpgradeSetting).OverrideSetting = value; } + + /// Internal Acessors for WebAppRoutingIdentity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.WebAppRoutingIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).WebAppRoutingIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).WebAppRoutingIdentity = value; } + + /// Internal Acessors for WindowProfileGmsaProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.WindowProfileGmsaProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).GmsaProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).GmsaProfile = value; } + + /// Internal Acessors for WindowsProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.WindowsProfile { get => (this._windowsProfile = this._windowsProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWindowsProfile()); set { {_windowsProfile = value;} } } + + /// Internal Acessors for WorkloadAutoScalerProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.WorkloadAutoScalerProfile { get => (this._workloadAutoScalerProfile = this._workloadAutoScalerProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfile()); set { {_workloadAutoScalerProfile = value;} } } + + /// Internal Acessors for WorkloadAutoScalerProfileKeda + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.WorkloadAutoScalerProfileKeda { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).Keda; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).Keda = value; } + + /// Internal Acessors for WorkloadAutoScalerProfileVerticalPodAutoscaler + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesInternal.WorkloadAutoScalerProfileVerticalPodAutoscaler { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).VerticalPodAutoscaler; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).VerticalPodAutoscaler = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile _networkProfile; + + /// The network configuration profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfile()); set => this._networkProfile = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile _nodeProvisioningProfile; + + /// Node provisioning settings that apply to the whole cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile NodeProvisioningProfile { get => (this._nodeProvisioningProfile = this._nodeProvisioningProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeProvisioningProfile()); set => this._nodeProvisioningProfile = value; } + + /// Once the mode it set to Auto, it cannot be changed back to Manual. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? NodeProvisioningProfileMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfileInternal)NodeProvisioningProfile).Mode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfileInternal)NodeProvisioningProfile).Mode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode)""); } + + /// Backing field for property. + private string _nodeResourceGroup; + + /// The name of the resource group containing agent pool nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NodeResourceGroup { get => this._nodeResourceGroup; set => this._nodeResourceGroup = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile _nodeResourceGroupProfile; + + /// The node resource group configuration profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile NodeResourceGroupProfile { get => (this._nodeResourceGroupProfile = this._nodeResourceGroupProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeResourceGroupProfile()); set => this._nodeResourceGroupProfile = value; } + + /// The restriction level applied to the cluster's node resource group + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? NodeResourceGroupProfileRestrictionLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfileInternal)NodeResourceGroupProfile).RestrictionLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfileInternal)NodeResourceGroupProfile).RestrictionLevel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel)""); } + + /// Whether to enable Node Restriction + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? NodeRestrictionEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).NodeRestrictionEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).NodeRestrictionEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile _oidcIssuerProfile; + + /// The OIDC issuer profile of the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile OidcIssuerProfile { get => (this._oidcIssuerProfile = this._oidcIssuerProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterOidcIssuerProfile()); set => this._oidcIssuerProfile = value; } + + /// Whether the OIDC issuer is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OidcIssuerProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)OidcIssuerProfile).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)OidcIssuerProfile).Enabled = value ?? default(bool); } + + /// The OIDC issuer url of the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string OidcIssuerProfileIssuerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfileInternal)OidcIssuerProfile).IssuerUrl; } + + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OpenTelemetryLogEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).OpenTelemetryLogEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).OpenTelemetryLogEnabled = value ?? default(bool); } + + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? OpenTelemetryLogPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).OpenTelemetryLogPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).OpenTelemetryLogPort = value ?? default(long); } + + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OpenTelemetryMetricEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).OpenTelemetryMetricEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).OpenTelemetryMetricEnabled = value ?? default(bool); } + + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public long? OpenTelemetryMetricPort { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).OpenTelemetryMetricPort; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileInternal)AzureMonitorProfile).OpenTelemetryMetricPort = value ?? default(long); } + + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? OverrideSettingForceUpgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)UpgradeSetting).OverrideSettingForceUpgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)UpgradeSetting).OverrideSettingForceUpgrade = value ?? default(bool); } + + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? OverrideSettingUntil { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)UpgradeSetting).OverrideSettingUntil; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettingsInternal)UpgradeSetting).OverrideSettingUntil = value ?? default(global::System.DateTime); } + + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertChainObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginCertChainObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginCertChainObjectName = value ?? null; } + + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginCertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginCertObjectName = value ?? null; } + + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginKeyObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginKeyObjectName = value ?? null; } + + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginKeyVaultId = value ?? null; } + + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginRootCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginRootCertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).PluginRootCertObjectName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile _podIdentityProfile; + + /// + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod + /// identity integration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile PodIdentityProfile { get => (this._podIdentityProfile = this._podIdentityProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProfile()); set => this._podIdentityProfile = value; } + + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? PodIdentityProfileAllowNetworkPluginKubenet { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)PodIdentityProfile).AllowNetworkPluginKubenet; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)PodIdentityProfile).AllowNetworkPluginKubenet = value ?? default(bool); } + + /// Whether the pod identity addon is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? PodIdentityProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)PodIdentityProfile).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)PodIdentityProfile).Enabled = value ?? default(bool); } + + /// The pod identities to use in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] PodIdentityProfileUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)PodIdentityProfile).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)PodIdentityProfile).UserAssignedIdentity = value ?? null /* arrayOf */; } + + /// The pod identity exceptions to allow. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] PodIdentityProfileUserAssignedIdentityException { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)PodIdentityProfile).UserAssignedIdentityException; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfileInternal)PodIdentityProfile).UserAssignedIdentityException = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState _powerState; + + /// The Power State of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState PowerState { get => (this._powerState = this._powerState ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerState()); } + + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerStateInternal)PowerState).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerStateInternal)PowerState).Code = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code)""); } + + /// Backing field for property. + private string _privateFqdn; + + /// The FQDN of private cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string PrivateFqdn { get => this._privateFqdn; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] _privateLinkResource; + + /// Private link resources associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] PrivateLinkResource { get => this._privateLinkResource; set => this._privateLinkResource = value; } + + /// Backing field for property. + private string _provisioningState; + + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// Allow or deny public network access for AKS + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceUid; + + /// + /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ResourceUid { get => this._resourceUid; } + + /// List of namespaces excluded from Safeguards checks + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] SafeguardProfileExcludedNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)SafeguardsProfile).ExcludedNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)SafeguardsProfile).ExcludedNamespace = value ?? null /* arrayOf */; } + + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level? SafeguardProfileLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)SafeguardsProfile).Level; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)SafeguardsProfile).Level = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level)""); } + + /// List of namespaces specified by AKS to be excluded from Safeguards + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] SafeguardProfileSystemExcludedNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)SafeguardsProfile).SystemExcludedNamespace; } + + /// The version of constraints to use + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string SafeguardProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)SafeguardsProfile).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)SafeguardsProfile).Version = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile _safeguardsProfile; + + /// The Safeguards profile holds all the safeguards information for a given cluster + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile SafeguardsProfile { get => (this._safeguardsProfile = this._safeguardsProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsProfile()); set => this._safeguardsProfile = value; } + + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SecurityMonitoringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).SecurityMonitoringEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).SecurityMonitoringEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile _securityProfile; + + /// Security profile for the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile SecurityProfile { get => (this._securityProfile = this._securityProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfile()); set => this._securityProfile = value; } + + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public byte[][] SecurityProfileCustomCaTrustCertificate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).CustomCaTrustCertificate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).CustomCaTrustCertificate = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile _serviceMeshProfile; + + /// Service mesh profile for a managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile ServiceMeshProfile { get => (this._serviceMeshProfile = this._serviceMeshProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ServiceMeshProfile()); set => this._serviceMeshProfile = value; } + + /// Mode of the service mesh. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode? ServiceMeshProfileMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).Mode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)ServiceMeshProfile).Mode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile _servicePrincipalProfile; + + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile ServicePrincipalProfile { get => (this._servicePrincipalProfile = this._servicePrincipalProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfile()); set => this._servicePrincipalProfile = value; } + + /// The ID for the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ServicePrincipalProfileClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)ServicePrincipalProfile).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)ServicePrincipalProfile).ClientId = value ?? null; } + + /// The secret password associated with the service principal in plain text. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ServicePrincipalProfileSecret { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)ServicePrincipalProfile).Secret; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)ServicePrincipalProfile).Secret = value ?? null; } + + /// Whether to enable Snapshot Controller. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SnapshotControllerEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).SnapshotControllerEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)StorageProfile).SnapshotControllerEnabled = value ?? default(bool); } + + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)LinuxProfile).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfileInternal)LinuxProfile).SshPublicKey = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile _storageProfile; + + /// Storage profile for the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfile()); set => this._storageProfile = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan? _supportPlan; + + /// + /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan? SupportPlan { get => this._supportPlan; set => this._supportPlan = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings _upgradeSetting; + + /// Settings for upgrading a cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ClusterUpgradeSettings()); set => this._upgradeSetting = value; } + + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? VerticalPodAutoscalerAddonAutoscaling { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).VerticalPodAutoscalerAddonAutoscaling; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).VerticalPodAutoscalerAddonAutoscaling = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling)""); } + + /// Whether to enable VPA add-on in cluster. Default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? VerticalPodAutoscalerEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).VerticalPodAutoscalerEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)WorkloadAutoScalerProfile).VerticalPodAutoscalerEnabled = value ?? default(bool); } + + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] WebAppRoutingDnsZoneResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).WebAppRoutingDnsZoneResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).WebAppRoutingDnsZoneResourceId = value ?? null /* arrayOf */; } + + /// Whether to enable Web App Routing. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WebAppRoutingEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).WebAppRoutingEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileInternal)IngressProfile).WebAppRoutingEnabled = value ?? default(bool); } + + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string WindowProfileAdminPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).AdminPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).AdminPassword = value ?? null; } + + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string WindowProfileAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).AdminUsername = value ?? null; } + + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WindowProfileEnableCsiProxy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).EnableCsiProxy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).EnableCsiProxy = value ?? default(bool); } + + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? WindowProfileLicenseType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).LicenseType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)WindowsProfile).LicenseType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile _windowsProfile; + + /// The profile for Windows VMs in the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile WindowsProfile { get => (this._windowsProfile = this._windowsProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWindowsProfile()); set => this._windowsProfile = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile _workloadAutoScalerProfile; + + /// Workload Auto-scaler profile for the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile WorkloadAutoScalerProfile { get => (this._workloadAutoScalerProfile = this._workloadAutoScalerProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfile()); set => this._workloadAutoScalerProfile = value; } + + /// Whether to enable workload identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WorkloadIdentityEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).WorkloadIdentityEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)SecurityProfile).WorkloadIdentityEnabled = value ?? default(bool); } + + /// Creates an new instance. + public ManagedClusterProperties() + { + + } + } + /// Properties of the managed cluster. + public partial interface IManagedClusterProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The list of AAD group object IDs that will have admin role of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of AAD group object IDs that will have admin role of the cluster.", + SerializedName = @"adminGroupObjectIDs", + PossibleTypes = new [] { typeof(string) })] + string[] AadProfileAdminGroupObjectID { get; set; } + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"clientAppID", + PossibleTypes = new [] { typeof(string) })] + string AadProfileClientAppId { get; set; } + /// Whether to enable Azure RBAC for Kubernetes authorization. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure RBAC for Kubernetes authorization.", + SerializedName = @"enableAzureRBAC", + PossibleTypes = new [] { typeof(bool) })] + bool? AadProfileEnableAzureRbac { get; set; } + /// Whether to enable managed AAD. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable managed AAD.", + SerializedName = @"managed", + PossibleTypes = new [] { typeof(bool) })] + bool? AadProfileManaged { get; set; } + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppID", + PossibleTypes = new [] { typeof(string) })] + string AadProfileServerAppId { get; set; } + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppSecret", + PossibleTypes = new [] { typeof(string) })] + string AadProfileServerAppSecret { get; set; } + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription.", + SerializedName = @"tenantID", + PossibleTypes = new [] { typeof(string) })] + string AadProfileTenantId { get; set; } + /// The profile of managed cluster add-on. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The profile of managed cluster add-on.", + SerializedName = @"addonProfiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles AddonProfile { get; set; } + /// The agent pool properties. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The agent pool properties.", + SerializedName = @"agentPoolProfiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[] AgentPoolProfile { get; set; } + /// Indicates if AI toolchain operator enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if AI toolchain operator enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AiToolchainOperatorProfileEnabled { get; set; } + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges).", + SerializedName = @"authorizedIPRanges", + PossibleTypes = new [] { typeof(string) })] + string[] ApiServerAccessProfileAuthorizedIPRange { get; set; } + /// Whether to disable run command for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to disable run command for the cluster or not.", + SerializedName = @"disableRunCommand", + PossibleTypes = new [] { typeof(bool) })] + bool? ApiServerAccessProfileDisableRunCommand { get; set; } + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters).", + SerializedName = @"enablePrivateCluster", + PossibleTypes = new [] { typeof(bool) })] + bool? ApiServerAccessProfileEnablePrivateCluster { get; set; } + /// Whether to create additional public FQDN for private cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to create additional public FQDN for private cluster or not.", + SerializedName = @"enablePrivateClusterPublicFQDN", + PossibleTypes = new [] { typeof(bool) })] + bool? ApiServerAccessProfileEnablePrivateClusterPublicFqdn { get; set; } + /// Whether to enable apiserver vnet integration for the cluster or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable apiserver vnet integration for the cluster or not.", + SerializedName = @"enableVnetIntegration", + PossibleTypes = new [] { typeof(bool) })] + bool? ApiServerAccessProfileEnableVnetIntegration { get; set; } + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'.", + SerializedName = @"privateDNSZone", + PossibleTypes = new [] { typeof(string) })] + string ApiServerAccessProfilePrivateDnsZone { get; set; } + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet integration.", + SerializedName = @"subnetId", + PossibleTypes = new [] { typeof(string) })] + string ApiServerAccessProfileSubnetId { get; set; } + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Auto Instrumentation is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoInstrumentationEnabled { get; set; } + /// Valid values are 'true' and 'false' + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'true' and 'false'", + SerializedName = @"balance-similar-node-groups", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileBalanceSimilarNodeGroup { get; set; } + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.", + SerializedName = @"daemonset-eviction-for-empty-nodes", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoScalerProfileDaemonsetEvictionForEmptyNode { get; set; } + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.", + SerializedName = @"daemonset-eviction-for-occupied-nodes", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoScalerProfileDaemonsetEvictionForOccupiedNode { get; set; } + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Available values are: 'least-waste', 'most-pods', 'priority', 'random'.", + SerializedName = @"expander", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? AutoScalerProfileExpander { get; set; } + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, the resources used by daemonset will be taken into account when making scaling down decisions.", + SerializedName = @"ignore-daemonsets-utilization", + PossibleTypes = new [] { typeof(bool) })] + bool? AutoScalerProfileIgnoreDaemonsetsUtilization { get; set; } + /// The default is 10. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 10.", + SerializedName = @"max-empty-bulk-delete", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileMaxEmptyBulkDelete { get; set; } + /// The default is 600. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 600.", + SerializedName = @"max-graceful-termination-sec", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileMaxGracefulTerminationSec { get; set; } + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"max-node-provision-time", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileMaxNodeProvisionTime { get; set; } + /// The default is 45. The maximum is 100 and the minimum is 0. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 45. The maximum is 100 and the minimum is 0.", + SerializedName = @"max-total-unready-percentage", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileMaxTotalUnreadyPercentage { get; set; } + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc).", + SerializedName = @"new-pod-scale-up-delay", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileNewPodScaleUpDelay { get; set; } + /// This must be an integer. The default is 3. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This must be an integer. The default is 3.", + SerializedName = @"ok-total-unready-count", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileOkTotalUnreadyCount { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-add", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownDelayAfterAdd { get; set; } + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-delete", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownDelayAfterDelete { get; set; } + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-failure", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownDelayAfterFailure { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-unneeded-time", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownUnneededTime { get; set; } + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-unready-time", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownUnreadyTime { get; set; } + /// The default is '0.5'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '0.5'.", + SerializedName = @"scale-down-utilization-threshold", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScaleDownUtilizationThreshold { get; set; } + /// The default is '10'. Values must be an integer number of seconds. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10'. Values must be an integer number of seconds.", + SerializedName = @"scan-interval", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileScanInterval { get; set; } + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"skip-nodes-with-local-storage", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileSkipNodesWithLocalStorage { get; set; } + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"skip-nodes-with-system-pods", + PossibleTypes = new [] { typeof(string) })] + string AutoScalerProfileSkipNodesWithSystemPod { get; set; } + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA.", + SerializedName = @"nodeOSUpgradeChannel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? AutoUpgradeProfileNodeOSUpgradeChannel { get; set; } + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel).", + SerializedName = @"upgradeChannel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? AutoUpgradeProfileUpgradeChannel { get; set; } + /// Whether to enable Azure Key Vault key management service. The default is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure Key Vault key management service. The default is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AzureKeyVaultKmEnabled { get; set; } + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty.", + SerializedName = @"keyId", + PossibleTypes = new [] { typeof(string) })] + string AzureKeyVaultKmKeyId { get; set; } + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`.", + SerializedName = @"keyVaultNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? AzureKeyVaultKmKeyVaultNetworkAccess { get; set; } + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty.", + SerializedName = @"keyVaultResourceId", + PossibleTypes = new [] { typeof(string) })] + string AzureKeyVaultKmKeyVaultResourceId { get; set; } + /// + /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes + /// APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly.", + SerializedName = @"azurePortalFQDN", + PossibleTypes = new [] { typeof(string) })] + string AzurePortalFqdn { get; } + /// Whether to enable AzureBlob CSI Driver. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureBlob CSI Driver. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? BlobCsiDriverEnabled { get; set; } + /// The source where the artifacts are downloaded from. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source where the artifacts are downloaded from.", + SerializedName = @"artifactSource", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? BootstrapProfileArtifactSource { get; set; } + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy.", + SerializedName = @"containerRegistryId", + PossibleTypes = new [] { typeof(string) })] + string BootstrapProfileContainerRegistryId { get; set; } + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio egress gateways.", + SerializedName = @"egressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get; set; } + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio ingress gateways.", + SerializedName = @"ingressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get; set; } + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disableCustomMetrics", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerInsightDisableCustomMetric { get; set; } + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disablePrometheusMetricsScraping", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerInsightDisablePrometheusMetricsScraping { get; set; } + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Azure Monitor Container Insights Logs Addon is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerInsightEnabled { get; set; } + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string ContainerInsightLogAnalyticsWorkspaceResourceId { get; set; } + /// The syslog host port. If not specified, the default port is 28330. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The syslog host port. If not specified, the default port is 28330.", + SerializedName = @"syslogPort", + PossibleTypes = new [] { typeof(long) })] + long? ContainerInsightSyslogPort { get; set; } + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? CostAnalysisEnabled { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string CreationDataSourceResourceId { get; set; } + /// The version of Kubernetes the Managed Cluster is running. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of Kubernetes the Managed Cluster is running.", + SerializedName = @"currentKubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string CurrentKubernetesVersion { get; } + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string DefenderLogAnalyticsWorkspaceResourceId { get; set; } + /// + /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + /// that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview).", + SerializedName = @"disableLocalAccounts", + PossibleTypes = new [] { typeof(bool) })] + bool? DisableLocalAccount { get; set; } + /// Whether to enable AzureDisk CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureDisk CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? DiskCsiDriverEnabled { get; set; } + /// The version of AzureDisk CSI Driver. The default value is v1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of AzureDisk CSI Driver. The default value is v1.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string DiskCsiDriverVersion { get; set; } + /// + /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'", + SerializedName = @"diskEncryptionSetID", + PossibleTypes = new [] { typeof(string) })] + string DiskEncryptionSetId { get; set; } + /// This cannot be updated once the Managed Cluster has been created. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be updated once the Managed Cluster has been created.", + SerializedName = @"dnsPrefix", + PossibleTypes = new [] { typeof(string) })] + string DnsPrefix { get; set; } + /// + /// The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) + /// for more details on Namespace as a ARM Resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM Resource.", + SerializedName = @"enableNamespaceResources", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNamespaceResource { get; set; } + /// + /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes + /// v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp.", + SerializedName = @"enablePodSecurityPolicy", + PossibleTypes = new [] { typeof(bool) })] + bool? EnablePodSecurityPolicy { get; set; } + /// Whether to enable Kubernetes Role-Based Access Control. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Kubernetes Role-Based Access Control.", + SerializedName = @"enableRBAC", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableRbac { get; set; } + /// Whether to enable AzureFile CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureFile CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? FileCsiDriverEnabled { get; set; } + /// The FQDN of the master pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The FQDN of the master pool.", + SerializedName = @"fqdn", + PossibleTypes = new [] { typeof(string) })] + string Fqdn { get; } + /// This cannot be updated once the Managed Cluster has been created. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be updated once the Managed Cluster has been created.", + SerializedName = @"fqdnSubdomain", + PossibleTypes = new [] { typeof(string) })] + string FqdnSubdomain { get; set; } + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"dnsServer", + PossibleTypes = new [] { typeof(string) })] + string GmsaProfileDnsServer { get; set; } + /// Specifies whether to enable Windows gMSA in the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether to enable Windows gMSA in the managed cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? GmsaProfileEnabled { get; set; } + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"rootDomainName", + PossibleTypes = new [] { typeof(string) })] + string GmsaProfileRootDomainName { get; set; } + /// + /// A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy + /// and values injected by AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy and values injected by AKS.", + SerializedName = @"effectiveNoProxy", + PossibleTypes = new [] { typeof(string) })] + string[] HttpProxyConfigEffectiveNoProxy { get; } + /// The HTTP proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP proxy server endpoint to use.", + SerializedName = @"httpProxy", + PossibleTypes = new [] { typeof(string) })] + string HttpProxyConfigHttpProxy { get; set; } + /// The HTTPS proxy server endpoint to use. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTPS proxy server endpoint to use.", + SerializedName = @"httpsProxy", + PossibleTypes = new [] { typeof(string) })] + string HttpProxyConfigHttpsProxy { get; set; } + /// The endpoints that should not go through proxy. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The endpoints that should not go through proxy.", + SerializedName = @"noProxy", + PossibleTypes = new [] { typeof(string) })] + string[] HttpProxyConfigNoProxy { get; set; } + /// Alternative CA cert to use for connecting to proxy servers. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alternative CA cert to use for connecting to proxy servers.", + SerializedName = @"trustedCa", + PossibleTypes = new [] { typeof(string) })] + string HttpProxyConfigTrustedCa { get; set; } + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client ID of the user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object ID of the user assigned identity.", + SerializedName = @"objectId", + PossibleTypes = new [] { typeof(string) })] + string IdentityObjectId { get; set; } + /// Identities associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identities associated with the cluster.", + SerializedName = @"identityProfile", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile IdentityProfile { get; set; } + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the user assigned identity.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string IdentityResourceId { get; set; } + /// Whether to enable Image Cleaner on AKS cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Image Cleaner on AKS cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImageCleanerEnabled { get; set; } + /// Image Cleaner scanning interval in hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image Cleaner scanning interval in hours.", + SerializedName = @"intervalHours", + PossibleTypes = new [] { typeof(int) })] + int? ImageCleanerIntervalHour { get; set; } + /// Whether to enable image integrity. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable image integrity. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImageIntegrityEnabled { get; set; } + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade", + SerializedName = @"revisions", + PossibleTypes = new [] { typeof(string) })] + string[] IstioRevision { get; set; } + /// Whether to enable KEDA. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable KEDA.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? KedaEnabled { get; set; } + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric.", + SerializedName = @"metricAnnotationsAllowList", + PossibleTypes = new [] { typeof(string) })] + string KubeStateMetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. ", + SerializedName = @"metricLabelsAllowlist", + PossibleTypes = new [] { typeof(string) })] + string KubeStateMetricLabelsAllowlist { get; set; } + /// + /// When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed + /// sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + /// however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// The administrator username to use for Linux VMs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The administrator username to use for Linux VMs.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string LinuxProfileAdminUsername { get; set; } + /// The max number of agent pools for the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The max number of agent pools for the managed cluster.", + SerializedName = @"maxAgentPools", + PossibleTypes = new [] { typeof(int) })] + int? MaxAgentPool { get; } + /// Whether to enable the Prometheus collector + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable the Prometheus collector", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? MetricEnabled { get; set; } + /// The network configuration profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network configuration profile.", + SerializedName = @"networkProfile", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile NetworkProfile { get; set; } + /// Once the mode it set to Auto, it cannot be changed back to Manual. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Once the mode it set to Auto, it cannot be changed back to Manual.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? NodeProvisioningProfileMode { get; set; } + /// The name of the resource group containing agent pool nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the resource group containing agent pool nodes.", + SerializedName = @"nodeResourceGroup", + PossibleTypes = new [] { typeof(string) })] + string NodeResourceGroup { get; set; } + /// The restriction level applied to the cluster's node resource group + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The restriction level applied to the cluster's node resource group", + SerializedName = @"restrictionLevel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? NodeResourceGroupProfileRestrictionLevel { get; set; } + /// Whether to enable Node Restriction + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Node Restriction", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? NodeRestrictionEnabled { get; set; } + /// Whether the OIDC issuer is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the OIDC issuer is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OidcIssuerProfileEnabled { get; set; } + /// The OIDC issuer url of the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The OIDC issuer url of the Managed Cluster.", + SerializedName = @"issuerURL", + PossibleTypes = new [] { typeof(string) })] + string OidcIssuerProfileIssuerUrl { get; } + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OpenTelemetryLogEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? OpenTelemetryLogPort { get; set; } + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Metrics is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? OpenTelemetryMetricEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + long? OpenTelemetryMetricPort { get; set; } + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution.", + SerializedName = @"forceUpgrade", + PossibleTypes = new [] { typeof(bool) })] + bool? OverrideSettingForceUpgrade { get; set; } + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect.", + SerializedName = @"until", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? OverrideSettingUntil { get; set; } + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate chain object name in Azure Key Vault.", + SerializedName = @"certChainObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate object name in Azure Key Vault.", + SerializedName = @"certObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate private key object name in Azure Key Vault.", + SerializedName = @"keyObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the Key Vault.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Root certificate object name in Azure Key Vault.", + SerializedName = @"rootCertObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginRootCertObjectName { get; set; } + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information.", + SerializedName = @"allowNetworkPluginKubenet", + PossibleTypes = new [] { typeof(bool) })] + bool? PodIdentityProfileAllowNetworkPluginKubenet { get; set; } + /// Whether the pod identity addon is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the pod identity addon is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? PodIdentityProfileEnabled { get; set; } + /// The pod identities to use in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The pod identities to use in the cluster.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] PodIdentityProfileUserAssignedIdentity { get; set; } + /// The pod identity exceptions to allow. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The pod identity exceptions to allow.", + SerializedName = @"userAssignedIdentityExceptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] PodIdentityProfileUserAssignedIdentityException { get; set; } + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tells whether the cluster is Running or Stopped", + SerializedName = @"code", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get; set; } + /// The FQDN of private cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The FQDN of private cluster.", + SerializedName = @"privateFQDN", + PossibleTypes = new [] { typeof(string) })] + string PrivateFqdn { get; } + /// Private link resources associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Private link resources associated with the cluster.", + SerializedName = @"privateLinkResources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] PrivateLinkResource { get; set; } + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// Allow or deny public network access for AKS + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or deny public network access for AKS", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence)", + SerializedName = @"resourceUID", + PossibleTypes = new [] { typeof(string) })] + string ResourceUid { get; } + /// List of namespaces excluded from Safeguards checks + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of namespaces excluded from Safeguards checks", + SerializedName = @"excludedNamespaces", + PossibleTypes = new [] { typeof(string) })] + string[] SafeguardProfileExcludedNamespace { get; set; } + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces", + SerializedName = @"level", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level? SafeguardProfileLevel { get; set; } + /// List of namespaces specified by AKS to be excluded from Safeguards + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of namespaces specified by AKS to be excluded from Safeguards", + SerializedName = @"systemExcludedNamespaces", + PossibleTypes = new [] { typeof(string) })] + string[] SafeguardProfileSystemExcludedNamespace { get; } + /// The version of constraints to use + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of constraints to use", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string SafeguardProfileVersion { get; set; } + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Defender threat detection", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SecurityMonitoringEnabled { get; set; } + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority)", + SerializedName = @"customCATrustCertificates", + PossibleTypes = new [] { typeof(byte[]) })] + byte[][] SecurityProfileCustomCaTrustCertificate { get; set; } + /// Mode of the service mesh. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode of the service mesh.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode? ServiceMeshProfileMode { get; set; } + /// The ID for the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID for the service principal.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalProfileClientId { get; set; } + /// The secret password associated with the service principal in plain text. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secret password associated with the service principal in plain text.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalProfileSecret { get; set; } + /// Whether to enable Snapshot Controller. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Snapshot Controller. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SnapshotControllerEnabled { get; set; } + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified.", + SerializedName = @"publicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get; set; } + /// + /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'.", + SerializedName = @"supportPlan", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan? SupportPlan { get; set; } + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether VPA add-on is enabled and configured to scale AKS-managed add-ons.", + SerializedName = @"addonAutoscaling", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? VerticalPodAutoscalerAddonAutoscaling { get; set; } + /// Whether to enable VPA add-on in cluster. Default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable VPA add-on in cluster. Default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? VerticalPodAutoscalerEnabled { get; set; } + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group.", + SerializedName = @"dnsZoneResourceIds", + PossibleTypes = new [] { typeof(string) })] + string[] WebAppRoutingDnsZoneResourceId { get; set; } + /// Whether to enable Web App Routing. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Web App Routing.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? WebAppRoutingEnabled { get; set; } + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** ""abc@123"", ""P@$$w0rd"", ""P@ssw0rd"", ""P@ssword123"", ""Pa$$word"", ""pass@word1"", ""Password!"", ""Password1"", ""Password22"", ""iloveyou!""", + SerializedName = @"adminPassword", + PossibleTypes = new [] { typeof(string) })] + string WindowProfileAdminPassword { get; set; } + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the name of the administrator account.

**Restriction:** Cannot end in "".""

**Disallowed values:** ""administrator"", ""admin"", ""user"", ""user1"", ""test"", ""user2"", ""test1"", ""user3"", ""admin1"", ""1"", ""123"", ""a"", ""actuser"", ""adm"", ""admin2"", ""aspnet"", ""backup"", ""console"", ""david"", ""guest"", ""john"", ""owner"", ""root"", ""server"", ""sql"", ""support"", ""support_388945a0"", ""sys"", ""test2"", ""test3"", ""user4"", ""user5"".

**Minimum-length:** 1 character

**Max-length:** 20 characters", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string WindowProfileAdminUsername { get; set; } + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy).", + SerializedName = @"enableCSIProxy", + PossibleTypes = new [] { typeof(bool) })] + bool? WindowProfileEnableCsiProxy { get; set; } + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details.", + SerializedName = @"licenseType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? WindowProfileLicenseType { get; set; } + /// Whether to enable workload identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable workload identity.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? WorkloadIdentityEnabled { get; set; } + + } + /// Properties of the managed cluster. + internal partial interface IManagedClusterPropertiesInternal + + { + /// The Azure Active Directory configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile AadProfile { get; set; } + /// The list of AAD group object IDs that will have admin role of the cluster. + string[] AadProfileAdminGroupObjectID { get; set; } + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + string AadProfileClientAppId { get; set; } + /// Whether to enable Azure RBAC for Kubernetes authorization. + bool? AadProfileEnableAzureRbac { get; set; } + /// Whether to enable managed AAD. + bool? AadProfileManaged { get; set; } + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + string AadProfileServerAppId { get; set; } + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + string AadProfileServerAppSecret { get; set; } + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + string AadProfileTenantId { get; set; } + /// The profile of managed cluster add-on. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles AddonProfile { get; set; } + /// The agent pool properties. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[] AgentPoolProfile { get; set; } + /// AI toolchain operator settings that apply to the whole cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAiToolchainOperatorProfile AiToolchainOperatorProfile { get; set; } + /// Indicates if AI toolchain operator enabled or not. + bool? AiToolchainOperatorProfileEnabled { get; set; } + /// The access profile for managed cluster API server. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterApiServerAccessProfile ApiServerAccessProfile { get; set; } + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + string[] ApiServerAccessProfileAuthorizedIPRange { get; set; } + /// Whether to disable run command for the cluster or not. + bool? ApiServerAccessProfileDisableRunCommand { get; set; } + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + bool? ApiServerAccessProfileEnablePrivateCluster { get; set; } + /// Whether to create additional public FQDN for private cluster or not. + bool? ApiServerAccessProfileEnablePrivateClusterPublicFqdn { get; set; } + /// Whether to enable apiserver vnet integration for the cluster or not. + bool? ApiServerAccessProfileEnableVnetIntegration { get; set; } + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + string ApiServerAccessProfilePrivateDnsZone { get; set; } + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + string ApiServerAccessProfileSubnetId { get; set; } + /// + /// Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument + /// Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation AppMonitoringAutoInstrumentation { get; set; } + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + /// logs and traces of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs AppMonitoringOpenTelemetryLog { get; set; } + /// + /// Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + /// metrics of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics AppMonitoringOpenTelemetryMetric { get; set; } + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + bool? AutoInstrumentationEnabled { get; set; } + /// Parameters to be applied to the cluster-autoscaler when enabled + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile AutoScalerProfile { get; set; } + /// Valid values are 'true' and 'false' + string AutoScalerProfileBalanceSimilarNodeGroup { get; set; } + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + bool? AutoScalerProfileDaemonsetEvictionForEmptyNode { get; set; } + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + bool? AutoScalerProfileDaemonsetEvictionForOccupiedNode { get; set; } + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? AutoScalerProfileExpander { get; set; } + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + bool? AutoScalerProfileIgnoreDaemonsetsUtilization { get; set; } + /// The default is 10. + string AutoScalerProfileMaxEmptyBulkDelete { get; set; } + /// The default is 600. + string AutoScalerProfileMaxGracefulTerminationSec { get; set; } + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileMaxNodeProvisionTime { get; set; } + /// The default is 45. The maximum is 100 and the minimum is 0. + string AutoScalerProfileMaxTotalUnreadyPercentage { get; set; } + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + string AutoScalerProfileNewPodScaleUpDelay { get; set; } + /// This must be an integer. The default is 3. + string AutoScalerProfileOkTotalUnreadyCount { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileScaleDownDelayAfterAdd { get; set; } + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + string AutoScalerProfileScaleDownDelayAfterDelete { get; set; } + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileScaleDownDelayAfterFailure { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileScaleDownUnneededTime { get; set; } + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string AutoScalerProfileScaleDownUnreadyTime { get; set; } + /// The default is '0.5'. + string AutoScalerProfileScaleDownUtilizationThreshold { get; set; } + /// The default is '10'. Values must be an integer number of seconds. + string AutoScalerProfileScanInterval { get; set; } + /// The default is true. + string AutoScalerProfileSkipNodesWithLocalStorage { get; set; } + /// The default is true. + string AutoScalerProfileSkipNodesWithSystemPod { get; set; } + /// The auto upgrade configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAutoUpgradeProfile AutoUpgradeProfile { get; set; } + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel? AutoUpgradeProfileNodeOSUpgradeChannel { get; set; } + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel? AutoUpgradeProfileUpgradeChannel { get; set; } + /// Whether to enable Azure Key Vault key management service. The default is false. + bool? AzureKeyVaultKmEnabled { get; set; } + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + string AzureKeyVaultKmKeyId { get; set; } + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? AzureKeyVaultKmKeyVaultNetworkAccess { get; set; } + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + string AzureKeyVaultKmKeyVaultResourceId { get; set; } + /// Prometheus addon profile for the container service cluster + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfile AzureMonitorProfile { get; set; } + /// + /// Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + /// auto-instrumentation of the application using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring + /// for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileAppMonitoring AzureMonitorProfileAppMonitoring { get; set; } + /// + /// Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See + /// aka.ms/AzureMonitorContainerInsights for an overview. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileContainerInsights AzureMonitorProfileContainerInsight { get; set; } + /// Metrics profile for the prometheus service addon + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileMetrics AzureMonitorProfileMetric { get; set; } + /// + /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes + /// APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + /// + string AzurePortalFqdn { get; set; } + /// Whether to enable AzureBlob CSI Driver. The default value is false. + bool? BlobCsiDriverEnabled { get; set; } + /// Profile of the cluster bootstrap configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterBootstrapProfile BootstrapProfile { get; set; } + /// The source where the artifacts are downloaded from. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource? BootstrapProfileArtifactSource { get; set; } + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + string BootstrapProfileContainerRegistryId { get; set; } + /// Plugin certificates information for Service Mesh. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority CertificateAuthorityPlugin { get; set; } + /// Istio egress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get; set; } + /// Istio ingress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get; set; } + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + bool? ContainerInsightDisableCustomMetric { get; set; } + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + bool? ContainerInsightDisablePrometheusMetricsScraping { get; set; } + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + bool? ContainerInsightEnabled { get; set; } + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + string ContainerInsightLogAnalyticsWorkspaceResourceId { get; set; } + /// The syslog host port. If not specified, the default port is 28330. + long? ContainerInsightSyslogPort { get; set; } + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + bool? CostAnalysisEnabled { get; set; } + /// + /// CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + string CreationDataSourceResourceId { get; set; } + /// The version of Kubernetes the Managed Cluster is running. + string CurrentKubernetesVersion { get; set; } + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + string DefenderLogAnalyticsWorkspaceResourceId { get; set; } + /// + /// Microsoft Defender threat detection for Cloud settings for the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring DefenderSecurityMonitoring { get; set; } + /// + /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + /// that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + /// + bool? DisableLocalAccount { get; set; } + /// Whether to enable AzureDisk CSI Driver. The default value is true. + bool? DiskCsiDriverEnabled { get; set; } + /// The version of AzureDisk CSI Driver. The default value is v1. + string DiskCsiDriverVersion { get; set; } + /// + /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + /// + string DiskEncryptionSetId { get; set; } + /// This cannot be updated once the Managed Cluster has been created. + string DnsPrefix { get; set; } + /// + /// The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) + /// for more details on Namespace as a ARM Resource. + /// + bool? EnableNamespaceResource { get; set; } + /// + /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes + /// v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + /// + bool? EnablePodSecurityPolicy { get; set; } + /// Whether to enable Kubernetes Role-Based Access Control. + bool? EnableRbac { get; set; } + /// Whether to enable AzureFile CSI Driver. The default value is true. + bool? FileCsiDriverEnabled { get; set; } + /// The FQDN of the master pool. + string Fqdn { get; set; } + /// This cannot be updated once the Managed Cluster has been created. + string FqdnSubdomain { get; set; } + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ string GmsaProfileDnsServer { get; set; } + /// Specifies whether to enable Windows gMSA in the managed cluster. + bool? GmsaProfileEnabled { get; set; } + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ string GmsaProfileRootDomainName { get; set; } + /// Configurations for provisioning the cluster with HTTP proxy servers. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterHttpProxyConfig HttpProxyConfig { get; set; } + /// + /// A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy + /// and values injected by AKS. + /// + string[] HttpProxyConfigEffectiveNoProxy { get; set; } + /// The HTTP proxy server endpoint to use. + string HttpProxyConfigHttpProxy { get; set; } + /// The HTTPS proxy server endpoint to use. + string HttpProxyConfigHttpsProxy { get; set; } + /// The endpoints that should not go through proxy. + string[] HttpProxyConfigNoProxy { get; set; } + /// Alternative CA cert to use for connecting to proxy servers. + string HttpProxyConfigTrustedCa { get; set; } + /// The client ID of the user assigned identity. + string IdentityClientId { get; set; } + /// The object ID of the user assigned identity. + string IdentityObjectId { get; set; } + /// Identities associated with the cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile IdentityProfile { get; set; } + /// The resource ID of the user assigned identity. + string IdentityResourceId { get; set; } + /// Whether to enable Image Cleaner on AKS cluster. + bool? ImageCleanerEnabled { get; set; } + /// Image Cleaner scanning interval in hours. + int? ImageCleanerIntervalHour { get; set; } + /// Whether to enable image integrity. The default value is false. + bool? ImageIntegrityEnabled { get; set; } + /// Ingress profile for the managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfile IngressProfile { get; set; } + /// Web App Routing settings for the ingress profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIngressProfileWebAppRouting IngressProfileWebAppRouting { get; set; } + /// + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority IstioCertificateAuthority { get; set; } + /// Istio components configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents IstioComponent { get; set; } + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + string[] IstioRevision { get; set; } + /// Whether to enable KEDA. + bool? KedaEnabled { get; set; } + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + string KubeStateMetricAnnotationsAllowList { get; set; } + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + string KubeStateMetricLabelsAllowlist { get; set; } + /// + /// When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed + /// sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + /// however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) + /// for more details. + /// + string KubernetesVersion { get; set; } + /// The profile for Linux VMs in the Managed Cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceLinuxProfile LinuxProfile { get; set; } + /// The administrator username to use for Linux VMs. + string LinuxProfileAdminUsername { get; set; } + /// The SSH configuration for Linux-based VMs running on Azure. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshConfiguration LinuxProfileSsh { get; set; } + /// The max number of agent pools for the managed cluster. + int? MaxAgentPool { get; set; } + /// Whether to enable the Prometheus collector + bool? MetricEnabled { get; set; } + /// + /// Kube State Metrics for prometheus addon profile for the container service cluster + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAzureMonitorProfileKubeStateMetrics MetricKubeStateMetric { get; set; } + /// The cost analysis configuration for the cluster + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterCostAnalysis MetricProfileCostAnalysis { get; set; } + /// Optional cluster metrics configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterMetricsProfile MetricsProfile { get; set; } + /// The network configuration profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile NetworkProfile { get; set; } + /// Node provisioning settings that apply to the whole cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeProvisioningProfile NodeProvisioningProfile { get; set; } + /// Once the mode it set to Auto, it cannot be changed back to Manual. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode? NodeProvisioningProfileMode { get; set; } + /// The name of the resource group containing agent pool nodes. + string NodeResourceGroup { get; set; } + /// The node resource group configuration profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterNodeResourceGroupProfile NodeResourceGroupProfile { get; set; } + /// The restriction level applied to the cluster's node resource group + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel? NodeResourceGroupProfileRestrictionLevel { get; set; } + /// Whether to enable Node Restriction + bool? NodeRestrictionEnabled { get; set; } + /// The OIDC issuer profile of the Managed Cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterOidcIssuerProfile OidcIssuerProfile { get; set; } + /// Whether the OIDC issuer is enabled. + bool? OidcIssuerProfileEnabled { get; set; } + /// The OIDC issuer url of the Managed Cluster. + string OidcIssuerProfileIssuerUrl { get; set; } + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + bool? OpenTelemetryLogEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + long? OpenTelemetryLogPort { get; set; } + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + bool? OpenTelemetryMetricEnabled { get; set; } + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + long? OpenTelemetryMetricPort { get; set; } + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + bool? OverrideSettingForceUpgrade { get; set; } + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + global::System.DateTime? OverrideSettingUntil { get; set; } + /// Certificate chain object name in Azure Key Vault. + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + string PluginRootCertObjectName { get; set; } + /// + /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod + /// identity integration. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityProfile PodIdentityProfile { get; set; } + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + bool? PodIdentityProfileAllowNetworkPluginKubenet { get; set; } + /// Whether the pod identity addon is enabled. + bool? PodIdentityProfileEnabled { get; set; } + /// The pod identities to use in the cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] PodIdentityProfileUserAssignedIdentity { get; set; } + /// The pod identity exceptions to allow. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] PodIdentityProfileUserAssignedIdentityException { get; set; } + /// The Power State of the cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState PowerState { get; set; } + /// Tells whether the cluster is Running or Stopped + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? PowerStateCode { get; set; } + /// The FQDN of private cluster. + string PrivateFqdn { get; set; } + /// Private link resources associated with the cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] PrivateLinkResource { get; set; } + /// The current provisioning state. + string ProvisioningState { get; set; } + /// Allow or deny public network access for AKS + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence) + /// + string ResourceUid { get; set; } + /// List of namespaces excluded from Safeguards checks + string[] SafeguardProfileExcludedNamespace { get; set; } + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level? SafeguardProfileLevel { get; set; } + /// List of namespaces specified by AKS to be excluded from Safeguards + string[] SafeguardProfileSystemExcludedNamespace { get; set; } + /// The version of constraints to use + string SafeguardProfileVersion { get; set; } + /// The Safeguards profile holds all the safeguards information for a given cluster + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile SafeguardsProfile { get; set; } + /// Whether to enable Defender threat detection + bool? SecurityMonitoringEnabled { get; set; } + /// Security profile for the managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile SecurityProfile { get; set; } + /// + /// Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for + /// the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms SecurityProfileAzureKeyVaultKm { get; set; } + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + byte[][] SecurityProfileCustomCaTrustCertificate { get; set; } + /// Microsoft Defender settings for the security profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender SecurityProfileDefender { get; set; } + /// Image Cleaner settings for the security profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner SecurityProfileImageCleaner { get; set; } + /// + /// Image integrity is a feature that works with Azure Policy to verify image integrity by signature. This will not have any + /// effect unless Azure Policy is applied to enforce image signatures. See https://aka.ms/aks/image-integrity for how to use + /// this feature via policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity SecurityProfileImageIntegrity { get; set; } + /// + /// [Node Restriction](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction) settings + /// for the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction SecurityProfileNodeRestriction { get; set; } + /// + /// Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure + /// cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity SecurityProfileWorkloadIdentity { get; set; } + /// Service mesh profile for a managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile ServiceMeshProfile { get; set; } + /// Istio service mesh configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh ServiceMeshProfileIstio { get; set; } + /// Mode of the service mesh. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode? ServiceMeshProfileMode { get; set; } + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile ServicePrincipalProfile { get; set; } + /// The ID for the service principal. + string ServicePrincipalProfileClientId { get; set; } + /// The secret password associated with the service principal in plain text. + string ServicePrincipalProfileSecret { get; set; } + /// Whether to enable Snapshot Controller. The default value is true. + bool? SnapshotControllerEnabled { get; set; } + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get; set; } + /// Storage profile for the managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile StorageProfile { get; set; } + /// AzureBlob CSI Driver settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver StorageProfileBlobCsiDriver { get; set; } + /// AzureDisk CSI Driver settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver StorageProfileDiskCsiDriver { get; set; } + /// AzureFile CSI Driver settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver StorageProfileFileCsiDriver { get; set; } + /// Snapshot Controller settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController StorageProfileSnapshotController { get; set; } + /// + /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan? SupportPlan { get; set; } + /// Settings for upgrading a cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IClusterUpgradeSettings UpgradeSetting { get; set; } + /// Settings for overrides. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings UpgradeSettingOverrideSetting { get; set; } + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? VerticalPodAutoscalerAddonAutoscaling { get; set; } + /// Whether to enable VPA add-on in cluster. Default value is false. + bool? VerticalPodAutoscalerEnabled { get; set; } + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + string[] WebAppRoutingDnsZoneResourceId { get; set; } + /// Whether to enable Web App Routing. + bool? WebAppRoutingEnabled { get; set; } + /// + /// Managed identity of the Web Application Routing add-on. This is the identity that should be granted permissions, for example, + /// to manage the associated Azure DNS resource and get certificates from Azure Key Vault. See [this overview of the add-on](https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm) + /// for more instructions. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity WebAppRoutingIdentity { get; set; } + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ string WindowProfileAdminPassword { get; set; } + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ string WindowProfileAdminUsername { get; set; } + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + bool? WindowProfileEnableCsiProxy { get; set; } + /// The Windows gMSA Profile in the Managed Cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile WindowProfileGmsaProfile { get; set; } + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? WindowProfileLicenseType { get; set; } + /// The profile for Windows VMs in the Managed Cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile WindowsProfile { get; set; } + /// Workload Auto-scaler profile for the managed cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile WorkloadAutoScalerProfile { get; set; } + /// + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda WorkloadAutoScalerProfileKeda { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler WorkloadAutoScalerProfileVerticalPodAutoscaler { get; set; } + /// Whether to enable workload identity. + bool? WorkloadIdentityEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.json.cs new file mode 100644 index 000000000000..472b06a9073d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterProperties.json.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties of the managed cluster. + public partial class ManagedClusterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PowerState.FromJson(__jsonPowerState) : PowerState;} + {_creationData = If( json?.PropertyT("creationData"), out var __jsonCreationData) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData.FromJson(__jsonCreationData) : CreationData;} + {_linuxProfile = If( json?.PropertyT("linuxProfile"), out var __jsonLinuxProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceLinuxProfile.FromJson(__jsonLinuxProfile) : LinuxProfile;} + {_windowsProfile = If( json?.PropertyT("windowsProfile"), out var __jsonWindowsProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWindowsProfile.FromJson(__jsonWindowsProfile) : WindowsProfile;} + {_servicePrincipalProfile = If( json?.PropertyT("servicePrincipalProfile"), out var __jsonServicePrincipalProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfile.FromJson(__jsonServicePrincipalProfile) : ServicePrincipalProfile;} + {_podIdentityProfile = If( json?.PropertyT("podIdentityProfile"), out var __jsonPodIdentityProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPodIdentityProfile.FromJson(__jsonPodIdentityProfile) : PodIdentityProfile;} + {_oidcIssuerProfile = If( json?.PropertyT("oidcIssuerProfile"), out var __jsonOidcIssuerProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterOidcIssuerProfile.FromJson(__jsonOidcIssuerProfile) : OidcIssuerProfile;} + {_nodeResourceGroupProfile = If( json?.PropertyT("nodeResourceGroupProfile"), out var __jsonNodeResourceGroupProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeResourceGroupProfile.FromJson(__jsonNodeResourceGroupProfile) : NodeResourceGroupProfile;} + {_aadProfile = If( json?.PropertyT("aadProfile"), out var __jsonAadProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfile.FromJson(__jsonAadProfile) : AadProfile;} + {_autoUpgradeProfile = If( json?.PropertyT("autoUpgradeProfile"), out var __jsonAutoUpgradeProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAutoUpgradeProfile.FromJson(__jsonAutoUpgradeProfile) : AutoUpgradeProfile;} + {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ClusterUpgradeSettings.FromJson(__jsonUpgradeSettings) : UpgradeSetting;} + {_autoScalerProfile = If( json?.PropertyT("autoScalerProfile"), out var __jsonAutoScalerProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAutoScalerProfile.FromJson(__jsonAutoScalerProfile) : AutoScalerProfile;} + {_apiServerAccessProfile = If( json?.PropertyT("apiServerAccessProfile"), out var __jsonApiServerAccessProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterApiServerAccessProfile.FromJson(__jsonApiServerAccessProfile) : ApiServerAccessProfile;} + {_httpProxyConfig = If( json?.PropertyT("httpProxyConfig"), out var __jsonHttpProxyConfig) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterHttpProxyConfig.FromJson(__jsonHttpProxyConfig) : HttpProxyConfig;} + {_securityProfile = If( json?.PropertyT("securityProfile"), out var __jsonSecurityProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfile.FromJson(__jsonSecurityProfile) : SecurityProfile;} + {_storageProfile = If( json?.PropertyT("storageProfile"), out var __jsonStorageProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfile.FromJson(__jsonStorageProfile) : StorageProfile;} + {_ingressProfile = If( json?.PropertyT("ingressProfile"), out var __jsonIngressProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterIngressProfile.FromJson(__jsonIngressProfile) : IngressProfile;} + {_workloadAutoScalerProfile = If( json?.PropertyT("workloadAutoScalerProfile"), out var __jsonWorkloadAutoScalerProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfile.FromJson(__jsonWorkloadAutoScalerProfile) : WorkloadAutoScalerProfile;} + {_azureMonitorProfile = If( json?.PropertyT("azureMonitorProfile"), out var __jsonAzureMonitorProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAzureMonitorProfile.FromJson(__jsonAzureMonitorProfile) : AzureMonitorProfile;} + {_safeguardsProfile = If( json?.PropertyT("safeguardsProfile"), out var __jsonSafeguardsProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsProfile.FromJson(__jsonSafeguardsProfile) : SafeguardsProfile;} + {_serviceMeshProfile = If( json?.PropertyT("serviceMeshProfile"), out var __jsonServiceMeshProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ServiceMeshProfile.FromJson(__jsonServiceMeshProfile) : ServiceMeshProfile;} + {_metricsProfile = If( json?.PropertyT("metricsProfile"), out var __jsonMetricsProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterMetricsProfile.FromJson(__jsonMetricsProfile) : MetricsProfile;} + {_aiToolchainOperatorProfile = If( json?.PropertyT("aiToolchainOperatorProfile"), out var __jsonAiToolchainOperatorProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAiToolchainOperatorProfile.FromJson(__jsonAiToolchainOperatorProfile) : AiToolchainOperatorProfile;} + {_nodeProvisioningProfile = If( json?.PropertyT("nodeProvisioningProfile"), out var __jsonNodeProvisioningProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterNodeProvisioningProfile.FromJson(__jsonNodeProvisioningProfile) : NodeProvisioningProfile;} + {_bootstrapProfile = If( json?.PropertyT("bootstrapProfile"), out var __jsonBootstrapProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterBootstrapProfile.FromJson(__jsonBootstrapProfile) : BootstrapProfile;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_maxAgentPool = If( json?.PropertyT("maxAgentPools"), out var __jsonMaxAgentPools) ? (int?)__jsonMaxAgentPools : MaxAgentPool;} + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} + {_currentKubernetesVersion = If( json?.PropertyT("currentKubernetesVersion"), out var __jsonCurrentKubernetesVersion) ? (string)__jsonCurrentKubernetesVersion : (string)CurrentKubernetesVersion;} + {_dnsPrefix = If( json?.PropertyT("dnsPrefix"), out var __jsonDnsPrefix) ? (string)__jsonDnsPrefix : (string)DnsPrefix;} + {_fqdnSubdomain = If( json?.PropertyT("fqdnSubdomain"), out var __jsonFqdnSubdomain) ? (string)__jsonFqdnSubdomain : (string)FqdnSubdomain;} + {_fqdn = If( json?.PropertyT("fqdn"), out var __jsonFqdn) ? (string)__jsonFqdn : (string)Fqdn;} + {_privateFqdn = If( json?.PropertyT("privateFQDN"), out var __jsonPrivateFqdn) ? (string)__jsonPrivateFqdn : (string)PrivateFqdn;} + {_azurePortalFqdn = If( json?.PropertyT("azurePortalFQDN"), out var __jsonAzurePortalFqdn) ? (string)__jsonAzurePortalFqdn : (string)AzurePortalFqdn;} + {_agentPoolProfile = If( json?.PropertyT("agentPoolProfiles"), out var __jsonAgentPoolProfiles) ? If( __jsonAgentPoolProfiles as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAgentPoolProfile.FromJson(__u) )) ))() : null : AgentPoolProfile;} + {_addonProfile = If( json?.PropertyT("addonProfiles"), out var __jsonAddonProfiles) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAddonProfiles.FromJson(__jsonAddonProfiles) : AddonProfile;} + {_nodeResourceGroup = If( json?.PropertyT("nodeResourceGroup"), out var __jsonNodeResourceGroup) ? (string)__jsonNodeResourceGroup : (string)NodeResourceGroup;} + {_enableRbac = If( json?.PropertyT("enableRBAC"), out var __jsonEnableRbac) ? (bool?)__jsonEnableRbac : EnableRbac;} + {_supportPlan = If( json?.PropertyT("supportPlan"), out var __jsonSupportPlan) ? (string)__jsonSupportPlan : (string)SupportPlan;} + {_enablePodSecurityPolicy = If( json?.PropertyT("enablePodSecurityPolicy"), out var __jsonEnablePodSecurityPolicy) ? (bool?)__jsonEnablePodSecurityPolicy : EnablePodSecurityPolicy;} + {_enableNamespaceResource = If( json?.PropertyT("enableNamespaceResources"), out var __jsonEnableNamespaceResources) ? (bool?)__jsonEnableNamespaceResources : EnableNamespaceResource;} + {_diskEncryptionSetId = If( json?.PropertyT("diskEncryptionSetID"), out var __jsonDiskEncryptionSetId) ? (string)__jsonDiskEncryptionSetId : (string)DiskEncryptionSetId;} + {_identityProfile = If( json?.PropertyT("identityProfile"), out var __jsonIdentityProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesIdentityProfile.FromJson(__jsonIdentityProfile) : IdentityProfile;} + {_privateLinkResource = If( json?.PropertyT("privateLinkResources"), out var __jsonPrivateLinkResources) ? If( __jsonPrivateLinkResources as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResource.FromJson(__p) )) ))() : null : PrivateLinkResource;} + {_disableLocalAccount = If( json?.PropertyT("disableLocalAccounts"), out var __jsonDisableLocalAccounts) ? (bool?)__jsonDisableLocalAccounts : DisableLocalAccount;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_resourceUid = If( json?.PropertyT("resourceUID"), out var __jsonResourceUid) ? (string)__jsonResourceUid : (string)ResourceUid;} + {_networkProfile = If( json?.PropertyT("networkProfile"), out var __jsonNetworkProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ContainerServiceNetworkProfile.FromJson(__jsonNetworkProfile) : NetworkProfile;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._powerState ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._powerState.ToJson(null,serializationMode) : null, "powerState" ,container.Add ); + } + AddIf( null != this._creationData ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._creationData.ToJson(null,serializationMode) : null, "creationData" ,container.Add ); + AddIf( null != this._linuxProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._linuxProfile.ToJson(null,serializationMode) : null, "linuxProfile" ,container.Add ); + AddIf( null != this._windowsProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._windowsProfile.ToJson(null,serializationMode) : null, "windowsProfile" ,container.Add ); + AddIf( null != this._servicePrincipalProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._servicePrincipalProfile.ToJson(null,serializationMode) : null, "servicePrincipalProfile" ,container.Add ); + AddIf( null != this._podIdentityProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._podIdentityProfile.ToJson(null,serializationMode) : null, "podIdentityProfile" ,container.Add ); + AddIf( null != this._oidcIssuerProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._oidcIssuerProfile.ToJson(null,serializationMode) : null, "oidcIssuerProfile" ,container.Add ); + AddIf( null != this._nodeResourceGroupProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._nodeResourceGroupProfile.ToJson(null,serializationMode) : null, "nodeResourceGroupProfile" ,container.Add ); + AddIf( null != this._aadProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._aadProfile.ToJson(null,serializationMode) : null, "aadProfile" ,container.Add ); + AddIf( null != this._autoUpgradeProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._autoUpgradeProfile.ToJson(null,serializationMode) : null, "autoUpgradeProfile" ,container.Add ); + AddIf( null != this._upgradeSetting ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._upgradeSetting.ToJson(null,serializationMode) : null, "upgradeSettings" ,container.Add ); + AddIf( null != this._autoScalerProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._autoScalerProfile.ToJson(null,serializationMode) : null, "autoScalerProfile" ,container.Add ); + AddIf( null != this._apiServerAccessProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._apiServerAccessProfile.ToJson(null,serializationMode) : null, "apiServerAccessProfile" ,container.Add ); + AddIf( null != this._httpProxyConfig ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._httpProxyConfig.ToJson(null,serializationMode) : null, "httpProxyConfig" ,container.Add ); + AddIf( null != this._securityProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._securityProfile.ToJson(null,serializationMode) : null, "securityProfile" ,container.Add ); + AddIf( null != this._storageProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._storageProfile.ToJson(null,serializationMode) : null, "storageProfile" ,container.Add ); + AddIf( null != this._ingressProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._ingressProfile.ToJson(null,serializationMode) : null, "ingressProfile" ,container.Add ); + AddIf( null != this._workloadAutoScalerProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._workloadAutoScalerProfile.ToJson(null,serializationMode) : null, "workloadAutoScalerProfile" ,container.Add ); + AddIf( null != this._azureMonitorProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._azureMonitorProfile.ToJson(null,serializationMode) : null, "azureMonitorProfile" ,container.Add ); + AddIf( null != this._safeguardsProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._safeguardsProfile.ToJson(null,serializationMode) : null, "safeguardsProfile" ,container.Add ); + AddIf( null != this._serviceMeshProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._serviceMeshProfile.ToJson(null,serializationMode) : null, "serviceMeshProfile" ,container.Add ); + AddIf( null != this._metricsProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._metricsProfile.ToJson(null,serializationMode) : null, "metricsProfile" ,container.Add ); + AddIf( null != this._aiToolchainOperatorProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._aiToolchainOperatorProfile.ToJson(null,serializationMode) : null, "aiToolchainOperatorProfile" ,container.Add ); + AddIf( null != this._nodeProvisioningProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._nodeProvisioningProfile.ToJson(null,serializationMode) : null, "nodeProvisioningProfile" ,container.Add ); + AddIf( null != this._bootstrapProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._bootstrapProfile.ToJson(null,serializationMode) : null, "bootstrapProfile" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._maxAgentPool ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._maxAgentPool) : null, "maxAgentPools" ,container.Add ); + } + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currentKubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._currentKubernetesVersion.ToString()) : null, "currentKubernetesVersion" ,container.Add ); + } + AddIf( null != (((object)this._dnsPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._dnsPrefix.ToString()) : null, "dnsPrefix" ,container.Add ); + AddIf( null != (((object)this._fqdnSubdomain)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._fqdnSubdomain.ToString()) : null, "fqdnSubdomain" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._fqdn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._fqdn.ToString()) : null, "fqdn" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._privateFqdn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._privateFqdn.ToString()) : null, "privateFQDN" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._azurePortalFqdn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._azurePortalFqdn.ToString()) : null, "azurePortalFQDN" ,container.Add ); + } + if (null != this._agentPoolProfile) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._agentPoolProfile ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("agentPoolProfiles",__w); + } + AddIf( null != this._addonProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._addonProfile.ToJson(null,serializationMode) : null, "addonProfiles" ,container.Add ); + AddIf( null != (((object)this._nodeResourceGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nodeResourceGroup.ToString()) : null, "nodeResourceGroup" ,container.Add ); + AddIf( null != this._enableRbac ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableRbac) : null, "enableRBAC" ,container.Add ); + AddIf( null != (((object)this._supportPlan)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._supportPlan.ToString()) : null, "supportPlan" ,container.Add ); + AddIf( null != this._enablePodSecurityPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enablePodSecurityPolicy) : null, "enablePodSecurityPolicy" ,container.Add ); + AddIf( null != this._enableNamespaceResource ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableNamespaceResource) : null, "enableNamespaceResources" ,container.Add ); + AddIf( null != (((object)this._diskEncryptionSetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._diskEncryptionSetId.ToString()) : null, "diskEncryptionSetID" ,container.Add ); + AddIf( null != this._identityProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._identityProfile.ToJson(null,serializationMode) : null, "identityProfile" ,container.Add ); + if (null != this._privateLinkResource) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._privateLinkResource ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("privateLinkResources",__r); + } + AddIf( null != this._disableLocalAccount ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._disableLocalAccount) : null, "disableLocalAccounts" ,container.Add ); + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceUid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._resourceUid.ToString()) : null, "resourceUID" ,container.Add ); + } + AddIf( null != this._networkProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._networkProfile.ToJson(null,serializationMode) : null, "networkProfile" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.PowerShell.cs new file mode 100644 index 000000000000..77c8e625617d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The profile of managed cluster add-on. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesAddonProfilesTypeConverter))] + public partial class ManagedClusterPropertiesAddonProfiles + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPropertiesAddonProfiles(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPropertiesAddonProfiles(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPropertiesAddonProfiles(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 ManagedClusterPropertiesAddonProfiles(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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The profile of managed cluster add-on. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesAddonProfilesTypeConverter))] + public partial interface IManagedClusterPropertiesAddonProfiles + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.TypeConverter.cs new file mode 100644 index 000000000000..5e7fe54ccd95 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPropertiesAddonProfilesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPropertiesAddonProfiles.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPropertiesAddonProfiles.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPropertiesAddonProfiles.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.cs new file mode 100644 index 000000000000..47fa7613a428 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The profile of managed cluster add-on. + public partial class ManagedClusterPropertiesAddonProfiles : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfilesInternal + { + + /// Creates an new instance. + public ManagedClusterPropertiesAddonProfiles() + { + + } + } + /// The profile of managed cluster add-on. + public partial interface IManagedClusterPropertiesAddonProfiles : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// The profile of managed cluster add-on. + internal partial interface IManagedClusterPropertiesAddonProfilesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.dictionary.cs new file mode 100644 index 000000000000..71a43d250cd9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterPropertiesAddonProfiles : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile 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.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterAddonProfile value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesAddonProfiles source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.json.cs new file mode 100644 index 000000000000..6e9e596cbd32 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAddonProfiles.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The profile of managed cluster add-on. + public partial class ManagedClusterPropertiesAddonProfiles + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPropertiesAddonProfiles(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedClusterPropertiesAddonProfiles(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAddonProfile.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.PowerShell.cs new file mode 100644 index 000000000000..0f59640402d3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.PowerShell.cs @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Parameters to be applied to the cluster-autoscaler when enabled + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesAutoScalerProfileTypeConverter))] + public partial class ManagedClusterPropertiesAutoScalerProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPropertiesAutoScalerProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPropertiesAutoScalerProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPropertiesAutoScalerProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BalanceSimilarNodeGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).BalanceSimilarNodeGroup = (string) content.GetValueForProperty("BalanceSimilarNodeGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).BalanceSimilarNodeGroup, global::System.Convert.ToString); + } + if (content.Contains("DaemonsetEvictionForEmptyNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).DaemonsetEvictionForEmptyNode = (bool?) content.GetValueForProperty("DaemonsetEvictionForEmptyNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).DaemonsetEvictionForEmptyNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DaemonsetEvictionForOccupiedNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).DaemonsetEvictionForOccupiedNode = (bool?) content.GetValueForProperty("DaemonsetEvictionForOccupiedNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).DaemonsetEvictionForOccupiedNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IgnoreDaemonsetsUtilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).IgnoreDaemonsetsUtilization = (bool?) content.GetValueForProperty("IgnoreDaemonsetsUtilization",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).IgnoreDaemonsetsUtilization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Expander")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).Expander = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander?) content.GetValueForProperty("Expander",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).Expander, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander.CreateFrom); + } + if (content.Contains("MaxEmptyBulkDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxEmptyBulkDelete = (string) content.GetValueForProperty("MaxEmptyBulkDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxEmptyBulkDelete, global::System.Convert.ToString); + } + if (content.Contains("MaxGracefulTerminationSec")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxGracefulTerminationSec = (string) content.GetValueForProperty("MaxGracefulTerminationSec",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxGracefulTerminationSec, global::System.Convert.ToString); + } + if (content.Contains("MaxNodeProvisionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxNodeProvisionTime = (string) content.GetValueForProperty("MaxNodeProvisionTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxNodeProvisionTime, global::System.Convert.ToString); + } + if (content.Contains("MaxTotalUnreadyPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxTotalUnreadyPercentage = (string) content.GetValueForProperty("MaxTotalUnreadyPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxTotalUnreadyPercentage, global::System.Convert.ToString); + } + if (content.Contains("NewPodScaleUpDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).NewPodScaleUpDelay = (string) content.GetValueForProperty("NewPodScaleUpDelay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).NewPodScaleUpDelay, global::System.Convert.ToString); + } + if (content.Contains("OkTotalUnreadyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).OkTotalUnreadyCount = (string) content.GetValueForProperty("OkTotalUnreadyCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).OkTotalUnreadyCount, global::System.Convert.ToString); + } + if (content.Contains("ScanInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScanInterval = (string) content.GetValueForProperty("ScanInterval",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScanInterval, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownDelayAfterAdd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterAdd = (string) content.GetValueForProperty("ScaleDownDelayAfterAdd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterAdd, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownDelayAfterDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterDelete = (string) content.GetValueForProperty("ScaleDownDelayAfterDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterDelete, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownDelayAfterFailure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterFailure = (string) content.GetValueForProperty("ScaleDownDelayAfterFailure",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterFailure, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownUnneededTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUnneededTime = (string) content.GetValueForProperty("ScaleDownUnneededTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUnneededTime, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownUnreadyTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUnreadyTime = (string) content.GetValueForProperty("ScaleDownUnreadyTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUnreadyTime, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownUtilizationThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUtilizationThreshold = (string) content.GetValueForProperty("ScaleDownUtilizationThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUtilizationThreshold, global::System.Convert.ToString); + } + if (content.Contains("SkipNodesWithLocalStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).SkipNodesWithLocalStorage = (string) content.GetValueForProperty("SkipNodesWithLocalStorage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).SkipNodesWithLocalStorage, global::System.Convert.ToString); + } + if (content.Contains("SkipNodesWithSystemPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).SkipNodesWithSystemPod = (string) content.GetValueForProperty("SkipNodesWithSystemPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).SkipNodesWithSystemPod, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterPropertiesAutoScalerProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BalanceSimilarNodeGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).BalanceSimilarNodeGroup = (string) content.GetValueForProperty("BalanceSimilarNodeGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).BalanceSimilarNodeGroup, global::System.Convert.ToString); + } + if (content.Contains("DaemonsetEvictionForEmptyNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).DaemonsetEvictionForEmptyNode = (bool?) content.GetValueForProperty("DaemonsetEvictionForEmptyNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).DaemonsetEvictionForEmptyNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DaemonsetEvictionForOccupiedNode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).DaemonsetEvictionForOccupiedNode = (bool?) content.GetValueForProperty("DaemonsetEvictionForOccupiedNode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).DaemonsetEvictionForOccupiedNode, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IgnoreDaemonsetsUtilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).IgnoreDaemonsetsUtilization = (bool?) content.GetValueForProperty("IgnoreDaemonsetsUtilization",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).IgnoreDaemonsetsUtilization, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Expander")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).Expander = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander?) content.GetValueForProperty("Expander",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).Expander, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander.CreateFrom); + } + if (content.Contains("MaxEmptyBulkDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxEmptyBulkDelete = (string) content.GetValueForProperty("MaxEmptyBulkDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxEmptyBulkDelete, global::System.Convert.ToString); + } + if (content.Contains("MaxGracefulTerminationSec")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxGracefulTerminationSec = (string) content.GetValueForProperty("MaxGracefulTerminationSec",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxGracefulTerminationSec, global::System.Convert.ToString); + } + if (content.Contains("MaxNodeProvisionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxNodeProvisionTime = (string) content.GetValueForProperty("MaxNodeProvisionTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxNodeProvisionTime, global::System.Convert.ToString); + } + if (content.Contains("MaxTotalUnreadyPercentage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxTotalUnreadyPercentage = (string) content.GetValueForProperty("MaxTotalUnreadyPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).MaxTotalUnreadyPercentage, global::System.Convert.ToString); + } + if (content.Contains("NewPodScaleUpDelay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).NewPodScaleUpDelay = (string) content.GetValueForProperty("NewPodScaleUpDelay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).NewPodScaleUpDelay, global::System.Convert.ToString); + } + if (content.Contains("OkTotalUnreadyCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).OkTotalUnreadyCount = (string) content.GetValueForProperty("OkTotalUnreadyCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).OkTotalUnreadyCount, global::System.Convert.ToString); + } + if (content.Contains("ScanInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScanInterval = (string) content.GetValueForProperty("ScanInterval",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScanInterval, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownDelayAfterAdd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterAdd = (string) content.GetValueForProperty("ScaleDownDelayAfterAdd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterAdd, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownDelayAfterDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterDelete = (string) content.GetValueForProperty("ScaleDownDelayAfterDelete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterDelete, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownDelayAfterFailure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterFailure = (string) content.GetValueForProperty("ScaleDownDelayAfterFailure",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownDelayAfterFailure, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownUnneededTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUnneededTime = (string) content.GetValueForProperty("ScaleDownUnneededTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUnneededTime, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownUnreadyTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUnreadyTime = (string) content.GetValueForProperty("ScaleDownUnreadyTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUnreadyTime, global::System.Convert.ToString); + } + if (content.Contains("ScaleDownUtilizationThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUtilizationThreshold = (string) content.GetValueForProperty("ScaleDownUtilizationThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).ScaleDownUtilizationThreshold, global::System.Convert.ToString); + } + if (content.Contains("SkipNodesWithLocalStorage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).SkipNodesWithLocalStorage = (string) content.GetValueForProperty("SkipNodesWithLocalStorage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).SkipNodesWithLocalStorage, global::System.Convert.ToString); + } + if (content.Contains("SkipNodesWithSystemPod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).SkipNodesWithSystemPod = (string) content.GetValueForProperty("SkipNodesWithSystemPod",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal)this).SkipNodesWithSystemPod, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Parameters to be applied to the cluster-autoscaler when enabled + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesAutoScalerProfileTypeConverter))] + public partial interface IManagedClusterPropertiesAutoScalerProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.TypeConverter.cs new file mode 100644 index 000000000000..6981813d04ed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPropertiesAutoScalerProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPropertiesAutoScalerProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPropertiesAutoScalerProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPropertiesAutoScalerProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.cs new file mode 100644 index 000000000000..99853c0ffacf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Parameters to be applied to the cluster-autoscaler when enabled + public partial class ManagedClusterPropertiesAutoScalerProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfileInternal + { + + /// Backing field for property. + private string _balanceSimilarNodeGroup; + + /// Valid values are 'true' and 'false' + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string BalanceSimilarNodeGroup { get => this._balanceSimilarNodeGroup; set => this._balanceSimilarNodeGroup = value; } + + /// Backing field for property. + private bool? _daemonsetEvictionForEmptyNode; + + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? DaemonsetEvictionForEmptyNode { get => this._daemonsetEvictionForEmptyNode; set => this._daemonsetEvictionForEmptyNode = value; } + + /// Backing field for property. + private bool? _daemonsetEvictionForOccupiedNode; + + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? DaemonsetEvictionForOccupiedNode { get => this._daemonsetEvictionForOccupiedNode; set => this._daemonsetEvictionForOccupiedNode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? _expander; + + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? Expander { get => this._expander; set => this._expander = value; } + + /// Backing field for property. + private bool? _ignoreDaemonsetsUtilization; + + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? IgnoreDaemonsetsUtilization { get => this._ignoreDaemonsetsUtilization; set => this._ignoreDaemonsetsUtilization = value; } + + /// Backing field for property. + private string _maxEmptyBulkDelete; + + /// The default is 10. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string MaxEmptyBulkDelete { get => this._maxEmptyBulkDelete; set => this._maxEmptyBulkDelete = value; } + + /// Backing field for property. + private string _maxGracefulTerminationSec; + + /// The default is 600. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string MaxGracefulTerminationSec { get => this._maxGracefulTerminationSec; set => this._maxGracefulTerminationSec = value; } + + /// Backing field for property. + private string _maxNodeProvisionTime; + + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string MaxNodeProvisionTime { get => this._maxNodeProvisionTime; set => this._maxNodeProvisionTime = value; } + + /// Backing field for property. + private string _maxTotalUnreadyPercentage; + + /// The default is 45. The maximum is 100 and the minimum is 0. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string MaxTotalUnreadyPercentage { get => this._maxTotalUnreadyPercentage; set => this._maxTotalUnreadyPercentage = value; } + + /// Backing field for property. + private string _newPodScaleUpDelay; + + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NewPodScaleUpDelay { get => this._newPodScaleUpDelay; set => this._newPodScaleUpDelay = value; } + + /// Backing field for property. + private string _okTotalUnreadyCount; + + /// This must be an integer. The default is 3. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string OkTotalUnreadyCount { get => this._okTotalUnreadyCount; set => this._okTotalUnreadyCount = value; } + + /// Backing field for property. + private string _scaleDownDelayAfterAdd; + + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ScaleDownDelayAfterAdd { get => this._scaleDownDelayAfterAdd; set => this._scaleDownDelayAfterAdd = value; } + + /// Backing field for property. + private string _scaleDownDelayAfterDelete; + + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ScaleDownDelayAfterDelete { get => this._scaleDownDelayAfterDelete; set => this._scaleDownDelayAfterDelete = value; } + + /// Backing field for property. + private string _scaleDownDelayAfterFailure; + + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ScaleDownDelayAfterFailure { get => this._scaleDownDelayAfterFailure; set => this._scaleDownDelayAfterFailure = value; } + + /// Backing field for property. + private string _scaleDownUnneededTime; + + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ScaleDownUnneededTime { get => this._scaleDownUnneededTime; set => this._scaleDownUnneededTime = value; } + + /// Backing field for property. + private string _scaleDownUnreadyTime; + + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ScaleDownUnreadyTime { get => this._scaleDownUnreadyTime; set => this._scaleDownUnreadyTime = value; } + + /// Backing field for property. + private string _scaleDownUtilizationThreshold; + + /// The default is '0.5'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ScaleDownUtilizationThreshold { get => this._scaleDownUtilizationThreshold; set => this._scaleDownUtilizationThreshold = value; } + + /// Backing field for property. + private string _scanInterval; + + /// The default is '10'. Values must be an integer number of seconds. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ScanInterval { get => this._scanInterval; set => this._scanInterval = value; } + + /// Backing field for property. + private string _skipNodesWithLocalStorage; + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string SkipNodesWithLocalStorage { get => this._skipNodesWithLocalStorage; set => this._skipNodesWithLocalStorage = value; } + + /// Backing field for property. + private string _skipNodesWithSystemPod; + + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string SkipNodesWithSystemPod { get => this._skipNodesWithSystemPod; set => this._skipNodesWithSystemPod = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterPropertiesAutoScalerProfile() + { + + } + } + /// Parameters to be applied to the cluster-autoscaler when enabled + public partial interface IManagedClusterPropertiesAutoScalerProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Valid values are 'true' and 'false' + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'true' and 'false'", + SerializedName = @"balance-similar-node-groups", + PossibleTypes = new [] { typeof(string) })] + string BalanceSimilarNodeGroup { get; set; } + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.", + SerializedName = @"daemonset-eviction-for-empty-nodes", + PossibleTypes = new [] { typeof(bool) })] + bool? DaemonsetEvictionForEmptyNode { get; set; } + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.", + SerializedName = @"daemonset-eviction-for-occupied-nodes", + PossibleTypes = new [] { typeof(bool) })] + bool? DaemonsetEvictionForOccupiedNode { get; set; } + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Available values are: 'least-waste', 'most-pods', 'priority', 'random'.", + SerializedName = @"expander", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? Expander { get; set; } + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, the resources used by daemonset will be taken into account when making scaling down decisions.", + SerializedName = @"ignore-daemonsets-utilization", + PossibleTypes = new [] { typeof(bool) })] + bool? IgnoreDaemonsetsUtilization { get; set; } + /// The default is 10. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 10.", + SerializedName = @"max-empty-bulk-delete", + PossibleTypes = new [] { typeof(string) })] + string MaxEmptyBulkDelete { get; set; } + /// The default is 600. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 600.", + SerializedName = @"max-graceful-termination-sec", + PossibleTypes = new [] { typeof(string) })] + string MaxGracefulTerminationSec { get; set; } + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"max-node-provision-time", + PossibleTypes = new [] { typeof(string) })] + string MaxNodeProvisionTime { get; set; } + /// The default is 45. The maximum is 100 and the minimum is 0. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 45. The maximum is 100 and the minimum is 0.", + SerializedName = @"max-total-unready-percentage", + PossibleTypes = new [] { typeof(string) })] + string MaxTotalUnreadyPercentage { get; set; } + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc).", + SerializedName = @"new-pod-scale-up-delay", + PossibleTypes = new [] { typeof(string) })] + string NewPodScaleUpDelay { get; set; } + /// This must be an integer. The default is 3. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This must be an integer. The default is 3.", + SerializedName = @"ok-total-unready-count", + PossibleTypes = new [] { typeof(string) })] + string OkTotalUnreadyCount { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-add", + PossibleTypes = new [] { typeof(string) })] + string ScaleDownDelayAfterAdd { get; set; } + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-delete", + PossibleTypes = new [] { typeof(string) })] + string ScaleDownDelayAfterDelete { get; set; } + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-failure", + PossibleTypes = new [] { typeof(string) })] + string ScaleDownDelayAfterFailure { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-unneeded-time", + PossibleTypes = new [] { typeof(string) })] + string ScaleDownUnneededTime { get; set; } + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-unready-time", + PossibleTypes = new [] { typeof(string) })] + string ScaleDownUnreadyTime { get; set; } + /// The default is '0.5'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '0.5'.", + SerializedName = @"scale-down-utilization-threshold", + PossibleTypes = new [] { typeof(string) })] + string ScaleDownUtilizationThreshold { get; set; } + /// The default is '10'. Values must be an integer number of seconds. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10'. Values must be an integer number of seconds.", + SerializedName = @"scan-interval", + PossibleTypes = new [] { typeof(string) })] + string ScanInterval { get; set; } + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"skip-nodes-with-local-storage", + PossibleTypes = new [] { typeof(string) })] + string SkipNodesWithLocalStorage { get; set; } + /// The default is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"skip-nodes-with-system-pods", + PossibleTypes = new [] { typeof(string) })] + string SkipNodesWithSystemPod { get; set; } + + } + /// Parameters to be applied to the cluster-autoscaler when enabled + internal partial interface IManagedClusterPropertiesAutoScalerProfileInternal + + { + /// Valid values are 'true' and 'false' + string BalanceSimilarNodeGroup { get; set; } + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + bool? DaemonsetEvictionForEmptyNode { get; set; } + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + bool? DaemonsetEvictionForOccupiedNode { get; set; } + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander? Expander { get; set; } + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + bool? IgnoreDaemonsetsUtilization { get; set; } + /// The default is 10. + string MaxEmptyBulkDelete { get; set; } + /// The default is 600. + string MaxGracefulTerminationSec { get; set; } + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string MaxNodeProvisionTime { get; set; } + /// The default is 45. The maximum is 100 and the minimum is 0. + string MaxTotalUnreadyPercentage { get; set; } + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + string NewPodScaleUpDelay { get; set; } + /// This must be an integer. The default is 3. + string OkTotalUnreadyCount { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string ScaleDownDelayAfterAdd { get; set; } + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + string ScaleDownDelayAfterDelete { get; set; } + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string ScaleDownDelayAfterFailure { get; set; } + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string ScaleDownUnneededTime { get; set; } + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + string ScaleDownUnreadyTime { get; set; } + /// The default is '0.5'. + string ScaleDownUtilizationThreshold { get; set; } + /// The default is '10'. Values must be an integer number of seconds. + string ScanInterval { get; set; } + /// The default is true. + string SkipNodesWithLocalStorage { get; set; } + /// The default is true. + string SkipNodesWithSystemPod { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.json.cs new file mode 100644 index 000000000000..9d4104ebbd17 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesAutoScalerProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Parameters to be applied to the cluster-autoscaler when enabled + public partial class ManagedClusterPropertiesAutoScalerProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAutoScalerProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPropertiesAutoScalerProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPropertiesAutoScalerProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_balanceSimilarNodeGroup = If( json?.PropertyT("balance-similar-node-groups"), out var __jsonBalanceSimilarNodeGroups) ? (string)__jsonBalanceSimilarNodeGroups : (string)BalanceSimilarNodeGroup;} + {_daemonsetEvictionForEmptyNode = If( json?.PropertyT("daemonset-eviction-for-empty-nodes"), out var __jsonDaemonsetEvictionForEmptyNodes) ? (bool?)__jsonDaemonsetEvictionForEmptyNodes : DaemonsetEvictionForEmptyNode;} + {_daemonsetEvictionForOccupiedNode = If( json?.PropertyT("daemonset-eviction-for-occupied-nodes"), out var __jsonDaemonsetEvictionForOccupiedNodes) ? (bool?)__jsonDaemonsetEvictionForOccupiedNodes : DaemonsetEvictionForOccupiedNode;} + {_ignoreDaemonsetsUtilization = If( json?.PropertyT("ignore-daemonsets-utilization"), out var __jsonIgnoreDaemonsetsUtilization) ? (bool?)__jsonIgnoreDaemonsetsUtilization : IgnoreDaemonsetsUtilization;} + {_expander = If( json?.PropertyT("expander"), out var __jsonExpander) ? (string)__jsonExpander : (string)Expander;} + {_maxEmptyBulkDelete = If( json?.PropertyT("max-empty-bulk-delete"), out var __jsonMaxEmptyBulkDelete) ? (string)__jsonMaxEmptyBulkDelete : (string)MaxEmptyBulkDelete;} + {_maxGracefulTerminationSec = If( json?.PropertyT("max-graceful-termination-sec"), out var __jsonMaxGracefulTerminationSec) ? (string)__jsonMaxGracefulTerminationSec : (string)MaxGracefulTerminationSec;} + {_maxNodeProvisionTime = If( json?.PropertyT("max-node-provision-time"), out var __jsonMaxNodeProvisionTime) ? (string)__jsonMaxNodeProvisionTime : (string)MaxNodeProvisionTime;} + {_maxTotalUnreadyPercentage = If( json?.PropertyT("max-total-unready-percentage"), out var __jsonMaxTotalUnreadyPercentage) ? (string)__jsonMaxTotalUnreadyPercentage : (string)MaxTotalUnreadyPercentage;} + {_newPodScaleUpDelay = If( json?.PropertyT("new-pod-scale-up-delay"), out var __jsonNewPodScaleUpDelay) ? (string)__jsonNewPodScaleUpDelay : (string)NewPodScaleUpDelay;} + {_okTotalUnreadyCount = If( json?.PropertyT("ok-total-unready-count"), out var __jsonOkTotalUnreadyCount) ? (string)__jsonOkTotalUnreadyCount : (string)OkTotalUnreadyCount;} + {_scanInterval = If( json?.PropertyT("scan-interval"), out var __jsonScanInterval) ? (string)__jsonScanInterval : (string)ScanInterval;} + {_scaleDownDelayAfterAdd = If( json?.PropertyT("scale-down-delay-after-add"), out var __jsonScaleDownDelayAfterAdd) ? (string)__jsonScaleDownDelayAfterAdd : (string)ScaleDownDelayAfterAdd;} + {_scaleDownDelayAfterDelete = If( json?.PropertyT("scale-down-delay-after-delete"), out var __jsonScaleDownDelayAfterDelete) ? (string)__jsonScaleDownDelayAfterDelete : (string)ScaleDownDelayAfterDelete;} + {_scaleDownDelayAfterFailure = If( json?.PropertyT("scale-down-delay-after-failure"), out var __jsonScaleDownDelayAfterFailure) ? (string)__jsonScaleDownDelayAfterFailure : (string)ScaleDownDelayAfterFailure;} + {_scaleDownUnneededTime = If( json?.PropertyT("scale-down-unneeded-time"), out var __jsonScaleDownUnneededTime) ? (string)__jsonScaleDownUnneededTime : (string)ScaleDownUnneededTime;} + {_scaleDownUnreadyTime = If( json?.PropertyT("scale-down-unready-time"), out var __jsonScaleDownUnreadyTime) ? (string)__jsonScaleDownUnreadyTime : (string)ScaleDownUnreadyTime;} + {_scaleDownUtilizationThreshold = If( json?.PropertyT("scale-down-utilization-threshold"), out var __jsonScaleDownUtilizationThreshold) ? (string)__jsonScaleDownUtilizationThreshold : (string)ScaleDownUtilizationThreshold;} + {_skipNodesWithLocalStorage = If( json?.PropertyT("skip-nodes-with-local-storage"), out var __jsonSkipNodesWithLocalStorage) ? (string)__jsonSkipNodesWithLocalStorage : (string)SkipNodesWithLocalStorage;} + {_skipNodesWithSystemPod = If( json?.PropertyT("skip-nodes-with-system-pods"), out var __jsonSkipNodesWithSystemPods) ? (string)__jsonSkipNodesWithSystemPods : (string)SkipNodesWithSystemPod;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._balanceSimilarNodeGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._balanceSimilarNodeGroup.ToString()) : null, "balance-similar-node-groups" ,container.Add ); + AddIf( null != this._daemonsetEvictionForEmptyNode ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._daemonsetEvictionForEmptyNode) : null, "daemonset-eviction-for-empty-nodes" ,container.Add ); + AddIf( null != this._daemonsetEvictionForOccupiedNode ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._daemonsetEvictionForOccupiedNode) : null, "daemonset-eviction-for-occupied-nodes" ,container.Add ); + AddIf( null != this._ignoreDaemonsetsUtilization ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._ignoreDaemonsetsUtilization) : null, "ignore-daemonsets-utilization" ,container.Add ); + AddIf( null != (((object)this._expander)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._expander.ToString()) : null, "expander" ,container.Add ); + AddIf( null != (((object)this._maxEmptyBulkDelete)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._maxEmptyBulkDelete.ToString()) : null, "max-empty-bulk-delete" ,container.Add ); + AddIf( null != (((object)this._maxGracefulTerminationSec)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._maxGracefulTerminationSec.ToString()) : null, "max-graceful-termination-sec" ,container.Add ); + AddIf( null != (((object)this._maxNodeProvisionTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._maxNodeProvisionTime.ToString()) : null, "max-node-provision-time" ,container.Add ); + AddIf( null != (((object)this._maxTotalUnreadyPercentage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._maxTotalUnreadyPercentage.ToString()) : null, "max-total-unready-percentage" ,container.Add ); + AddIf( null != (((object)this._newPodScaleUpDelay)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._newPodScaleUpDelay.ToString()) : null, "new-pod-scale-up-delay" ,container.Add ); + AddIf( null != (((object)this._okTotalUnreadyCount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._okTotalUnreadyCount.ToString()) : null, "ok-total-unready-count" ,container.Add ); + AddIf( null != (((object)this._scanInterval)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scanInterval.ToString()) : null, "scan-interval" ,container.Add ); + AddIf( null != (((object)this._scaleDownDelayAfterAdd)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scaleDownDelayAfterAdd.ToString()) : null, "scale-down-delay-after-add" ,container.Add ); + AddIf( null != (((object)this._scaleDownDelayAfterDelete)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scaleDownDelayAfterDelete.ToString()) : null, "scale-down-delay-after-delete" ,container.Add ); + AddIf( null != (((object)this._scaleDownDelayAfterFailure)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scaleDownDelayAfterFailure.ToString()) : null, "scale-down-delay-after-failure" ,container.Add ); + AddIf( null != (((object)this._scaleDownUnneededTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scaleDownUnneededTime.ToString()) : null, "scale-down-unneeded-time" ,container.Add ); + AddIf( null != (((object)this._scaleDownUnreadyTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scaleDownUnreadyTime.ToString()) : null, "scale-down-unready-time" ,container.Add ); + AddIf( null != (((object)this._scaleDownUtilizationThreshold)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._scaleDownUtilizationThreshold.ToString()) : null, "scale-down-utilization-threshold" ,container.Add ); + AddIf( null != (((object)this._skipNodesWithLocalStorage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._skipNodesWithLocalStorage.ToString()) : null, "skip-nodes-with-local-storage" ,container.Add ); + AddIf( null != (((object)this._skipNodesWithSystemPod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._skipNodesWithSystemPod.ToString()) : null, "skip-nodes-with-system-pods" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.PowerShell.cs new file mode 100644 index 000000000000..6c23ac9e8d86 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// managed cluster properties for snapshot, these properties are read only. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesForSnapshotTypeConverter))] + public partial class ManagedClusterPropertiesForSnapshot + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPropertiesForSnapshot(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPropertiesForSnapshot(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPropertiesForSnapshot(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSkuTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("EnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).EnableRbac = (bool?) content.GetValueForProperty("EnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).EnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkProfileNetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkProfileNetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkProfileNetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkProfileNetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkProfileLoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileLoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("NetworkProfileLoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileLoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterPropertiesForSnapshot(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSkuTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("EnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).EnableRbac = (bool?) content.GetValueForProperty("EnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).EnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkProfileNetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkProfileNetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkProfileNetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkProfileNetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileNetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkProfileLoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileLoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("NetworkProfileLoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)this).NetworkProfileLoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// managed cluster properties for snapshot, these properties are read only. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesForSnapshotTypeConverter))] + public partial interface IManagedClusterPropertiesForSnapshot + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.TypeConverter.cs new file mode 100644 index 000000000000..7eafaba2e778 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPropertiesForSnapshotTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPropertiesForSnapshot.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPropertiesForSnapshot.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPropertiesForSnapshot.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.cs new file mode 100644 index 000000000000..eba60e5e7a8c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// managed cluster properties for snapshot, these properties are read only. + public partial class ManagedClusterPropertiesForSnapshot : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal + { + + /// Backing field for property. + private bool? _enableRbac; + + /// Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableRbac { get => this._enableRbac; set => this._enableRbac = value; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// The current kubernetes version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } + + /// Internal Acessors for NetworkProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal.NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshot()); set { {_networkProfile = value;} } } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSku()); set { {_sku = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot _networkProfile; + + /// The current network profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshot()); } + + /// loadBalancerSku for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? NetworkProfileLoadBalancerSku { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).LoadBalancerSku; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).LoadBalancerSku = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku)""); } + + /// networkMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkProfileNetworkMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).NetworkMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).NetworkMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode)""); } + + /// networkPlugin for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkProfileNetworkPlugin { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).NetworkPlugin; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).NetworkPlugin = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin)""); } + + /// NetworkPluginMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkProfileNetworkPluginMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).NetworkPluginMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).NetworkPluginMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode)""); } + + /// networkPolicy for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkProfileNetworkPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).NetworkPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)NetworkProfile).NetworkPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku _sku; + + /// The current managed cluster sku. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSku()); set => this._sku = value; } + + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName)""); } + + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)Sku).Tier = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier)""); } + + /// Creates an new instance. + public ManagedClusterPropertiesForSnapshot() + { + + } + } + /// managed cluster properties for snapshot, these properties are read only. + public partial interface IManagedClusterPropertiesForSnapshot : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the cluster has enabled Kubernetes Role-Based Access Control or not.", + SerializedName = @"enableRbac", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableRbac { get; set; } + /// The current kubernetes version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current kubernetes version.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// loadBalancerSku for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"loadBalancerSku for managed cluster snapshot.", + SerializedName = @"loadBalancerSku", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? NetworkProfileLoadBalancerSku { get; set; } + /// networkMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkMode for managed cluster snapshot.", + SerializedName = @"networkMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkProfileNetworkMode { get; set; } + /// networkPlugin for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkPlugin for managed cluster snapshot.", + SerializedName = @"networkPlugin", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkProfileNetworkPlugin { get; set; } + /// NetworkPluginMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NetworkPluginMode for managed cluster snapshot.", + SerializedName = @"networkPluginMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkProfileNetworkPluginMode { get; set; } + /// networkPolicy for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkPolicy for managed cluster snapshot.", + SerializedName = @"networkPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkProfileNetworkPolicy { get; set; } + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of a managed cluster SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get; set; } + + } + /// managed cluster properties for snapshot, these properties are read only. + internal partial interface IManagedClusterPropertiesForSnapshotInternal + + { + /// Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + bool? EnableRbac { get; set; } + /// The current kubernetes version. + string KubernetesVersion { get; set; } + /// The current network profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot NetworkProfile { get; set; } + /// loadBalancerSku for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? NetworkProfileLoadBalancerSku { get; set; } + /// networkMode for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkProfileNetworkMode { get; set; } + /// networkPlugin for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkProfileNetworkPlugin { get; set; } + /// NetworkPluginMode for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkProfileNetworkPluginMode { get; set; } + /// networkPolicy for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkProfileNetworkPolicy { get; set; } + /// The current managed cluster sku. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku Sku { get; set; } + /// The name of a managed cluster SKU. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.json.cs new file mode 100644 index 000000000000..ce0a284b064c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesForSnapshot.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// managed cluster properties for snapshot, these properties are read only. + public partial class ManagedClusterPropertiesForSnapshot + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPropertiesForSnapshot(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterPropertiesForSnapshot(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSku.FromJson(__jsonSku) : Sku;} + {_networkProfile = If( json?.PropertyT("networkProfile"), out var __jsonNetworkProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshot.FromJson(__jsonNetworkProfile) : NetworkProfile;} + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} + {_enableRbac = If( json?.PropertyT("enableRbac"), out var __jsonEnableRbac) ? (bool?)__jsonEnableRbac : EnableRbac;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._networkProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._networkProfile.ToJson(null,serializationMode) : null, "networkProfile" ,container.Add ); + } + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + AddIf( null != this._enableRbac ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableRbac) : null, "enableRbac" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.PowerShell.cs new file mode 100644 index 000000000000..3c520b2510b5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Identities associated with the cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesIdentityProfileTypeConverter))] + public partial class ManagedClusterPropertiesIdentityProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterPropertiesIdentityProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterPropertiesIdentityProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterPropertiesIdentityProfile(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 ManagedClusterPropertiesIdentityProfile(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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Identities associated with the cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterPropertiesIdentityProfileTypeConverter))] + public partial interface IManagedClusterPropertiesIdentityProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.TypeConverter.cs new file mode 100644 index 000000000000..b1ba224e0dbf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterPropertiesIdentityProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterPropertiesIdentityProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterPropertiesIdentityProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterPropertiesIdentityProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.cs new file mode 100644 index 000000000000..35d85cd53836 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Identities associated with the cluster. + public partial class ManagedClusterPropertiesIdentityProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfileInternal + { + + /// Creates an new instance. + public ManagedClusterPropertiesIdentityProfile() + { + + } + } + /// Identities associated with the cluster. + public partial interface IManagedClusterPropertiesIdentityProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// Identities associated with the cluster. + internal partial interface IManagedClusterPropertiesIdentityProfileInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.dictionary.cs new file mode 100644 index 000000000000..68708e86954d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterPropertiesIdentityProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesIdentityProfile source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.json.cs new file mode 100644 index 000000000000..6f0271f52008 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterPropertiesIdentityProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Identities associated with the cluster. + public partial class ManagedClusterPropertiesIdentityProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterPropertiesIdentityProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ManagedClusterPropertiesIdentityProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.PowerShell.cs new file mode 100644 index 000000000000..1dd3d32ae8cd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.PowerShell.cs @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Security profile for the container service cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileTypeConverter))] + public partial class ManagedClusterSecurityProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSecurityProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSecurityProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSecurityProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Defender")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).Defender = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender) content.GetValueForProperty("Defender",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).Defender, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderTypeConverter.ConvertFrom); + } + if (content.Contains("AzureKeyVaultKm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKm = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms) content.GetValueForProperty("AzureKeyVaultKm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKm, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKmsTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).WorkloadIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity) content.GetValueForProperty("WorkloadIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).WorkloadIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("ImageCleaner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleaner = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner) content.GetValueForProperty("ImageCleaner",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleaner, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleanerTypeConverter.ConvertFrom); + } + if (content.Contains("ImageIntegrity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageIntegrity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity) content.GetValueForProperty("ImageIntegrity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageIntegrity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrityTypeConverter.ConvertFrom); + } + if (content.Contains("NodeRestriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).NodeRestriction = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction) content.GetValueForProperty("NodeRestriction",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).NodeRestriction, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestrictionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomCaTrustCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).CustomCaTrustCertificate = (byte[][]) content.GetValueForProperty("CustomCaTrustCertificate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).CustomCaTrustCertificate, __y => TypeConverterExtensions.SelectToArray(__y, i => i)); + } + if (content.Contains("AzureKeyVaultKmKeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyId, global::System.Convert.ToString); + } + if (content.Contains("DefenderSecurityMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).DefenderSecurityMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring) content.GetValueForProperty("DefenderSecurityMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).DefenderSecurityMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("DefenderLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).DefenderLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("DefenderLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).DefenderLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureKeyVaultKmEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmEnabled = (bool?) content.GetValueForProperty("AzureKeyVaultKmEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureKeyVaultKmKeyVaultNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes?) content.GetValueForProperty("AzureKeyVaultKmKeyVaultNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes.CreateFrom); + } + if (content.Contains("AzureKeyVaultKmKeyVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyVaultResourceId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("WorkloadIdentityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).WorkloadIdentityEnabled = (bool?) content.GetValueForProperty("WorkloadIdentityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).WorkloadIdentityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleanerEnabled = (bool?) content.GetValueForProperty("ImageCleanerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleanerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerIntervalHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleanerIntervalHour = (int?) content.GetValueForProperty("ImageCleanerIntervalHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleanerIntervalHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImageIntegrityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageIntegrityEnabled = (bool?) content.GetValueForProperty("ImageIntegrityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageIntegrityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeRestrictionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).NodeRestrictionEnabled = (bool?) content.GetValueForProperty("NodeRestrictionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).NodeRestrictionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityMonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).SecurityMonitoringEnabled = (bool?) content.GetValueForProperty("SecurityMonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).SecurityMonitoringEnabled, (__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 ManagedClusterSecurityProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Defender")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).Defender = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender) content.GetValueForProperty("Defender",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).Defender, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderTypeConverter.ConvertFrom); + } + if (content.Contains("AzureKeyVaultKm")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKm = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms) content.GetValueForProperty("AzureKeyVaultKm",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKm, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKmsTypeConverter.ConvertFrom); + } + if (content.Contains("WorkloadIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).WorkloadIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity) content.GetValueForProperty("WorkloadIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).WorkloadIdentity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("ImageCleaner")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleaner = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner) content.GetValueForProperty("ImageCleaner",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleaner, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleanerTypeConverter.ConvertFrom); + } + if (content.Contains("ImageIntegrity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageIntegrity = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity) content.GetValueForProperty("ImageIntegrity",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageIntegrity, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrityTypeConverter.ConvertFrom); + } + if (content.Contains("NodeRestriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).NodeRestriction = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction) content.GetValueForProperty("NodeRestriction",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).NodeRestriction, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestrictionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomCaTrustCertificate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).CustomCaTrustCertificate = (byte[][]) content.GetValueForProperty("CustomCaTrustCertificate",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).CustomCaTrustCertificate, __y => TypeConverterExtensions.SelectToArray(__y, i => i)); + } + if (content.Contains("AzureKeyVaultKmKeyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyId, global::System.Convert.ToString); + } + if (content.Contains("DefenderSecurityMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).DefenderSecurityMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring) content.GetValueForProperty("DefenderSecurityMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).DefenderSecurityMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("DefenderLogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).DefenderLogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("DefenderLogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).DefenderLogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("AzureKeyVaultKmEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmEnabled = (bool?) content.GetValueForProperty("AzureKeyVaultKmEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AzureKeyVaultKmKeyVaultNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes?) content.GetValueForProperty("AzureKeyVaultKmKeyVaultNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyVaultNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes.CreateFrom); + } + if (content.Contains("AzureKeyVaultKmKeyVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyVaultResourceId = (string) content.GetValueForProperty("AzureKeyVaultKmKeyVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).AzureKeyVaultKmKeyVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("WorkloadIdentityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).WorkloadIdentityEnabled = (bool?) content.GetValueForProperty("WorkloadIdentityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).WorkloadIdentityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleanerEnabled = (bool?) content.GetValueForProperty("ImageCleanerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleanerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImageCleanerIntervalHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleanerIntervalHour = (int?) content.GetValueForProperty("ImageCleanerIntervalHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageCleanerIntervalHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImageIntegrityEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageIntegrityEnabled = (bool?) content.GetValueForProperty("ImageIntegrityEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).ImageIntegrityEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NodeRestrictionEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).NodeRestrictionEnabled = (bool?) content.GetValueForProperty("NodeRestrictionEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).NodeRestrictionEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SecurityMonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).SecurityMonitoringEnabled = (bool?) content.GetValueForProperty("SecurityMonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal)this).SecurityMonitoringEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Security profile for the container service cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileTypeConverter))] + public partial interface IManagedClusterSecurityProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.TypeConverter.cs new file mode 100644 index 000000000000..8c19641775f4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSecurityProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSecurityProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.cs new file mode 100644 index 000000000000..919f501a8b2d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Security profile for the container service cluster. + public partial class ManagedClusterSecurityProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms _azureKeyVaultKm; + + /// + /// Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for + /// the security profile. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms AzureKeyVaultKm { get => (this._azureKeyVaultKm = this._azureKeyVaultKm ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKms()); set => this._azureKeyVaultKm = value; } + + /// Whether to enable Azure Key Vault key management service. The default is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? AzureKeyVaultKmEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)AzureKeyVaultKm).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)AzureKeyVaultKm).Enabled = value ?? default(bool); } + + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AzureKeyVaultKmKeyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)AzureKeyVaultKm).KeyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)AzureKeyVaultKm).KeyId = value ?? null; } + + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? AzureKeyVaultKmKeyVaultNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)AzureKeyVaultKm).KeyVaultNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)AzureKeyVaultKm).KeyVaultNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes)""); } + + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string AzureKeyVaultKmKeyVaultResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)AzureKeyVaultKm).KeyVaultResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKmsInternal)AzureKeyVaultKm).KeyVaultResourceId = value ?? null; } + + /// Backing field for property. + private byte[][] _customCaTrustCertificate; + + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public byte[][] CustomCaTrustCertificate { get => this._customCaTrustCertificate; set => this._customCaTrustCertificate = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender _defender; + + /// Microsoft Defender settings for the security profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender Defender { get => (this._defender = this._defender ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefender()); set => this._defender = value; } + + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DefenderLogAnalyticsWorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)Defender).LogAnalyticsWorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)Defender).LogAnalyticsWorkspaceResourceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner _imageCleaner; + + /// Image Cleaner settings for the security profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner ImageCleaner { get => (this._imageCleaner = this._imageCleaner ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleaner()); set => this._imageCleaner = value; } + + /// Whether to enable Image Cleaner on AKS cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ImageCleanerEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)ImageCleaner).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)ImageCleaner).Enabled = value ?? default(bool); } + + /// Image Cleaner scanning interval in hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ImageCleanerIntervalHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)ImageCleaner).IntervalHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)ImageCleaner).IntervalHour = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity _imageIntegrity; + + /// + /// Image integrity is a feature that works with Azure Policy to verify image integrity by signature. This will not have any + /// effect unless Azure Policy is applied to enforce image signatures. See https://aka.ms/aks/image-integrity for how to use + /// this feature via policy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity ImageIntegrity { get => (this._imageIntegrity = this._imageIntegrity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrity()); set => this._imageIntegrity = value; } + + /// Whether to enable image integrity. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ImageIntegrityEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrityInternal)ImageIntegrity).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrityInternal)ImageIntegrity).Enabled = value ?? default(bool); } + + /// Internal Acessors for AzureKeyVaultKm + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal.AzureKeyVaultKm { get => (this._azureKeyVaultKm = this._azureKeyVaultKm ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKms()); set { {_azureKeyVaultKm = value;} } } + + /// Internal Acessors for Defender + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal.Defender { get => (this._defender = this._defender ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefender()); set { {_defender = value;} } } + + /// Internal Acessors for DefenderSecurityMonitoring + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal.DefenderSecurityMonitoring { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)Defender).SecurityMonitoring; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)Defender).SecurityMonitoring = value; } + + /// Internal Acessors for ImageCleaner + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal.ImageCleaner { get => (this._imageCleaner = this._imageCleaner ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleaner()); set { {_imageCleaner = value;} } } + + /// Internal Acessors for ImageIntegrity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal.ImageIntegrity { get => (this._imageIntegrity = this._imageIntegrity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrity()); set { {_imageIntegrity = value;} } } + + /// Internal Acessors for NodeRestriction + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal.NodeRestriction { get => (this._nodeRestriction = this._nodeRestriction ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestriction()); set { {_nodeRestriction = value;} } } + + /// Internal Acessors for WorkloadIdentity + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileInternal.WorkloadIdentity { get => (this._workloadIdentity = this._workloadIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentity()); set { {_workloadIdentity = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction _nodeRestriction; + + /// + /// [Node Restriction](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction) settings + /// for the security profile. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction NodeRestriction { get => (this._nodeRestriction = this._nodeRestriction ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestriction()); set => this._nodeRestriction = value; } + + /// Whether to enable Node Restriction + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? NodeRestrictionEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestrictionInternal)NodeRestriction).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestrictionInternal)NodeRestriction).Enabled = value ?? default(bool); } + + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SecurityMonitoringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)Defender).SecurityMonitoringEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)Defender).SecurityMonitoringEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity _workloadIdentity; + + /// + /// Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure + /// cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity WorkloadIdentity { get => (this._workloadIdentity = this._workloadIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentity()); set => this._workloadIdentity = value; } + + /// Whether to enable workload identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? WorkloadIdentityEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentityInternal)WorkloadIdentity).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentityInternal)WorkloadIdentity).Enabled = value ?? default(bool); } + + /// Creates an new instance. + public ManagedClusterSecurityProfile() + { + + } + } + /// Security profile for the container service cluster. + public partial interface IManagedClusterSecurityProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable Azure Key Vault key management service. The default is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure Key Vault key management service. The default is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AzureKeyVaultKmEnabled { get; set; } + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty.", + SerializedName = @"keyId", + PossibleTypes = new [] { typeof(string) })] + string AzureKeyVaultKmKeyId { get; set; } + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`.", + SerializedName = @"keyVaultNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? AzureKeyVaultKmKeyVaultNetworkAccess { get; set; } + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty.", + SerializedName = @"keyVaultResourceId", + PossibleTypes = new [] { typeof(string) })] + string AzureKeyVaultKmKeyVaultResourceId { get; set; } + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority)", + SerializedName = @"customCATrustCertificates", + PossibleTypes = new [] { typeof(byte[]) })] + byte[][] CustomCaTrustCertificate { get; set; } + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string DefenderLogAnalyticsWorkspaceResourceId { get; set; } + /// Whether to enable Image Cleaner on AKS cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Image Cleaner on AKS cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImageCleanerEnabled { get; set; } + /// Image Cleaner scanning interval in hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image Cleaner scanning interval in hours.", + SerializedName = @"intervalHours", + PossibleTypes = new [] { typeof(int) })] + int? ImageCleanerIntervalHour { get; set; } + /// Whether to enable image integrity. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable image integrity. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImageIntegrityEnabled { get; set; } + /// Whether to enable Node Restriction + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Node Restriction", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? NodeRestrictionEnabled { get; set; } + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Defender threat detection", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SecurityMonitoringEnabled { get; set; } + /// Whether to enable workload identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable workload identity.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? WorkloadIdentityEnabled { get; set; } + + } + /// Security profile for the container service cluster. + internal partial interface IManagedClusterSecurityProfileInternal + + { + /// + /// Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for + /// the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAzureKeyVaultKms AzureKeyVaultKm { get; set; } + /// Whether to enable Azure Key Vault key management service. The default is false. + bool? AzureKeyVaultKmEnabled { get; set; } + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + string AzureKeyVaultKmKeyId { get; set; } + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes? AzureKeyVaultKmKeyVaultNetworkAccess { get; set; } + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + string AzureKeyVaultKmKeyVaultResourceId { get; set; } + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + byte[][] CustomCaTrustCertificate { get; set; } + /// Microsoft Defender settings for the security profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender Defender { get; set; } + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + string DefenderLogAnalyticsWorkspaceResourceId { get; set; } + /// + /// Microsoft Defender threat detection for Cloud settings for the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring DefenderSecurityMonitoring { get; set; } + /// Image Cleaner settings for the security profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner ImageCleaner { get; set; } + /// Whether to enable Image Cleaner on AKS cluster. + bool? ImageCleanerEnabled { get; set; } + /// Image Cleaner scanning interval in hours. + int? ImageCleanerIntervalHour { get; set; } + /// + /// Image integrity is a feature that works with Azure Policy to verify image integrity by signature. This will not have any + /// effect unless Azure Policy is applied to enforce image signatures. See https://aka.ms/aks/image-integrity for how to use + /// this feature via policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity ImageIntegrity { get; set; } + /// Whether to enable image integrity. The default value is false. + bool? ImageIntegrityEnabled { get; set; } + /// + /// [Node Restriction](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction) settings + /// for the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction NodeRestriction { get; set; } + /// Whether to enable Node Restriction + bool? NodeRestrictionEnabled { get; set; } + /// Whether to enable Defender threat detection + bool? SecurityMonitoringEnabled { get; set; } + /// + /// Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure + /// cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity WorkloadIdentity { get; set; } + /// Whether to enable workload identity. + bool? WorkloadIdentityEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.json.cs new file mode 100644 index 000000000000..af3292bd3f4a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Security profile for the container service cluster. + public partial class ManagedClusterSecurityProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSecurityProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSecurityProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_defender = If( json?.PropertyT("defender"), out var __jsonDefender) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefender.FromJson(__jsonDefender) : Defender;} + {_azureKeyVaultKm = If( json?.PropertyT("azureKeyVaultKms"), out var __jsonAzureKeyVaultKms) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AzureKeyVaultKms.FromJson(__jsonAzureKeyVaultKms) : AzureKeyVaultKm;} + {_workloadIdentity = If( json?.PropertyT("workloadIdentity"), out var __jsonWorkloadIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileWorkloadIdentity.FromJson(__jsonWorkloadIdentity) : WorkloadIdentity;} + {_imageCleaner = If( json?.PropertyT("imageCleaner"), out var __jsonImageCleaner) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageCleaner.FromJson(__jsonImageCleaner) : ImageCleaner;} + {_imageIntegrity = If( json?.PropertyT("imageIntegrity"), out var __jsonImageIntegrity) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileImageIntegrity.FromJson(__jsonImageIntegrity) : ImageIntegrity;} + {_nodeRestriction = If( json?.PropertyT("nodeRestriction"), out var __jsonNodeRestriction) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileNodeRestriction.FromJson(__jsonNodeRestriction) : NodeRestriction;} + {_customCaTrustCertificate = If( json?.PropertyT("customCATrustCertificates"), out var __jsonCustomCaTrustCertificates) ? If( __jsonCustomCaTrustCertificates as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(byte[]) (null /* deserializeFromNode doesn't support 'application/json' /home/cloudtest/.autorest/@autorest_powershell@3.0.519/node_modules/@autorest/powershell/dist/llcsharp/schema/byte-array.js*/)) ))() : null : CustomCaTrustCertificate;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._defender ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._defender.ToJson(null,serializationMode) : null, "defender" ,container.Add ); + AddIf( null != this._azureKeyVaultKm ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._azureKeyVaultKm.ToJson(null,serializationMode) : null, "azureKeyVaultKms" ,container.Add ); + AddIf( null != this._workloadIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._workloadIdentity.ToJson(null,serializationMode) : null, "workloadIdentity" ,container.Add ); + AddIf( null != this._imageCleaner ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._imageCleaner.ToJson(null,serializationMode) : null, "imageCleaner" ,container.Add ); + AddIf( null != this._imageIntegrity ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._imageIntegrity.ToJson(null,serializationMode) : null, "imageIntegrity" ,container.Add ); + AddIf( null != this._nodeRestriction ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._nodeRestriction.ToJson(null,serializationMode) : null, "nodeRestriction" ,container.Add ); + if (null != this._customCaTrustCertificate) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._customCaTrustCertificate ) + { + AddIf(new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(System.Convert.ToBase64String(__x)) ,__w.Add); + } + container.Add("customCATrustCertificates",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.PowerShell.cs new file mode 100644 index 000000000000..6e67200b7d1d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Microsoft Defender settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileDefenderTypeConverter))] + public partial class ManagedClusterSecurityProfileDefender + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSecurityProfileDefender(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSecurityProfileDefender(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSecurityProfileDefender(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SecurityMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).SecurityMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring) content.GetValueForProperty("SecurityMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).SecurityMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("LogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).LogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("LogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).LogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecurityMonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).SecurityMonitoringEnabled = (bool?) content.GetValueForProperty("SecurityMonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).SecurityMonitoringEnabled, (__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 ManagedClusterSecurityProfileDefender(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SecurityMonitoring")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).SecurityMonitoring = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring) content.GetValueForProperty("SecurityMonitoring",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).SecurityMonitoring, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter.ConvertFrom); + } + if (content.Contains("LogAnalyticsWorkspaceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).LogAnalyticsWorkspaceResourceId = (string) content.GetValueForProperty("LogAnalyticsWorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).LogAnalyticsWorkspaceResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecurityMonitoringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).SecurityMonitoringEnabled = (bool?) content.GetValueForProperty("SecurityMonitoringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal)this).SecurityMonitoringEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Microsoft Defender settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileDefenderTypeConverter))] + public partial interface IManagedClusterSecurityProfileDefender + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.TypeConverter.cs new file mode 100644 index 000000000000..bfa11512954a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSecurityProfileDefenderTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSecurityProfileDefender.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileDefender.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileDefender.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.cs new file mode 100644 index 000000000000..a15acbcf0343 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Microsoft Defender settings for the security profile. + public partial class ManagedClusterSecurityProfileDefender : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal + { + + /// Backing field for property. + private string _logAnalyticsWorkspaceResourceId; + + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string LogAnalyticsWorkspaceResourceId { get => this._logAnalyticsWorkspaceResourceId; set => this._logAnalyticsWorkspaceResourceId = value; } + + /// Internal Acessors for SecurityMonitoring + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderInternal.SecurityMonitoring { get => (this._securityMonitoring = this._securityMonitoring ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoring()); set { {_securityMonitoring = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring _securityMonitoring; + + /// + /// Microsoft Defender threat detection for Cloud settings for the security profile. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring SecurityMonitoring { get => (this._securityMonitoring = this._securityMonitoring ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoring()); set => this._securityMonitoring = value; } + + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SecurityMonitoringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoringInternal)SecurityMonitoring).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoringInternal)SecurityMonitoring).Enabled = value ?? default(bool); } + + /// Creates an new instance. + public ManagedClusterSecurityProfileDefender() + { + + } + } + /// Microsoft Defender settings for the security profile. + public partial interface IManagedClusterSecurityProfileDefender : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + string LogAnalyticsWorkspaceResourceId { get; set; } + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Defender threat detection", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SecurityMonitoringEnabled { get; set; } + + } + /// Microsoft Defender settings for the security profile. + internal partial interface IManagedClusterSecurityProfileDefenderInternal + + { + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + string LogAnalyticsWorkspaceResourceId { get; set; } + /// + /// Microsoft Defender threat detection for Cloud settings for the security profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring SecurityMonitoring { get; set; } + /// Whether to enable Defender threat detection + bool? SecurityMonitoringEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.json.cs new file mode 100644 index 000000000000..66310d6fc530 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefender.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Microsoft Defender settings for the security profile. + public partial class ManagedClusterSecurityProfileDefender + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefender FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSecurityProfileDefender(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSecurityProfileDefender(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_securityMonitoring = If( json?.PropertyT("securityMonitoring"), out var __jsonSecurityMonitoring) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSecurityProfileDefenderSecurityMonitoring.FromJson(__jsonSecurityMonitoring) : SecurityMonitoring;} + {_logAnalyticsWorkspaceResourceId = If( json?.PropertyT("logAnalyticsWorkspaceResourceId"), out var __jsonLogAnalyticsWorkspaceResourceId) ? (string)__jsonLogAnalyticsWorkspaceResourceId : (string)LogAnalyticsWorkspaceResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._securityMonitoring ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._securityMonitoring.ToJson(null,serializationMode) : null, "securityMonitoring" ,container.Add ); + AddIf( null != (((object)this._logAnalyticsWorkspaceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._logAnalyticsWorkspaceResourceId.ToString()) : null, "logAnalyticsWorkspaceResourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.PowerShell.cs new file mode 100644 index 000000000000..c615b3881a59 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Microsoft Defender settings for the security profile threat detection. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter))] + public partial class ManagedClusterSecurityProfileDefenderSecurityMonitoring + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSecurityProfileDefenderSecurityMonitoring(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSecurityProfileDefenderSecurityMonitoring(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSecurityProfileDefenderSecurityMonitoring(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoringInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoringInternal)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 ManagedClusterSecurityProfileDefenderSecurityMonitoring(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoringInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoringInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Microsoft Defender settings for the security profile threat detection. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter))] + public partial interface IManagedClusterSecurityProfileDefenderSecurityMonitoring + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.TypeConverter.cs new file mode 100644 index 000000000000..60f908e50bd0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSecurityProfileDefenderSecurityMonitoringTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSecurityProfileDefenderSecurityMonitoring.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileDefenderSecurityMonitoring.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileDefenderSecurityMonitoring.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs new file mode 100644 index 000000000000..5a3318f4741d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Microsoft Defender settings for the security profile threat detection. + public partial class ManagedClusterSecurityProfileDefenderSecurityMonitoring : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoringInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterSecurityProfileDefenderSecurityMonitoring() + { + + } + } + /// Microsoft Defender settings for the security profile threat detection. + public partial interface IManagedClusterSecurityProfileDefenderSecurityMonitoring : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable Defender threat detection + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Defender threat detection", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Microsoft Defender settings for the security profile threat detection. + internal partial interface IManagedClusterSecurityProfileDefenderSecurityMonitoringInternal + + { + /// Whether to enable Defender threat detection + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.json.cs new file mode 100644 index 000000000000..5ee4705d1554 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileDefenderSecurityMonitoring.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Microsoft Defender settings for the security profile threat detection. + public partial class ManagedClusterSecurityProfileDefenderSecurityMonitoring + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileDefenderSecurityMonitoring FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSecurityProfileDefenderSecurityMonitoring(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSecurityProfileDefenderSecurityMonitoring(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.PowerShell.cs new file mode 100644 index 000000000000..a8db6f0bf909 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.PowerShell.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. Here + /// are settings for the security profile. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileImageCleanerTypeConverter))] + public partial class ManagedClusterSecurityProfileImageCleaner + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSecurityProfileImageCleaner(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSecurityProfileImageCleaner(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSecurityProfileImageCleaner(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IntervalHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)this).IntervalHour = (int?) content.GetValueForProperty("IntervalHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)this).IntervalHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterSecurityProfileImageCleaner(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IntervalHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)this).IntervalHour = (int?) content.GetValueForProperty("IntervalHour",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal)this).IntervalHour, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. Here + /// are settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileImageCleanerTypeConverter))] + public partial interface IManagedClusterSecurityProfileImageCleaner + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.TypeConverter.cs new file mode 100644 index 000000000000..31223cdd58b0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSecurityProfileImageCleanerTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSecurityProfileImageCleaner.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileImageCleaner.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileImageCleaner.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.cs new file mode 100644 index 000000000000..c590dfa5a66b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. Here + /// are settings for the security profile. + /// + public partial class ManagedClusterSecurityProfileImageCleaner : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleanerInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable Image Cleaner on AKS cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private int? _intervalHour; + + /// Image Cleaner scanning interval in hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? IntervalHour { get => this._intervalHour; set => this._intervalHour = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterSecurityProfileImageCleaner() + { + + } + } + /// Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. Here + /// are settings for the security profile. + public partial interface IManagedClusterSecurityProfileImageCleaner : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable Image Cleaner on AKS cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Image Cleaner on AKS cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// Image Cleaner scanning interval in hours. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image Cleaner scanning interval in hours.", + SerializedName = @"intervalHours", + PossibleTypes = new [] { typeof(int) })] + int? IntervalHour { get; set; } + + } + /// Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. Here + /// are settings for the security profile. + internal partial interface IManagedClusterSecurityProfileImageCleanerInternal + + { + /// Whether to enable Image Cleaner on AKS cluster. + bool? Enabled { get; set; } + /// Image Cleaner scanning interval in hours. + int? IntervalHour { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.json.cs new file mode 100644 index 000000000000..6722dde7b2b8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageCleaner.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce attack surface area. Here + /// are settings for the security profile. + /// + public partial class ManagedClusterSecurityProfileImageCleaner + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageCleaner FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSecurityProfileImageCleaner(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSecurityProfileImageCleaner(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_intervalHour = If( json?.PropertyT("intervalHours"), out var __jsonIntervalHours) ? (int?)__jsonIntervalHours : IntervalHour;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != this._intervalHour ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._intervalHour) : null, "intervalHours" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.PowerShell.cs new file mode 100644 index 000000000000..c1fd7b3587ec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Image integrity related settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileImageIntegrityTypeConverter))] + public partial class ManagedClusterSecurityProfileImageIntegrity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSecurityProfileImageIntegrity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSecurityProfileImageIntegrity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSecurityProfileImageIntegrity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrityInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrityInternal)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 ManagedClusterSecurityProfileImageIntegrity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrityInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrityInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Image integrity related settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileImageIntegrityTypeConverter))] + public partial interface IManagedClusterSecurityProfileImageIntegrity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.TypeConverter.cs new file mode 100644 index 000000000000..1a3abfb58f55 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSecurityProfileImageIntegrityTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSecurityProfileImageIntegrity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileImageIntegrity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileImageIntegrity.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.cs new file mode 100644 index 000000000000..e53a4358762a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Image integrity related settings for the security profile. + public partial class ManagedClusterSecurityProfileImageIntegrity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrityInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable image integrity. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterSecurityProfileImageIntegrity() + { + + } + } + /// Image integrity related settings for the security profile. + public partial interface IManagedClusterSecurityProfileImageIntegrity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable image integrity. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable image integrity. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Image integrity related settings for the security profile. + internal partial interface IManagedClusterSecurityProfileImageIntegrityInternal + + { + /// Whether to enable image integrity. The default value is false. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.json.cs new file mode 100644 index 000000000000..49d9994770b9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileImageIntegrity.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Image integrity related settings for the security profile. + public partial class ManagedClusterSecurityProfileImageIntegrity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileImageIntegrity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSecurityProfileImageIntegrity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSecurityProfileImageIntegrity(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.PowerShell.cs new file mode 100644 index 000000000000..9638d654f835 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Node Restriction settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileNodeRestrictionTypeConverter))] + public partial class ManagedClusterSecurityProfileNodeRestriction + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSecurityProfileNodeRestriction(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSecurityProfileNodeRestriction(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSecurityProfileNodeRestriction(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestrictionInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestrictionInternal)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 ManagedClusterSecurityProfileNodeRestriction(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestrictionInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestrictionInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Node Restriction settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileNodeRestrictionTypeConverter))] + public partial interface IManagedClusterSecurityProfileNodeRestriction + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.TypeConverter.cs new file mode 100644 index 000000000000..73bfafd7c6cf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSecurityProfileNodeRestrictionTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSecurityProfileNodeRestriction.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileNodeRestriction.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileNodeRestriction.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.cs new file mode 100644 index 000000000000..6c8ee2acd321 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Node Restriction settings for the security profile. + public partial class ManagedClusterSecurityProfileNodeRestriction : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestrictionInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable Node Restriction + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterSecurityProfileNodeRestriction() + { + + } + } + /// Node Restriction settings for the security profile. + public partial interface IManagedClusterSecurityProfileNodeRestriction : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable Node Restriction + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Node Restriction", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Node Restriction settings for the security profile. + internal partial interface IManagedClusterSecurityProfileNodeRestrictionInternal + + { + /// Whether to enable Node Restriction + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.json.cs new file mode 100644 index 000000000000..e4b4ae00dc9b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileNodeRestriction.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Node Restriction settings for the security profile. + public partial class ManagedClusterSecurityProfileNodeRestriction + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileNodeRestriction FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSecurityProfileNodeRestriction(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSecurityProfileNodeRestriction(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.PowerShell.cs new file mode 100644 index 000000000000..f66e421514ff --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Workload identity settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileWorkloadIdentityTypeConverter))] + public partial class ManagedClusterSecurityProfileWorkloadIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSecurityProfileWorkloadIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSecurityProfileWorkloadIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSecurityProfileWorkloadIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentityInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentityInternal)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 ManagedClusterSecurityProfileWorkloadIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentityInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentityInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Workload identity settings for the security profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSecurityProfileWorkloadIdentityTypeConverter))] + public partial interface IManagedClusterSecurityProfileWorkloadIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.TypeConverter.cs new file mode 100644 index 000000000000..2ee582a1fea9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSecurityProfileWorkloadIdentityTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSecurityProfileWorkloadIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileWorkloadIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSecurityProfileWorkloadIdentity.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.cs new file mode 100644 index 000000000000..ce53cf8802a6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Workload identity settings for the security profile. + public partial class ManagedClusterSecurityProfileWorkloadIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentityInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable workload identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterSecurityProfileWorkloadIdentity() + { + + } + } + /// Workload identity settings for the security profile. + public partial interface IManagedClusterSecurityProfileWorkloadIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable workload identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable workload identity.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Workload identity settings for the security profile. + internal partial interface IManagedClusterSecurityProfileWorkloadIdentityInternal + + { + /// Whether to enable workload identity. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.json.cs new file mode 100644 index 000000000000..bc761481f89b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSecurityProfileWorkloadIdentity.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Workload identity settings for the security profile. + public partial class ManagedClusterSecurityProfileWorkloadIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSecurityProfileWorkloadIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSecurityProfileWorkloadIdentity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSecurityProfileWorkloadIdentity(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.PowerShell.cs new file mode 100644 index 000000000000..41aae81f9e6c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.PowerShell.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterServicePrincipalProfileTypeConverter))] + public partial class ManagedClusterServicePrincipalProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterServicePrincipalProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterServicePrincipalProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterServicePrincipalProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)this).ClientId, global::System.Convert.ToString); + } + if (content.Contains("Secret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)this).Secret = (string) content.GetValueForProperty("Secret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)this).Secret, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterServicePrincipalProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)this).ClientId, global::System.Convert.ToString); + } + if (content.Contains("Secret")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)this).Secret = (string) content.GetValueForProperty("Secret",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal)this).Secret, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterServicePrincipalProfileTypeConverter))] + public partial interface IManagedClusterServicePrincipalProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.TypeConverter.cs new file mode 100644 index 000000000000..6966454f916f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterServicePrincipalProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterServicePrincipalProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterServicePrincipalProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterServicePrincipalProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.cs new file mode 100644 index 000000000000..b6f890096cf9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + public partial class ManagedClusterServicePrincipalProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfileInternal + { + + /// Backing field for property. + private string _clientId; + + /// The ID for the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// Backing field for property. + private string _secret; + + /// The secret password associated with the service principal in plain text. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Secret { get => this._secret; set => this._secret = value; } + + /// Creates an new instance. + public ManagedClusterServicePrincipalProfile() + { + + } + } + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + public partial interface IManagedClusterServicePrincipalProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The ID for the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID for the service principal.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// The secret password associated with the service principal in plain text. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secret password associated with the service principal in plain text.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(string) })] + string Secret { get; set; } + + } + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + internal partial interface IManagedClusterServicePrincipalProfileInternal + + { + /// The ID for the service principal. + string ClientId { get; set; } + /// The secret password associated with the service principal in plain text. + string Secret { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.json.cs new file mode 100644 index 000000000000..3007ecfe476d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterServicePrincipalProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + public partial class ManagedClusterServicePrincipalProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterServicePrincipalProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterServicePrincipalProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_secret = If( json?.PropertyT("secret"), out var __jsonSecret) ? (string)__jsonSecret : (string)Secret;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AddIf( null != (((object)this._secret)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._secret.ToString()) : null, "secret" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.PowerShell.cs new file mode 100644 index 000000000000..a5ec842bae0d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The SKU of a Managed Cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSkuTypeConverter))] + public partial class ManagedClusterSku + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSku(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSku(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSku(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.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterSku(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.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The SKU of a Managed Cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSkuTypeConverter))] + public partial interface IManagedClusterSku + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.TypeConverter.cs new file mode 100644 index 000000000000..5a64f995a806 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSkuTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSku.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSku.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSku.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.cs new file mode 100644 index 000000000000..907ba5c90657 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The SKU of a Managed Cluster. + public partial class ManagedClusterSku : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSkuInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? _name; + + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? _tier; + + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? Tier { get => this._tier; set => this._tier = value; } + + /// Creates an new instance. + public ManagedClusterSku() + { + + } + } + /// The SKU of a Managed Cluster. + public partial interface IManagedClusterSku : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of a managed cluster SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? Name { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? Tier { get; set; } + + } + /// The SKU of a Managed Cluster. + internal partial interface IManagedClusterSkuInternal + + { + /// The name of a managed cluster SKU. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? Name { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? Tier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.json.cs new file mode 100644 index 000000000000..6a64329a5f49 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSku.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The SKU of a Managed Cluster. + public partial class ManagedClusterSku + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSku(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSku(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.PowerShell.cs new file mode 100644 index 000000000000..3ed666649162 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.PowerShell.cs @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A managed cluster snapshot resource. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSnapshotTypeConverter))] + public partial class ManagedClusterSnapshot + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSnapshot(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSnapshot(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSnapshot(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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SnapshotType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType?) content.GetValueForProperty("SnapshotType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SnapshotType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType.CreateFrom); + } + if (content.Contains("ManagedClusterPropertiesReadOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertiesReadOnly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot) content.GetValueForProperty("ManagedClusterPropertiesReadOnly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertiesReadOnly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ManagedClusterPropertyReadOnlySku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlySku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku) content.GetValueForProperty("ManagedClusterPropertyReadOnlySku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlySku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertyReadOnlyNetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyNetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot) content.GetValueForProperty("ManagedClusterPropertyReadOnlyNetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyNetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertyReadOnlyKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyKubernetesVersion = (string) content.GetValueForProperty("ManagedClusterPropertyReadOnlyKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("ManagedClusterPropertyReadOnlyEnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyEnableRbac = (bool?) content.GetValueForProperty("ManagedClusterPropertyReadOnlyEnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyEnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkProfileNetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkProfileNetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkProfileNetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkProfileNetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkProfileLoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileLoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("NetworkProfileLoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileLoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterSnapshot(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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SnapshotType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType?) content.GetValueForProperty("SnapshotType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SnapshotType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType.CreateFrom); + } + if (content.Contains("ManagedClusterPropertiesReadOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertiesReadOnly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot) content.GetValueForProperty("ManagedClusterPropertiesReadOnly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertiesReadOnly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ManagedClusterPropertyReadOnlySku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlySku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku) content.GetValueForProperty("ManagedClusterPropertyReadOnlySku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlySku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertyReadOnlyNetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyNetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot) content.GetValueForProperty("ManagedClusterPropertyReadOnlyNetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyNetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertyReadOnlyKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyKubernetesVersion = (string) content.GetValueForProperty("ManagedClusterPropertyReadOnlyKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("ManagedClusterPropertyReadOnlyEnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyEnableRbac = (bool?) content.GetValueForProperty("ManagedClusterPropertyReadOnlyEnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).ManagedClusterPropertyReadOnlyEnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkProfileNetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkProfileNetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkProfileNetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkProfileNetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileNetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkProfileLoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileLoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("NetworkProfileLoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal)this).NetworkProfileLoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A managed cluster snapshot resource. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSnapshotTypeConverter))] + public partial interface IManagedClusterSnapshot + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.TypeConverter.cs new file mode 100644 index 000000000000..0e8144837db5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSnapshotTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSnapshot.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSnapshot.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSnapshot.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.cs new file mode 100644 index 000000000000..396d32f72c09 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A managed cluster snapshot resource. + public partial class ManagedClusterSnapshot : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource(); + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CreationDataSourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).CreationDataSourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).CreationDataSourceResourceId = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ManagedClusterPropertyReadOnlyEnableRbac { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertyReadOnlyEnableRbac; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertyReadOnlyEnableRbac = value ?? default(bool); } + + /// The current kubernetes version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ManagedClusterPropertyReadOnlyKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertyReadOnlyKubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertyReadOnlyKubernetesVersion = value ?? null; } + + /// Internal Acessors for CreationData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal.CreationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).CreationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).CreationData = value; } + + /// Internal Acessors for ManagedClusterPropertiesReadOnly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal.ManagedClusterPropertiesReadOnly { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertiesReadOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertiesReadOnly = value; } + + /// Internal Acessors for ManagedClusterPropertyReadOnlyNetworkProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal.ManagedClusterPropertyReadOnlyNetworkProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertyReadOnlyNetworkProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertyReadOnlyNetworkProfile = value; } + + /// Internal Acessors for ManagedClusterPropertyReadOnlySku + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal.ManagedClusterPropertyReadOnlySku { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertyReadOnlySku; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).ManagedClusterPropertyReadOnlySku = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name; } + + /// loadBalancerSku for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? NetworkProfileLoadBalancerSku { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileLoadBalancerSku; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileLoadBalancerSku = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku)""); } + + /// networkMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkProfileNetworkMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileNetworkMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileNetworkMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode)""); } + + /// networkPlugin for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkProfileNetworkPlugin { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileNetworkPlugin; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileNetworkPlugin = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin)""); } + + /// NetworkPluginMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkProfileNetworkPluginMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileNetworkPluginMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileNetworkPluginMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode)""); } + + /// networkPolicy for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkProfileNetworkPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileNetworkPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).NetworkProfileNetworkPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties _property; + + /// Properties of a managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotProperties()); set => this._property = value; } + + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).SkuName = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName)""); } + + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).SkuTier = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier)""); } + + /// The type of a snapshot. The default is NodePool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).SnapshotType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)Property).SnapshotType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType)""); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public ManagedClusterSnapshot() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// A managed cluster snapshot resource. + public partial interface IManagedClusterSnapshot : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource + { + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string CreationDataSourceResourceId { get; set; } + /// Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the cluster has enabled Kubernetes Role-Based Access Control or not.", + SerializedName = @"enableRbac", + PossibleTypes = new [] { typeof(bool) })] + bool? ManagedClusterPropertyReadOnlyEnableRbac { get; set; } + /// The current kubernetes version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current kubernetes version.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string ManagedClusterPropertyReadOnlyKubernetesVersion { get; set; } + /// loadBalancerSku for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"loadBalancerSku for managed cluster snapshot.", + SerializedName = @"loadBalancerSku", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? NetworkProfileLoadBalancerSku { get; set; } + /// networkMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkMode for managed cluster snapshot.", + SerializedName = @"networkMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkProfileNetworkMode { get; set; } + /// networkPlugin for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkPlugin for managed cluster snapshot.", + SerializedName = @"networkPlugin", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkProfileNetworkPlugin { get; set; } + /// NetworkPluginMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NetworkPluginMode for managed cluster snapshot.", + SerializedName = @"networkPluginMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkProfileNetworkPluginMode { get; set; } + /// networkPolicy for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkPolicy for managed cluster snapshot.", + SerializedName = @"networkPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkProfileNetworkPolicy { get; set; } + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of a managed cluster SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get; set; } + /// The type of a snapshot. The default is NodePool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of a snapshot. The default is NodePool.", + SerializedName = @"snapshotType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get; set; } + + } + /// A managed cluster snapshot resource. + internal partial interface IManagedClusterSnapshotInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal + { + /// + /// CreationData to be used to specify the source resource ID to create this snapshot. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + string CreationDataSourceResourceId { get; set; } + /// + /// What the properties will be showed when getting managed cluster snapshot. Those properties are read-only. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot ManagedClusterPropertiesReadOnly { get; set; } + /// Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + bool? ManagedClusterPropertyReadOnlyEnableRbac { get; set; } + /// The current kubernetes version. + string ManagedClusterPropertyReadOnlyKubernetesVersion { get; set; } + /// The current network profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot ManagedClusterPropertyReadOnlyNetworkProfile { get; set; } + /// The current managed cluster sku. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku ManagedClusterPropertyReadOnlySku { get; set; } + /// loadBalancerSku for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? NetworkProfileLoadBalancerSku { get; set; } + /// networkMode for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkProfileNetworkMode { get; set; } + /// networkPlugin for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkProfileNetworkPlugin { get; set; } + /// NetworkPluginMode for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkProfileNetworkPluginMode { get; set; } + /// networkPolicy for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkProfileNetworkPolicy { get; set; } + /// Properties of a managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties Property { get; set; } + /// The name of a managed cluster SKU. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get; set; } + /// The type of a snapshot. The default is NodePool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.json.cs new file mode 100644 index 000000000000..f67093e52fea --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshot.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A managed cluster snapshot resource. + public partial class ManagedClusterSnapshot + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSnapshot(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSnapshot(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.PowerShell.cs new file mode 100644 index 000000000000..be5c227f203c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The response from the List Managed Cluster Snapshots operation. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSnapshotListResultTypeConverter))] + public partial class ManagedClusterSnapshotListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSnapshotListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSnapshotListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSnapshotListResult(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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal)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 ManagedClusterSnapshotListResult(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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshotTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List Managed Cluster Snapshots operation. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSnapshotListResultTypeConverter))] + public partial interface IManagedClusterSnapshotListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.TypeConverter.cs new file mode 100644 index 000000000000..e7585b86705a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSnapshotListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSnapshotListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSnapshotListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSnapshotListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.cs new file mode 100644 index 000000000000..db53de737008 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Managed Cluster Snapshots operation. + public partial class ManagedClusterSnapshotListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next set of managed cluster snapshot results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot[] _value; + + /// The list of managed cluster snapshots. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ManagedClusterSnapshotListResult() + { + + } + } + /// The response from the List Managed Cluster Snapshots operation. + public partial interface IManagedClusterSnapshotListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next set of managed cluster snapshot results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next set of managed cluster snapshot results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of managed cluster snapshots. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of managed cluster snapshots.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot[] Value { get; set; } + + } + /// The response from the List Managed Cluster Snapshots operation. + internal partial interface IManagedClusterSnapshotListResultInternal + + { + /// The URL to get the next set of managed cluster snapshot results. + string NextLink { get; set; } + /// The list of managed cluster snapshots. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.json.cs new file mode 100644 index 000000000000..204e045722bf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Managed Cluster Snapshots operation. + public partial class ManagedClusterSnapshotListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSnapshotListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSnapshotListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshot.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.PowerShell.cs new file mode 100644 index 000000000000..87a2ad11919a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.PowerShell.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Properties for a managed cluster snapshot. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSnapshotPropertiesTypeConverter))] + public partial class ManagedClusterSnapshotProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterSnapshotProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterSnapshotProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterSnapshotProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertiesReadOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertiesReadOnly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot) content.GetValueForProperty("ManagedClusterPropertiesReadOnly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertiesReadOnly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SnapshotType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType?) content.GetValueForProperty("SnapshotType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SnapshotType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType.CreateFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ManagedClusterPropertyReadOnlySku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlySku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku) content.GetValueForProperty("ManagedClusterPropertyReadOnlySku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlySku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertyReadOnlyNetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyNetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot) content.GetValueForProperty("ManagedClusterPropertyReadOnlyNetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyNetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertyReadOnlyKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyKubernetesVersion = (string) content.GetValueForProperty("ManagedClusterPropertyReadOnlyKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("ManagedClusterPropertyReadOnlyEnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyEnableRbac = (bool?) content.GetValueForProperty("ManagedClusterPropertyReadOnlyEnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyEnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkProfileNetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkProfileNetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkProfileNetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkProfileNetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkProfileLoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileLoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("NetworkProfileLoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileLoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterSnapshotProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertiesReadOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertiesReadOnly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot) content.GetValueForProperty("ManagedClusterPropertiesReadOnly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertiesReadOnly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SnapshotType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType?) content.GetValueForProperty("SnapshotType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SnapshotType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType.CreateFrom); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("ManagedClusterPropertyReadOnlySku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlySku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku) content.GetValueForProperty("ManagedClusterPropertyReadOnlySku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlySku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSkuTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertyReadOnlyNetworkProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyNetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot) content.GetValueForProperty("ManagedClusterPropertyReadOnlyNetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyNetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.NetworkProfileForSnapshotTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedClusterPropertyReadOnlyKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyKubernetesVersion = (string) content.GetValueForProperty("ManagedClusterPropertyReadOnlyKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("ManagedClusterPropertyReadOnlyEnableRbac")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyEnableRbac = (bool?) content.GetValueForProperty("ManagedClusterPropertyReadOnlyEnableRbac",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).ManagedClusterPropertyReadOnlyEnableRbac, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkProfileNetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkProfileNetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkProfileNetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkProfileNetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName?) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier.CreateFrom); + } + if (content.Contains("NetworkProfileNetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkProfileNetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileNetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkProfileLoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileLoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("NetworkProfileLoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal)this).NetworkProfileLoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties for a managed cluster snapshot. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterSnapshotPropertiesTypeConverter))] + public partial interface IManagedClusterSnapshotProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.TypeConverter.cs new file mode 100644 index 000000000000..d399044a62bd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterSnapshotPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterSnapshotProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterSnapshotProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterSnapshotProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.cs new file mode 100644 index 000000000000..bb47b59bd1c5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties for a managed cluster snapshot. + public partial class ManagedClusterSnapshotProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData _creationData; + + /// + /// CreationData to be used to specify the source resource ID to create this snapshot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get => (this._creationData = this._creationData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData()); set => this._creationData = value; } + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CreationDataSourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)CreationData).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)CreationData).SourceResourceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot _managedClusterPropertiesReadOnly; + + /// + /// What the properties will be showed when getting managed cluster snapshot. Those properties are read-only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot ManagedClusterPropertiesReadOnly { get => (this._managedClusterPropertiesReadOnly = this._managedClusterPropertiesReadOnly ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesForSnapshot()); } + + /// Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? ManagedClusterPropertyReadOnlyEnableRbac { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).EnableRbac; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).EnableRbac = value ?? default(bool); } + + /// The current kubernetes version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ManagedClusterPropertyReadOnlyKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).KubernetesVersion = value ?? null; } + + /// Internal Acessors for CreationData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal.CreationData { get => (this._creationData = this._creationData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData()); set { {_creationData = value;} } } + + /// Internal Acessors for ManagedClusterPropertiesReadOnly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal.ManagedClusterPropertiesReadOnly { get => (this._managedClusterPropertiesReadOnly = this._managedClusterPropertiesReadOnly ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesForSnapshot()); set { {_managedClusterPropertiesReadOnly = value;} } } + + /// Internal Acessors for ManagedClusterPropertyReadOnlyNetworkProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal.ManagedClusterPropertyReadOnlyNetworkProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfile = value; } + + /// Internal Acessors for ManagedClusterPropertyReadOnlySku + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotPropertiesInternal.ManagedClusterPropertyReadOnlySku { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).Sku = value; } + + /// loadBalancerSku for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? NetworkProfileLoadBalancerSku { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileLoadBalancerSku; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileLoadBalancerSku = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku)""); } + + /// networkMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkProfileNetworkMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileNetworkMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileNetworkMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode)""); } + + /// networkPlugin for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkProfileNetworkPlugin { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileNetworkPlugin; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileNetworkPlugin = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin)""); } + + /// NetworkPluginMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkProfileNetworkPluginMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileNetworkPluginMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileNetworkPluginMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode)""); } + + /// networkPolicy for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkProfileNetworkPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileNetworkPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).NetworkProfileNetworkPolicy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy)""); } + + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).SkuName = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName)""); } + + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).SkuTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshotInternal)ManagedClusterPropertiesReadOnly).SkuTier = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? _snapshotType; + + /// The type of a snapshot. The default is NodePool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get => this._snapshotType; set => this._snapshotType = value; } + + /// Creates an new instance. + public ManagedClusterSnapshotProperties() + { + + } + } + /// Properties for a managed cluster snapshot. + public partial interface IManagedClusterSnapshotProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string CreationDataSourceResourceId { get; set; } + /// Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the cluster has enabled Kubernetes Role-Based Access Control or not.", + SerializedName = @"enableRbac", + PossibleTypes = new [] { typeof(bool) })] + bool? ManagedClusterPropertyReadOnlyEnableRbac { get; set; } + /// The current kubernetes version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The current kubernetes version.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string ManagedClusterPropertyReadOnlyKubernetesVersion { get; set; } + /// loadBalancerSku for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"loadBalancerSku for managed cluster snapshot.", + SerializedName = @"loadBalancerSku", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? NetworkProfileLoadBalancerSku { get; set; } + /// networkMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkMode for managed cluster snapshot.", + SerializedName = @"networkMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkProfileNetworkMode { get; set; } + /// networkPlugin for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkPlugin for managed cluster snapshot.", + SerializedName = @"networkPlugin", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkProfileNetworkPlugin { get; set; } + /// NetworkPluginMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NetworkPluginMode for managed cluster snapshot.", + SerializedName = @"networkPluginMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkProfileNetworkPluginMode { get; set; } + /// networkPolicy for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkPolicy for managed cluster snapshot.", + SerializedName = @"networkPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkProfileNetworkPolicy { get; set; } + /// The name of a managed cluster SKU. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of a managed cluster SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get; set; } + /// The type of a snapshot. The default is NodePool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of a snapshot. The default is NodePool.", + SerializedName = @"snapshotType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get; set; } + + } + /// Properties for a managed cluster snapshot. + internal partial interface IManagedClusterSnapshotPropertiesInternal + + { + /// + /// CreationData to be used to specify the source resource ID to create this snapshot. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + string CreationDataSourceResourceId { get; set; } + /// + /// What the properties will be showed when getting managed cluster snapshot. Those properties are read-only. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesForSnapshot ManagedClusterPropertiesReadOnly { get; set; } + /// Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + bool? ManagedClusterPropertyReadOnlyEnableRbac { get; set; } + /// The current kubernetes version. + string ManagedClusterPropertyReadOnlyKubernetesVersion { get; set; } + /// The current network profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot ManagedClusterPropertyReadOnlyNetworkProfile { get; set; } + /// The current managed cluster sku. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSku ManagedClusterPropertyReadOnlySku { get; set; } + /// loadBalancerSku for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? NetworkProfileLoadBalancerSku { get; set; } + /// networkMode for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkProfileNetworkMode { get; set; } + /// networkPlugin for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkProfileNetworkPlugin { get; set; } + /// NetworkPluginMode for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkProfileNetworkPluginMode { get; set; } + /// networkPolicy for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkProfileNetworkPolicy { get; set; } + /// The name of a managed cluster SKU. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName? SkuName { get; set; } + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier? SkuTier { get; set; } + /// The type of a snapshot. The default is NodePool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.json.cs new file mode 100644 index 000000000000..ad1f5b0875d3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterSnapshotProperties.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties for a managed cluster snapshot. + public partial class ManagedClusterSnapshotProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterSnapshotProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterSnapshotProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_creationData = If( json?.PropertyT("creationData"), out var __jsonCreationData) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData.FromJson(__jsonCreationData) : CreationData;} + {_managedClusterPropertiesReadOnly = If( json?.PropertyT("managedClusterPropertiesReadOnly"), out var __jsonManagedClusterPropertiesReadOnly) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPropertiesForSnapshot.FromJson(__jsonManagedClusterPropertiesReadOnly) : ManagedClusterPropertiesReadOnly;} + {_snapshotType = If( json?.PropertyT("snapshotType"), out var __jsonSnapshotType) ? (string)__jsonSnapshotType : (string)SnapshotType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._creationData ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._creationData.ToJson(null,serializationMode) : null, "creationData" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._managedClusterPropertiesReadOnly ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._managedClusterPropertiesReadOnly.ToJson(null,serializationMode) : null, "managedClusterPropertiesReadOnly" ,container.Add ); + } + AddIf( null != (((object)this._snapshotType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._snapshotType.ToString()) : null, "snapshotType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.PowerShell.cs new file mode 100644 index 000000000000..1e7aadeba6e4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The Static Egress Gateway addon configuration for the cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStaticEgressGatewayProfileTypeConverter))] + public partial class ManagedClusterStaticEgressGatewayProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterStaticEgressGatewayProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterStaticEgressGatewayProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterStaticEgressGatewayProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfileInternal)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 ManagedClusterStaticEgressGatewayProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfileInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Static Egress Gateway addon configuration for the cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStaticEgressGatewayProfileTypeConverter))] + public partial interface IManagedClusterStaticEgressGatewayProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.TypeConverter.cs new file mode 100644 index 000000000000..1efd932e58c1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterStaticEgressGatewayProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterStaticEgressGatewayProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterStaticEgressGatewayProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterStaticEgressGatewayProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.cs new file mode 100644 index 000000000000..8c05ae5bfe16 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The Static Egress Gateway addon configuration for the cluster. + public partial class ManagedClusterStaticEgressGatewayProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfileInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Indicates if Static Egress Gateway addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterStaticEgressGatewayProfile() + { + + } + } + /// The Static Egress Gateway addon configuration for the cluster. + public partial interface IManagedClusterStaticEgressGatewayProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Indicates if Static Egress Gateway addon is enabled or not. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Static Egress Gateway addon is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// The Static Egress Gateway addon configuration for the cluster. + internal partial interface IManagedClusterStaticEgressGatewayProfileInternal + + { + /// Indicates if Static Egress Gateway addon is enabled or not. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.json.cs new file mode 100644 index 000000000000..3aa1e1733458 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStaticEgressGatewayProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The Static Egress Gateway addon configuration for the cluster. + public partial class ManagedClusterStaticEgressGatewayProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStaticEgressGatewayProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterStaticEgressGatewayProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterStaticEgressGatewayProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.PowerShell.cs new file mode 100644 index 000000000000..50ddeeb63226 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.PowerShell.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Storage profile for the container service cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileTypeConverter))] + public partial class ManagedClusterStorageProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterStorageProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterStorageProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterStorageProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DiskCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver) content.GetValueForProperty("DiskCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("FileCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).FileCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver) content.GetValueForProperty("FileCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).FileCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotController")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).SnapshotController = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController) content.GetValueForProperty("SnapshotController",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).SnapshotController, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotControllerTypeConverter.ConvertFrom); + } + if (content.Contains("BlobCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).BlobCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver) content.GetValueForProperty("BlobCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).BlobCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("DiskCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriverEnabled = (bool?) content.GetValueForProperty("DiskCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriverVersion = (string) content.GetValueForProperty("DiskCsiDriverVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriverVersion, global::System.Convert.ToString); + } + if (content.Contains("FileCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).FileCsiDriverEnabled = (bool?) content.GetValueForProperty("FileCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).FileCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SnapshotControllerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).SnapshotControllerEnabled = (bool?) content.GetValueForProperty("SnapshotControllerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).SnapshotControllerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).BlobCsiDriverEnabled = (bool?) content.GetValueForProperty("BlobCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).BlobCsiDriverEnabled, (__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 ManagedClusterStorageProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DiskCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver) content.GetValueForProperty("DiskCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("FileCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).FileCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver) content.GetValueForProperty("FileCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).FileCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotController")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).SnapshotController = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController) content.GetValueForProperty("SnapshotController",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).SnapshotController, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotControllerTypeConverter.ConvertFrom); + } + if (content.Contains("BlobCsiDriver")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).BlobCsiDriver = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver) content.GetValueForProperty("BlobCsiDriver",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).BlobCsiDriver, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriverTypeConverter.ConvertFrom); + } + if (content.Contains("DiskCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriverEnabled = (bool?) content.GetValueForProperty("DiskCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DiskCsiDriverVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriverVersion = (string) content.GetValueForProperty("DiskCsiDriverVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).DiskCsiDriverVersion, global::System.Convert.ToString); + } + if (content.Contains("FileCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).FileCsiDriverEnabled = (bool?) content.GetValueForProperty("FileCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).FileCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SnapshotControllerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).SnapshotControllerEnabled = (bool?) content.GetValueForProperty("SnapshotControllerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).SnapshotControllerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobCsiDriverEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).BlobCsiDriverEnabled = (bool?) content.GetValueForProperty("BlobCsiDriverEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal)this).BlobCsiDriverEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Storage profile for the container service cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileTypeConverter))] + public partial interface IManagedClusterStorageProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.TypeConverter.cs new file mode 100644 index 000000000000..aaebae905aa4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterStorageProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterStorageProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.cs new file mode 100644 index 000000000000..eb07f3764355 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Storage profile for the container service cluster. + public partial class ManagedClusterStorageProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver _blobCsiDriver; + + /// AzureBlob CSI Driver settings for the storage profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver BlobCsiDriver { get => (this._blobCsiDriver = this._blobCsiDriver ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriver()); set => this._blobCsiDriver = value; } + + /// Whether to enable AzureBlob CSI Driver. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? BlobCsiDriverEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriverInternal)BlobCsiDriver).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriverInternal)BlobCsiDriver).Enabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver _diskCsiDriver; + + /// AzureDisk CSI Driver settings for the storage profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver DiskCsiDriver { get => (this._diskCsiDriver = this._diskCsiDriver ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriver()); set => this._diskCsiDriver = value; } + + /// Whether to enable AzureDisk CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? DiskCsiDriverEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)DiskCsiDriver).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)DiskCsiDriver).Enabled = value ?? default(bool); } + + /// The version of AzureDisk CSI Driver. The default value is v1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DiskCsiDriverVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)DiskCsiDriver).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)DiskCsiDriver).Version = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver _fileCsiDriver; + + /// AzureFile CSI Driver settings for the storage profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver FileCsiDriver { get => (this._fileCsiDriver = this._fileCsiDriver ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriver()); set => this._fileCsiDriver = value; } + + /// Whether to enable AzureFile CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? FileCsiDriverEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriverInternal)FileCsiDriver).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriverInternal)FileCsiDriver).Enabled = value ?? default(bool); } + + /// Internal Acessors for BlobCsiDriver + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal.BlobCsiDriver { get => (this._blobCsiDriver = this._blobCsiDriver ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriver()); set { {_blobCsiDriver = value;} } } + + /// Internal Acessors for DiskCsiDriver + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal.DiskCsiDriver { get => (this._diskCsiDriver = this._diskCsiDriver ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriver()); set { {_diskCsiDriver = value;} } } + + /// Internal Acessors for FileCsiDriver + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal.FileCsiDriver { get => (this._fileCsiDriver = this._fileCsiDriver ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriver()); set { {_fileCsiDriver = value;} } } + + /// Internal Acessors for SnapshotController + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileInternal.SnapshotController { get => (this._snapshotController = this._snapshotController ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotController()); set { {_snapshotController = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController _snapshotController; + + /// Snapshot Controller settings for the storage profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController SnapshotController { get => (this._snapshotController = this._snapshotController ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotController()); set => this._snapshotController = value; } + + /// Whether to enable Snapshot Controller. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? SnapshotControllerEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotControllerInternal)SnapshotController).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotControllerInternal)SnapshotController).Enabled = value ?? default(bool); } + + /// Creates an new instance. + public ManagedClusterStorageProfile() + { + + } + } + /// Storage profile for the container service cluster. + public partial interface IManagedClusterStorageProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable AzureBlob CSI Driver. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureBlob CSI Driver. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? BlobCsiDriverEnabled { get; set; } + /// Whether to enable AzureDisk CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureDisk CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? DiskCsiDriverEnabled { get; set; } + /// The version of AzureDisk CSI Driver. The default value is v1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of AzureDisk CSI Driver. The default value is v1.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string DiskCsiDriverVersion { get; set; } + /// Whether to enable AzureFile CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureFile CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? FileCsiDriverEnabled { get; set; } + /// Whether to enable Snapshot Controller. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Snapshot Controller. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? SnapshotControllerEnabled { get; set; } + + } + /// Storage profile for the container service cluster. + internal partial interface IManagedClusterStorageProfileInternal + + { + /// AzureBlob CSI Driver settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver BlobCsiDriver { get; set; } + /// Whether to enable AzureBlob CSI Driver. The default value is false. + bool? BlobCsiDriverEnabled { get; set; } + /// AzureDisk CSI Driver settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver DiskCsiDriver { get; set; } + /// Whether to enable AzureDisk CSI Driver. The default value is true. + bool? DiskCsiDriverEnabled { get; set; } + /// The version of AzureDisk CSI Driver. The default value is v1. + string DiskCsiDriverVersion { get; set; } + /// AzureFile CSI Driver settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver FileCsiDriver { get; set; } + /// Whether to enable AzureFile CSI Driver. The default value is true. + bool? FileCsiDriverEnabled { get; set; } + /// Snapshot Controller settings for the storage profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController SnapshotController { get; set; } + /// Whether to enable Snapshot Controller. The default value is true. + bool? SnapshotControllerEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.json.cs new file mode 100644 index 000000000000..fd0291629008 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfile.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Storage profile for the container service cluster. + public partial class ManagedClusterStorageProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterStorageProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterStorageProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_diskCsiDriver = If( json?.PropertyT("diskCSIDriver"), out var __jsonDiskCsiDriver) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileDiskCsiDriver.FromJson(__jsonDiskCsiDriver) : DiskCsiDriver;} + {_fileCsiDriver = If( json?.PropertyT("fileCSIDriver"), out var __jsonFileCsiDriver) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileFileCsiDriver.FromJson(__jsonFileCsiDriver) : FileCsiDriver;} + {_snapshotController = If( json?.PropertyT("snapshotController"), out var __jsonSnapshotController) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileSnapshotController.FromJson(__jsonSnapshotController) : SnapshotController;} + {_blobCsiDriver = If( json?.PropertyT("blobCSIDriver"), out var __jsonBlobCsiDriver) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterStorageProfileBlobCsiDriver.FromJson(__jsonBlobCsiDriver) : BlobCsiDriver;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._diskCsiDriver ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._diskCsiDriver.ToJson(null,serializationMode) : null, "diskCSIDriver" ,container.Add ); + AddIf( null != this._fileCsiDriver ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._fileCsiDriver.ToJson(null,serializationMode) : null, "fileCSIDriver" ,container.Add ); + AddIf( null != this._snapshotController ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._snapshotController.ToJson(null,serializationMode) : null, "snapshotController" ,container.Add ); + AddIf( null != this._blobCsiDriver ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._blobCsiDriver.ToJson(null,serializationMode) : null, "blobCSIDriver" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.PowerShell.cs new file mode 100644 index 000000000000..40793d8e5126 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// AzureBlob CSI Driver settings for the storage profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileBlobCsiDriverTypeConverter))] + public partial class ManagedClusterStorageProfileBlobCsiDriver + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterStorageProfileBlobCsiDriver(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterStorageProfileBlobCsiDriver(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterStorageProfileBlobCsiDriver(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriverInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriverInternal)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 ManagedClusterStorageProfileBlobCsiDriver(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriverInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriverInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureBlob CSI Driver settings for the storage profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileBlobCsiDriverTypeConverter))] + public partial interface IManagedClusterStorageProfileBlobCsiDriver + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.TypeConverter.cs new file mode 100644 index 000000000000..32cbbfb0df9e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterStorageProfileBlobCsiDriverTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterStorageProfileBlobCsiDriver.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfileBlobCsiDriver.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfileBlobCsiDriver.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.cs new file mode 100644 index 000000000000..10cdfefd3cf6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// AzureBlob CSI Driver settings for the storage profile. + public partial class ManagedClusterStorageProfileBlobCsiDriver : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriverInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable AzureBlob CSI Driver. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterStorageProfileBlobCsiDriver() + { + + } + } + /// AzureBlob CSI Driver settings for the storage profile. + public partial interface IManagedClusterStorageProfileBlobCsiDriver : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable AzureBlob CSI Driver. The default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureBlob CSI Driver. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// AzureBlob CSI Driver settings for the storage profile. + internal partial interface IManagedClusterStorageProfileBlobCsiDriverInternal + + { + /// Whether to enable AzureBlob CSI Driver. The default value is false. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.json.cs new file mode 100644 index 000000000000..e2f52551591a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileBlobCsiDriver.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// AzureBlob CSI Driver settings for the storage profile. + public partial class ManagedClusterStorageProfileBlobCsiDriver + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileBlobCsiDriver FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterStorageProfileBlobCsiDriver(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterStorageProfileBlobCsiDriver(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.PowerShell.cs new file mode 100644 index 000000000000..77c0871e4fd8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.PowerShell.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// AzureDisk CSI Driver settings for the storage profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileDiskCsiDriverTypeConverter))] + public partial class ManagedClusterStorageProfileDiskCsiDriver + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterStorageProfileDiskCsiDriver(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterStorageProfileDiskCsiDriver(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterStorageProfileDiskCsiDriver(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)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 ManagedClusterStorageProfileDiskCsiDriver(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureDisk CSI Driver settings for the storage profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileDiskCsiDriverTypeConverter))] + public partial interface IManagedClusterStorageProfileDiskCsiDriver + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.TypeConverter.cs new file mode 100644 index 000000000000..6b971ab8ccde --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterStorageProfileDiskCsiDriverTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterStorageProfileDiskCsiDriver.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfileDiskCsiDriver.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfileDiskCsiDriver.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.cs new file mode 100644 index 000000000000..db3b21252c64 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// AzureDisk CSI Driver settings for the storage profile. + public partial class ManagedClusterStorageProfileDiskCsiDriver : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriverInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable AzureDisk CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _version; + + /// The version of AzureDisk CSI Driver. The default value is v1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterStorageProfileDiskCsiDriver() + { + + } + } + /// AzureDisk CSI Driver settings for the storage profile. + public partial interface IManagedClusterStorageProfileDiskCsiDriver : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable AzureDisk CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureDisk CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// The version of AzureDisk CSI Driver. The default value is v1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of AzureDisk CSI Driver. The default value is v1.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// AzureDisk CSI Driver settings for the storage profile. + internal partial interface IManagedClusterStorageProfileDiskCsiDriverInternal + + { + /// Whether to enable AzureDisk CSI Driver. The default value is true. + bool? Enabled { get; set; } + /// The version of AzureDisk CSI Driver. The default value is v1. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.json.cs new file mode 100644 index 000000000000..17de43042627 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileDiskCsiDriver.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// AzureDisk CSI Driver settings for the storage profile. + public partial class ManagedClusterStorageProfileDiskCsiDriver + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileDiskCsiDriver FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterStorageProfileDiskCsiDriver(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterStorageProfileDiskCsiDriver(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.PowerShell.cs new file mode 100644 index 000000000000..79420e8d090a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// AzureFile CSI Driver settings for the storage profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileFileCsiDriverTypeConverter))] + public partial class ManagedClusterStorageProfileFileCsiDriver + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterStorageProfileFileCsiDriver(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterStorageProfileFileCsiDriver(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterStorageProfileFileCsiDriver(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriverInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriverInternal)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 ManagedClusterStorageProfileFileCsiDriver(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriverInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriverInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// AzureFile CSI Driver settings for the storage profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileFileCsiDriverTypeConverter))] + public partial interface IManagedClusterStorageProfileFileCsiDriver + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.TypeConverter.cs new file mode 100644 index 000000000000..56ec324a9549 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterStorageProfileFileCsiDriverTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterStorageProfileFileCsiDriver.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfileFileCsiDriver.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfileFileCsiDriver.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.cs new file mode 100644 index 000000000000..31d6108deb8f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// AzureFile CSI Driver settings for the storage profile. + public partial class ManagedClusterStorageProfileFileCsiDriver : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriverInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable AzureFile CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterStorageProfileFileCsiDriver() + { + + } + } + /// AzureFile CSI Driver settings for the storage profile. + public partial interface IManagedClusterStorageProfileFileCsiDriver : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable AzureFile CSI Driver. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureFile CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// AzureFile CSI Driver settings for the storage profile. + internal partial interface IManagedClusterStorageProfileFileCsiDriverInternal + + { + /// Whether to enable AzureFile CSI Driver. The default value is true. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.json.cs new file mode 100644 index 000000000000..daecb47c18c8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileFileCsiDriver.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// AzureFile CSI Driver settings for the storage profile. + public partial class ManagedClusterStorageProfileFileCsiDriver + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileFileCsiDriver FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterStorageProfileFileCsiDriver(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterStorageProfileFileCsiDriver(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.PowerShell.cs new file mode 100644 index 000000000000..57748229bd36 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Snapshot Controller settings for the storage profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileSnapshotControllerTypeConverter))] + public partial class ManagedClusterStorageProfileSnapshotController + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterStorageProfileSnapshotController(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterStorageProfileSnapshotController(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterStorageProfileSnapshotController(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotControllerInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotControllerInternal)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 ManagedClusterStorageProfileSnapshotController(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotControllerInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotControllerInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Snapshot Controller settings for the storage profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterStorageProfileSnapshotControllerTypeConverter))] + public partial interface IManagedClusterStorageProfileSnapshotController + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.TypeConverter.cs new file mode 100644 index 000000000000..aee105164726 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterStorageProfileSnapshotControllerTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterStorageProfileSnapshotController.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfileSnapshotController.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterStorageProfileSnapshotController.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.cs new file mode 100644 index 000000000000..641f980fdefb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Snapshot Controller settings for the storage profile. + public partial class ManagedClusterStorageProfileSnapshotController : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotControllerInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Whether to enable Snapshot Controller. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterStorageProfileSnapshotController() + { + + } + } + /// Snapshot Controller settings for the storage profile. + public partial interface IManagedClusterStorageProfileSnapshotController : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable Snapshot Controller. The default value is true. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Snapshot Controller. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Snapshot Controller settings for the storage profile. + internal partial interface IManagedClusterStorageProfileSnapshotControllerInternal + + { + /// Whether to enable Snapshot Controller. The default value is true. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.json.cs new file mode 100644 index 000000000000..8b9ce640c241 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterStorageProfileSnapshotController.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Snapshot Controller settings for the storage profile. + public partial class ManagedClusterStorageProfileSnapshotController + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterStorageProfileSnapshotController FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterStorageProfileSnapshotController(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterStorageProfileSnapshotController(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.PowerShell.cs new file mode 100644 index 000000000000..6e9eb8c30abd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The list of available upgrades for compute pools. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterUpgradeProfileTypeConverter))] + public partial class ManagedClusterUpgradeProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterUpgradeProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterUpgradeProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterUpgradeProfile(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.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterUpgradeProfilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile) content.GetValueForProperty("ControlPlaneProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AgentPoolProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).AgentPoolProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[]) content.GetValueForProperty("AgentPoolProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).AgentPoolProfile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneProfileOSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileOSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("ControlPlaneProfileOSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileOSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("ControlPlaneProfileKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneProfileKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileName = (string) content.GetValueForProperty("ControlPlaneProfileName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileName, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfileUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileUpgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[]) content.GetValueForProperty("ControlPlaneProfileUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileUpgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileUpgradesItemTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterUpgradeProfile(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.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterUpgradeProfilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile) content.GetValueForProperty("ControlPlaneProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AgentPoolProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).AgentPoolProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[]) content.GetValueForProperty("AgentPoolProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).AgentPoolProfile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneProfileOSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileOSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("ControlPlaneProfileOSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileOSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("ControlPlaneProfileKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneProfileKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileName = (string) content.GetValueForProperty("ControlPlaneProfileName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileName, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfileUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileUpgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[]) content.GetValueForProperty("ControlPlaneProfileUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal)this).ControlPlaneProfileUpgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileUpgradesItemTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of available upgrades for compute pools. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterUpgradeProfileTypeConverter))] + public partial interface IManagedClusterUpgradeProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.TypeConverter.cs new file mode 100644 index 000000000000..b67b7d008ff8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterUpgradeProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterUpgradeProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterUpgradeProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterUpgradeProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.cs new file mode 100644 index 000000000000..b05c0c9c49a3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available upgrades for compute pools. + public partial class ManagedClusterUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal + { + + /// The list of available upgrade versions for agent pools. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[] AgentPoolProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).AgentPoolProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).AgentPoolProfile = value ; } + + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ControlPlaneProfileKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfileKubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfileKubernetesVersion = value ; } + + /// The Agent Pool name. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ControlPlaneProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfileName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfileName = value ?? null; } + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType ControlPlaneProfileOSType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfileOSType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfileOSType = value ; } + + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] ControlPlaneProfileUpgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfileUpgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfileUpgrade = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _id; + + /// The ID of the upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for ControlPlaneProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal.ControlPlaneProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)Property).ControlPlaneProfile = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterUpgradeProfileProperties()); set { {_property = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties _property; + + /// The properties of the upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterUpgradeProfileProperties()); set => this._property = value; } + + /// Backing field for property. + private string _type; + + /// The type of the upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ManagedClusterUpgradeProfile() + { + + } + } + /// The list of available upgrades for compute pools. + public partial interface IManagedClusterUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The list of available upgrade versions for agent pools. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of available upgrade versions for agent pools.", + SerializedName = @"agentPoolProfiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[] AgentPoolProfile { get; set; } + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Kubernetes version (major.minor.patch).", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneProfileKubernetesVersion { get; set; } + /// The Agent Pool name. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Agent Pool name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneProfileName { get; set; } + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType ControlPlaneProfileOSType { get; set; } + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of orchestrator types and versions available for upgrade.", + SerializedName = @"upgrades", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] ControlPlaneProfileUpgrade { get; set; } + /// The ID of the upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID of the upgrade profile.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The name of the upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the upgrade profile.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The type of the upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the upgrade profile.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The list of available upgrades for compute pools. + internal partial interface IManagedClusterUpgradeProfileInternal + + { + /// The list of available upgrade versions for agent pools. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[] AgentPoolProfile { get; set; } + /// The list of available upgrade versions for the control plane. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile ControlPlaneProfile { get; set; } + /// The Kubernetes version (major.minor.patch). + string ControlPlaneProfileKubernetesVersion { get; set; } + /// The Agent Pool name. + string ControlPlaneProfileName { get; set; } + /// The operating system type. The default is Linux. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType ControlPlaneProfileOSType { get; set; } + /// List of orchestrator types and versions available for upgrade. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] ControlPlaneProfileUpgrade { get; set; } + /// The ID of the upgrade profile. + string Id { get; set; } + /// The name of the upgrade profile. + string Name { get; set; } + /// The properties of the upgrade profile. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties Property { get; set; } + /// The type of the upgrade profile. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.json.cs new file mode 100644 index 000000000000..6e952ab739ac --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of available upgrades for compute pools. + public partial class ManagedClusterUpgradeProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterUpgradeProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterUpgradeProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterUpgradeProfileProperties.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.PowerShell.cs new file mode 100644 index 000000000000..ce1a2a0fa160 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.PowerShell.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Control plane and agent pool upgrade profiles. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterUpgradeProfilePropertiesTypeConverter))] + public partial class ManagedClusterUpgradeProfileProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterUpgradeProfileProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterUpgradeProfileProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterUpgradeProfileProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ControlPlaneProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile) content.GetValueForProperty("ControlPlaneProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AgentPoolProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).AgentPoolProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[]) content.GetValueForProperty("AgentPoolProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).AgentPoolProfile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneProfileOSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileOSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("ControlPlaneProfileOSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileOSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("ControlPlaneProfileKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneProfileKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileName = (string) content.GetValueForProperty("ControlPlaneProfileName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileName, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfileUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileUpgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[]) content.GetValueForProperty("ControlPlaneProfileUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileUpgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileUpgradesItemTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterUpgradeProfileProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ControlPlaneProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile) content.GetValueForProperty("ControlPlaneProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AgentPoolProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).AgentPoolProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[]) content.GetValueForProperty("AgentPoolProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).AgentPoolProfile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneProfileOSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileOSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) content.GetValueForProperty("ControlPlaneProfileOSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileOSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("ControlPlaneProfileKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneProfileKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfileName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileName = (string) content.GetValueForProperty("ControlPlaneProfileName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileName, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneProfileUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileUpgrade = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[]) content.GetValueForProperty("ControlPlaneProfileUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal)this).ControlPlaneProfileUpgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfileUpgradesItemTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Control plane and agent pool upgrade profiles. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterUpgradeProfilePropertiesTypeConverter))] + public partial interface IManagedClusterUpgradeProfileProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.TypeConverter.cs new file mode 100644 index 000000000000..aa99e2e45dbb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterUpgradeProfilePropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterUpgradeProfileProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterUpgradeProfileProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterUpgradeProfileProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.cs new file mode 100644 index 000000000000..2f78647e233b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Control plane and agent pool upgrade profiles. + public partial class ManagedClusterUpgradeProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[] _agentPoolProfile; + + /// The list of available upgrade versions for agent pools. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[] AgentPoolProfile { get => this._agentPoolProfile; set => this._agentPoolProfile = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile _controlPlaneProfile; + + /// The list of available upgrade versions for the control plane. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile ControlPlaneProfile { get => (this._controlPlaneProfile = this._controlPlaneProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfile()); set => this._controlPlaneProfile = value; } + + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ControlPlaneProfileKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)ControlPlaneProfile).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)ControlPlaneProfile).KubernetesVersion = value ; } + + /// The Agent Pool name. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ControlPlaneProfileName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)ControlPlaneProfile).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)ControlPlaneProfile).Name = value ?? null; } + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType ControlPlaneProfileOSType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)ControlPlaneProfile).OSType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)ControlPlaneProfile).OSType = value ; } + + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] ControlPlaneProfileUpgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)ControlPlaneProfile).Upgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileInternal)ControlPlaneProfile).Upgrade = value ?? null /* arrayOf */; } + + /// Internal Acessors for ControlPlaneProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfilePropertiesInternal.ControlPlaneProfile { get => (this._controlPlaneProfile = this._controlPlaneProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfile()); set { {_controlPlaneProfile = value;} } } + + /// Creates an new instance. + public ManagedClusterUpgradeProfileProperties() + { + + } + } + /// Control plane and agent pool upgrade profiles. + public partial interface IManagedClusterUpgradeProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The list of available upgrade versions for agent pools. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of available upgrade versions for agent pools.", + SerializedName = @"agentPoolProfiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[] AgentPoolProfile { get; set; } + /// The Kubernetes version (major.minor.patch). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Kubernetes version (major.minor.patch).", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneProfileKubernetesVersion { get; set; } + /// The Agent Pool name. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Agent Pool name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneProfileName { get; set; } + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType ControlPlaneProfileOSType { get; set; } + /// List of orchestrator types and versions available for upgrade. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of orchestrator types and versions available for upgrade.", + SerializedName = @"upgrades", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] ControlPlaneProfileUpgrade { get; set; } + + } + /// Control plane and agent pool upgrade profiles. + internal partial interface IManagedClusterUpgradeProfilePropertiesInternal + + { + /// The list of available upgrade versions for agent pools. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile[] AgentPoolProfile { get; set; } + /// The list of available upgrade versions for the control plane. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile ControlPlaneProfile { get; set; } + /// The Kubernetes version (major.minor.patch). + string ControlPlaneProfileKubernetesVersion { get; set; } + /// The Agent Pool name. + string ControlPlaneProfileName { get; set; } + /// The operating system type. The default is Linux. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType ControlPlaneProfileOSType { get; set; } + /// List of orchestrator types and versions available for upgrade. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfileUpgradesItem[] ControlPlaneProfileUpgrade { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.json.cs new file mode 100644 index 000000000000..f8613ad7dd73 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterUpgradeProfileProperties.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Control plane and agent pool upgrade profiles. + public partial class ManagedClusterUpgradeProfileProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfileProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterUpgradeProfileProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterUpgradeProfileProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_controlPlaneProfile = If( json?.PropertyT("controlPlaneProfile"), out var __jsonControlPlaneProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfile.FromJson(__jsonControlPlaneProfile) : ControlPlaneProfile;} + {_agentPoolProfile = If( json?.PropertyT("agentPoolProfiles"), out var __jsonAgentPoolProfiles) ? If( __jsonAgentPoolProfiles as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterPoolUpgradeProfile) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterPoolUpgradeProfile.FromJson(__u) )) ))() : null : AgentPoolProfile;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._controlPlaneProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._controlPlaneProfile.ToJson(null,serializationMode) : null, "controlPlaneProfile" ,container.Add ); + if (null != this._agentPoolProfile) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._agentPoolProfile ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("agentPoolProfiles",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.PowerShell.cs new file mode 100644 index 000000000000..c77890d59a21 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.PowerShell.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Profile for Windows VMs in the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterWindowsProfileTypeConverter))] + public partial class ManagedClusterWindowsProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterWindowsProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterWindowsProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterWindowsProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GmsaProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile) content.GetValueForProperty("GmsaProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).AdminPassword = (string) content.GetValueForProperty("AdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).AdminPassword, global::System.Convert.ToString); + } + if (content.Contains("LicenseType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).LicenseType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType?) content.GetValueForProperty("LicenseType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).LicenseType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType.CreateFrom); + } + if (content.Contains("EnableCsiProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).EnableCsiProxy = (bool?) content.GetValueForProperty("EnableCsiProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).EnableCsiProxy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GmsaProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileEnabled = (bool?) content.GetValueForProperty("GmsaProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GmsaProfileDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileDnsServer = (string) content.GetValueForProperty("GmsaProfileDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileDnsServer, global::System.Convert.ToString); + } + if (content.Contains("GmsaProfileRootDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileRootDomainName = (string) content.GetValueForProperty("GmsaProfileRootDomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileRootDomainName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterWindowsProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GmsaProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfile = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile) content.GetValueForProperty("GmsaProfile",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfile, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfileTypeConverter.ConvertFrom); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AdminPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).AdminPassword = (string) content.GetValueForProperty("AdminPassword",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).AdminPassword, global::System.Convert.ToString); + } + if (content.Contains("LicenseType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).LicenseType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType?) content.GetValueForProperty("LicenseType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).LicenseType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType.CreateFrom); + } + if (content.Contains("EnableCsiProxy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).EnableCsiProxy = (bool?) content.GetValueForProperty("EnableCsiProxy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).EnableCsiProxy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GmsaProfileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileEnabled = (bool?) content.GetValueForProperty("GmsaProfileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("GmsaProfileDnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileDnsServer = (string) content.GetValueForProperty("GmsaProfileDnsServer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileDnsServer, global::System.Convert.ToString); + } + if (content.Contains("GmsaProfileRootDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileRootDomainName = (string) content.GetValueForProperty("GmsaProfileRootDomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal)this).GmsaProfileRootDomainName, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Profile for Windows VMs in the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterWindowsProfileTypeConverter))] + public partial interface IManagedClusterWindowsProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.TypeConverter.cs new file mode 100644 index 000000000000..472b70955561 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterWindowsProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterWindowsProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterWindowsProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterWindowsProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.cs new file mode 100644 index 000000000000..08cecefe5718 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile for Windows VMs in the managed cluster. + public partial class ManagedClusterWindowsProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal + { + + /// Backing field for property. + private string _adminPassword; + + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string AdminPassword { get => this._adminPassword; set => this._adminPassword = value; } + + /// Backing field for property. + private string _adminUsername; + + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string AdminUsername { get => this._adminUsername; set => this._adminUsername = value; } + + /// Backing field for property. + private bool? _enableCsiProxy; + + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableCsiProxy { get => this._enableCsiProxy; set => this._enableCsiProxy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile _gmsaProfile; + + /// The Windows gMSA Profile in the Managed Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile GmsaProfile { get => (this._gmsaProfile = this._gmsaProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfile()); set => this._gmsaProfile = value; } + + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string GmsaProfileDnsServer { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)GmsaProfile).DnsServer; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)GmsaProfile).DnsServer = value ?? null; } + + /// Specifies whether to enable Windows gMSA in the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? GmsaProfileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)GmsaProfile).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)GmsaProfile).Enabled = value ?? default(bool); } + + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string GmsaProfileRootDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)GmsaProfile).RootDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)GmsaProfile).RootDomainName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? _licenseType; + + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? LicenseType { get => this._licenseType; set => this._licenseType = value; } + + /// Internal Acessors for GmsaProfile + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfileInternal.GmsaProfile { get => (this._gmsaProfile = this._gmsaProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfile()); set { {_gmsaProfile = value;} } } + + /// Creates an new instance. + public ManagedClusterWindowsProfile() + { + + } + } + /// Profile for Windows VMs in the managed cluster. + public partial interface IManagedClusterWindowsProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** ""abc@123"", ""P@$$w0rd"", ""P@ssw0rd"", ""P@ssword123"", ""Pa$$word"", ""pass@word1"", ""Password!"", ""Password1"", ""Password22"", ""iloveyou!""", + SerializedName = @"adminPassword", + PossibleTypes = new [] { typeof(string) })] + string AdminPassword { get; set; } + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the name of the administrator account.

**Restriction:** Cannot end in "".""

**Disallowed values:** ""administrator"", ""admin"", ""user"", ""user1"", ""test"", ""user2"", ""test1"", ""user3"", ""admin1"", ""1"", ""123"", ""a"", ""actuser"", ""adm"", ""admin2"", ""aspnet"", ""backup"", ""console"", ""david"", ""guest"", ""john"", ""owner"", ""root"", ""server"", ""sql"", ""support"", ""support_388945a0"", ""sys"", ""test2"", ""test3"", ""user4"", ""user5"".

**Minimum-length:** 1 character

**Max-length:** 20 characters", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdminUsername { get; set; } + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy).", + SerializedName = @"enableCSIProxy", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableCsiProxy { get; set; } + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"dnsServer", + PossibleTypes = new [] { typeof(string) })] + string GmsaProfileDnsServer { get; set; } + /// Specifies whether to enable Windows gMSA in the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether to enable Windows gMSA in the managed cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? GmsaProfileEnabled { get; set; } + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"rootDomainName", + PossibleTypes = new [] { typeof(string) })] + string GmsaProfileRootDomainName { get; set; } + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details.", + SerializedName = @"licenseType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? LicenseType { get; set; } + + } + /// Profile for Windows VMs in the managed cluster. + internal partial interface IManagedClusterWindowsProfileInternal + + { + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ string AdminPassword { get; set; } + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ string AdminUsername { get; set; } + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + bool? EnableCsiProxy { get; set; } + /// The Windows gMSA Profile in the Managed Cluster. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile GmsaProfile { get; set; } + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ string GmsaProfileDnsServer { get; set; } + /// Specifies whether to enable Windows gMSA in the managed cluster. + bool? GmsaProfileEnabled { get; set; } + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ string GmsaProfileRootDomainName { get; set; } + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType? LicenseType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.json.cs new file mode 100644 index 000000000000..ff11eec16372 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWindowsProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Profile for Windows VMs in the managed cluster. + public partial class ManagedClusterWindowsProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWindowsProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterWindowsProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterWindowsProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_gmsaProfile = If( json?.PropertyT("gmsaProfile"), out var __jsonGmsaProfile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WindowsGmsaProfile.FromJson(__jsonGmsaProfile) : GmsaProfile;} + {_adminUsername = If( json?.PropertyT("adminUsername"), out var __jsonAdminUsername) ? (string)__jsonAdminUsername : (string)AdminUsername;} + {_adminPassword = If( json?.PropertyT("adminPassword"), out var __jsonAdminPassword) ? (string)__jsonAdminPassword : (string)AdminPassword;} + {_licenseType = If( json?.PropertyT("licenseType"), out var __jsonLicenseType) ? (string)__jsonLicenseType : (string)LicenseType;} + {_enableCsiProxy = If( json?.PropertyT("enableCSIProxy"), out var __jsonEnableCsiProxy) ? (bool?)__jsonEnableCsiProxy : EnableCsiProxy;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._gmsaProfile ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._gmsaProfile.ToJson(null,serializationMode) : null, "gmsaProfile" ,container.Add ); + AddIf( null != (((object)this._adminUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._adminUsername.ToString()) : null, "adminUsername" ,container.Add ); + AddIf( null != (((object)this._adminPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._adminPassword.ToString()) : null, "adminPassword" ,container.Add ); + AddIf( null != (((object)this._licenseType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._licenseType.ToString()) : null, "licenseType" ,container.Add ); + AddIf( null != this._enableCsiProxy ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableCsiProxy) : null, "enableCSIProxy" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.PowerShell.cs new file mode 100644 index 000000000000..e1878aa0c968 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Workload Auto-scaler profile for the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterWorkloadAutoScalerProfileTypeConverter))] + public partial class ManagedClusterWorkloadAutoScalerProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterWorkloadAutoScalerProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterWorkloadAutoScalerProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterWorkloadAutoScalerProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Keda")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).Keda = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda) content.GetValueForProperty("Keda",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).Keda, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKedaTypeConverter.ConvertFrom); + } + if (content.Contains("VerticalPodAutoscaler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscaler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler) content.GetValueForProperty("VerticalPodAutoscaler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscaler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTypeConverter.ConvertFrom); + } + if (content.Contains("VerticalPodAutoscalerAddonAutoscaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscalerAddonAutoscaling = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling?) content.GetValueForProperty("VerticalPodAutoscalerAddonAutoscaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscalerAddonAutoscaling, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling.CreateFrom); + } + if (content.Contains("KedaEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).KedaEnabled = (bool) content.GetValueForProperty("KedaEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).KedaEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VerticalPodAutoscalerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscalerEnabled = (bool) content.GetValueForProperty("VerticalPodAutoscalerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscalerEnabled, (__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 ManagedClusterWorkloadAutoScalerProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Keda")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).Keda = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda) content.GetValueForProperty("Keda",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).Keda, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKedaTypeConverter.ConvertFrom); + } + if (content.Contains("VerticalPodAutoscaler")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscaler = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler) content.GetValueForProperty("VerticalPodAutoscaler",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscaler, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTypeConverter.ConvertFrom); + } + if (content.Contains("VerticalPodAutoscalerAddonAutoscaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscalerAddonAutoscaling = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling?) content.GetValueForProperty("VerticalPodAutoscalerAddonAutoscaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscalerAddonAutoscaling, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling.CreateFrom); + } + if (content.Contains("KedaEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).KedaEnabled = (bool) content.GetValueForProperty("KedaEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).KedaEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("VerticalPodAutoscalerEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscalerEnabled = (bool) content.GetValueForProperty("VerticalPodAutoscalerEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal)this).VerticalPodAutoscalerEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Workload Auto-scaler profile for the managed cluster. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterWorkloadAutoScalerProfileTypeConverter))] + public partial interface IManagedClusterWorkloadAutoScalerProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.TypeConverter.cs new file mode 100644 index 000000000000..b7e2521be630 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterWorkloadAutoScalerProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterWorkloadAutoScalerProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterWorkloadAutoScalerProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterWorkloadAutoScalerProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.cs new file mode 100644 index 000000000000..a7a1361f71b6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Workload Auto-scaler profile for the managed cluster. + public partial class ManagedClusterWorkloadAutoScalerProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda _keda; + + /// + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda Keda { get => (this._keda = this._keda ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKeda()); set => this._keda = value; } + + /// Whether to enable KEDA. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? KedaEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKedaInternal)Keda).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKedaInternal)Keda).Enabled = value ?? default(bool); } + + /// Internal Acessors for Keda + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal.Keda { get => (this._keda = this._keda ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKeda()); set { {_keda = value;} } } + + /// Internal Acessors for VerticalPodAutoscaler + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileInternal.VerticalPodAutoscaler { get => (this._verticalPodAutoscaler = this._verticalPodAutoscaler ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler()); set { {_verticalPodAutoscaler = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler _verticalPodAutoscaler; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler VerticalPodAutoscaler { get => (this._verticalPodAutoscaler = this._verticalPodAutoscaler ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler()); set => this._verticalPodAutoscaler = value; } + + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? VerticalPodAutoscalerAddonAutoscaling { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)VerticalPodAutoscaler).AddonAutoscaling; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)VerticalPodAutoscaler).AddonAutoscaling = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling)""); } + + /// Whether to enable VPA add-on in cluster. Default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? VerticalPodAutoscalerEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)VerticalPodAutoscaler).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)VerticalPodAutoscaler).Enabled = value ?? default(bool); } + + /// Creates an new instance. + public ManagedClusterWorkloadAutoScalerProfile() + { + + } + } + /// Workload Auto-scaler profile for the managed cluster. + public partial interface IManagedClusterWorkloadAutoScalerProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable KEDA. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable KEDA.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? KedaEnabled { get; set; } + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether VPA add-on is enabled and configured to scale AKS-managed add-ons.", + SerializedName = @"addonAutoscaling", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? VerticalPodAutoscalerAddonAutoscaling { get; set; } + /// Whether to enable VPA add-on in cluster. Default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable VPA add-on in cluster. Default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? VerticalPodAutoscalerEnabled { get; set; } + + } + /// Workload Auto-scaler profile for the managed cluster. + internal partial interface IManagedClusterWorkloadAutoScalerProfileInternal + + { + /// + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda Keda { get; set; } + /// Whether to enable KEDA. + bool? KedaEnabled { get; set; } + + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler VerticalPodAutoscaler { get; set; } + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? VerticalPodAutoscalerAddonAutoscaling { get; set; } + /// Whether to enable VPA add-on in cluster. Default value is false. + bool? VerticalPodAutoscalerEnabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.json.cs new file mode 100644 index 000000000000..e2033de4a919 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Workload Auto-scaler profile for the managed cluster. + public partial class ManagedClusterWorkloadAutoScalerProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterWorkloadAutoScalerProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterWorkloadAutoScalerProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keda = If( json?.PropertyT("keda"), out var __jsonKeda) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileKeda.FromJson(__jsonKeda) : Keda;} + {_verticalPodAutoscaler = If( json?.PropertyT("verticalPodAutoscaler"), out var __jsonVerticalPodAutoscaler) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.FromJson(__jsonVerticalPodAutoscaler) : VerticalPodAutoscaler;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._keda ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._keda.ToJson(null,serializationMode) : null, "keda" ,container.Add ); + AddIf( null != this._verticalPodAutoscaler ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._verticalPodAutoscaler.ToJson(null,serializationMode) : null, "verticalPodAutoscaler" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.PowerShell.cs new file mode 100644 index 000000000000..2a8614b7d023 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + /// + [System.ComponentModel.TypeConverter(typeof(ManagedClusterWorkloadAutoScalerProfileKedaTypeConverter))] + public partial class ManagedClusterWorkloadAutoScalerProfileKeda + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterWorkloadAutoScalerProfileKeda(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterWorkloadAutoScalerProfileKeda(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterWorkloadAutoScalerProfileKeda(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKedaInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKedaInternal)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 ManagedClusterWorkloadAutoScalerProfileKeda(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKedaInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKedaInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + [System.ComponentModel.TypeConverter(typeof(ManagedClusterWorkloadAutoScalerProfileKedaTypeConverter))] + public partial interface IManagedClusterWorkloadAutoScalerProfileKeda + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.TypeConverter.cs new file mode 100644 index 000000000000..e78c60f03e02 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterWorkloadAutoScalerProfileKedaTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterWorkloadAutoScalerProfileKeda.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterWorkloadAutoScalerProfileKeda.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterWorkloadAutoScalerProfileKeda.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.cs new file mode 100644 index 000000000000..ec07b1c98330 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + /// + public partial class ManagedClusterWorkloadAutoScalerProfileKeda : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKedaInternal + { + + /// Backing field for property. + private bool _enabled; + + /// Whether to enable KEDA. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterWorkloadAutoScalerProfileKeda() + { + + } + } + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + public partial interface IManagedClusterWorkloadAutoScalerProfileKeda : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether to enable KEDA. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether to enable KEDA.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + + } + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + internal partial interface IManagedClusterWorkloadAutoScalerProfileKedaInternal + + { + /// Whether to enable KEDA. + bool Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.json.cs new file mode 100644 index 000000000000..437d0c112dd2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileKeda.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + /// + public partial class ManagedClusterWorkloadAutoScalerProfileKeda + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileKeda FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterWorkloadAutoScalerProfileKeda(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterWorkloadAutoScalerProfileKeda(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.PowerShell.cs new file mode 100644 index 000000000000..d7dd42dabea8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTypeConverter))] + public partial class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AddonAutoscaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)this).AddonAutoscaling = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling?) content.GetValueForProperty("AddonAutoscaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)this).AddonAutoscaling, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AddonAutoscaling")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)this).AddonAutoscaling = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling?) content.GetValueForProperty("AddonAutoscaling",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal)this).AddonAutoscaling, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTypeConverter))] + public partial interface IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.TypeConverter.cs new file mode 100644 index 000000000000..71a403c55cbb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.cs new file mode 100644 index 000000000000..5e9120471ac0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? _addonAutoscaling; + + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? AddonAutoscaling { get => this._addonAutoscaling; set => this._addonAutoscaling = value; } + + /// Backing field for property. + private bool _enabled; + + /// Whether to enable VPA add-on in cluster. Default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// Creates an new instance. + /// + public ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler() + { + + } + } + public partial interface IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether VPA add-on is enabled and configured to scale AKS-managed add-ons.", + SerializedName = @"addonAutoscaling", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? AddonAutoscaling { get; set; } + /// Whether to enable VPA add-on in cluster. Default value is false. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether to enable VPA add-on in cluster. Default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + + } + internal partial interface IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscalerInternal + + { + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling? AddonAutoscaling { get; set; } + /// Whether to enable VPA add-on in cluster. Default value is false. + bool Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.json.cs new file mode 100644 index 000000000000..80bc93a3fc7c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_addonAutoscaling = If( json?.PropertyT("addonAutoscaling"), out var __jsonAddonAutoscaling) ? (string)__jsonAddonAutoscaling : (string)AddonAutoscaling;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + AddIf( null != (((object)this._addonAutoscaling)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._addonAutoscaling.ToString()) : null, "addonAutoscaling" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.PowerShell.cs new file mode 100644 index 000000000000..5d799347e432 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesValueTypeConverter))] + public partial class ManagedServiceIdentityUserAssignedIdentitiesValue + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentityUserAssignedIdentitiesValue(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentityUserAssignedIdentitiesValue(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentityUserAssignedIdentitiesValue(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.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal)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 ManagedServiceIdentityUserAssignedIdentitiesValue(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.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal)this).ClientId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityUserAssignedIdentitiesValueTypeConverter))] + public partial interface IManagedServiceIdentityUserAssignedIdentitiesValue + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.TypeConverter.cs new file mode 100644 index 000000000000..117b40697030 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityUserAssignedIdentitiesValueTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentityUserAssignedIdentitiesValue.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentitiesValue.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentityUserAssignedIdentitiesValue.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.cs new file mode 100644 index 000000000000..cbdf0d074039 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedServiceIdentityUserAssignedIdentitiesValue : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal + { + + /// Backing field for property. + private string _clientId; + + /// The client id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; } + + /// Internal Acessors for ClientId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal.ClientId { get => this._clientId; set { {_clientId = value;} } } + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValueInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// The principal id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; } + + /// + /// Creates an new instance. + /// + public ManagedServiceIdentityUserAssignedIdentitiesValue() + { + + } + } + public partial interface IManagedServiceIdentityUserAssignedIdentitiesValue : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The client id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The client id of user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; } + /// The principal id of user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal id of user assigned identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; } + + } + internal partial interface IManagedServiceIdentityUserAssignedIdentitiesValueInternal + + { + /// The client id of user assigned identity. + string ClientId { get; set; } + /// The principal id of user assigned identity. + string PrincipalId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.json.cs new file mode 100644 index 000000000000..185d1dc3afd2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManagedServiceIdentityUserAssignedIdentitiesValue.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedServiceIdentityUserAssignedIdentitiesValue + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedServiceIdentityUserAssignedIdentitiesValue FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedServiceIdentityUserAssignedIdentitiesValue(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedServiceIdentityUserAssignedIdentitiesValue(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.PowerShell.cs new file mode 100644 index 000000000000..4b546f7cb43c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Specifications on number of machines. + [System.ComponentModel.TypeConverter(typeof(ManualScaleProfileTypeConverter))] + public partial class ManualScaleProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManualScaleProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManualScaleProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManualScaleProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfileInternal)this).Size = (string[]) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfileInternal)this).Size, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfileInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfileInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManualScaleProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfileInternal)this).Size = (string[]) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfileInternal)this).Size, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfileInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfileInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Specifications on number of machines. + [System.ComponentModel.TypeConverter(typeof(ManualScaleProfileTypeConverter))] + public partial interface IManualScaleProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.TypeConverter.cs new file mode 100644 index 000000000000..4ac76a6db945 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManualScaleProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManualScaleProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManualScaleProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManualScaleProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManualScaleProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.cs new file mode 100644 index 000000000000..5f1cf64362ab --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifications on number of machines. + public partial class ManualScaleProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfileInternal + { + + /// Backing field for property. + private int? _count; + + /// Number of nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string[] _size; + + /// + /// The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first + /// available one when scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use + /// the next size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Size { get => this._size; set => this._size = value; } + + /// Creates an new instance. + public ManualScaleProfile() + { + + } + } + /// Specifications on number of machines. + public partial interface IManualScaleProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Number of nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of nodes.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? Count { get; set; } + /// + /// The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first + /// available one when scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use + /// the next size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first available one when scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use the next size.", + SerializedName = @"sizes", + PossibleTypes = new [] { typeof(string) })] + string[] Size { get; set; } + + } + /// Specifications on number of machines. + internal partial interface IManualScaleProfileInternal + + { + /// Number of nodes. + int? Count { get; set; } + /// + /// The list of allowed vm sizes e.g. ['Standard_E4s_v3', 'Standard_E16s_v3', 'Standard_D16s_v5']. AKS will use the first + /// available one when scaling. If a VM size is unavailable (e.g. due to quota or regional capacity reasons), AKS will use + /// the next size. + /// + string[] Size { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.json.cs new file mode 100644 index 000000000000..40249b7e0220 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ManualScaleProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifications on number of machines. + public partial class ManualScaleProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManualScaleProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManualScaleProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_size = If( json?.PropertyT("sizes"), out var __jsonSizes) ? If( __jsonSizes as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Size;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (int?)__jsonCount : Count;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._size) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._size ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("sizes",__w); + } + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._count) : null, "count" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.PowerShell.cs new file mode 100644 index 000000000000..e0bcca13fb6f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// Holds information on upgrades and compatibility for given major.minor mesh release. + /// + [System.ComponentModel.TypeConverter(typeof(MeshRevisionTypeConverter))] + public partial class MeshRevision + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MeshRevision(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MeshRevision(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MeshRevision(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Revision, global::System.Convert.ToString); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Upgrade = (string[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("CompatibleWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).CompatibleWith = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[]) content.GetValueForProperty("CompatibleWith",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).CompatibleWith, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CompatibleVersionsTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MeshRevision(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Revision, global::System.Convert.ToString); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Upgrade = (string[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("CompatibleWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).CompatibleWith = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[]) content.GetValueForProperty("CompatibleWith",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).CompatibleWith, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CompatibleVersionsTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Holds information on upgrades and compatibility for given major.minor mesh release. + [System.ComponentModel.TypeConverter(typeof(MeshRevisionTypeConverter))] + public partial interface IMeshRevision + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.TypeConverter.cs new file mode 100644 index 000000000000..f0b92501ceb4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MeshRevisionTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshRevision ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MeshRevision.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MeshRevision.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MeshRevision.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.cs new file mode 100644 index 000000000000..5137f67a41d3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Holds information on upgrades and compatibility for given major.minor mesh release. + /// + public partial class MeshRevision : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[] _compatibleWith; + + /// + /// List of items this revision of service mesh is compatible with, and their associated versions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[] CompatibleWith { get => this._compatibleWith; set => this._compatibleWith = value; } + + /// Backing field for property. + private string _revision; + + /// The revision of the mesh release. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Revision { get => this._revision; set => this._revision = value; } + + /// Backing field for property. + private string[] _upgrade; + + /// List of revisions available for upgrade of a specific mesh revision + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Upgrade { get => this._upgrade; set => this._upgrade = value; } + + /// Creates an new instance. + public MeshRevision() + { + + } + } + /// Holds information on upgrades and compatibility for given major.minor mesh release. + public partial interface IMeshRevision : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// List of items this revision of service mesh is compatible with, and their associated versions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of items this revision of service mesh is compatible with, and their associated versions.", + SerializedName = @"compatibleWith", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[] CompatibleWith { get; set; } + /// The revision of the mesh release. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The revision of the mesh release.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(string) })] + string Revision { get; set; } + /// List of revisions available for upgrade of a specific mesh revision + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of revisions available for upgrade of a specific mesh revision", + SerializedName = @"upgrades", + PossibleTypes = new [] { typeof(string) })] + string[] Upgrade { get; set; } + + } + /// Holds information on upgrades and compatibility for given major.minor mesh release. + internal partial interface IMeshRevisionInternal + + { + /// + /// List of items this revision of service mesh is compatible with, and their associated versions. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[] CompatibleWith { get; set; } + /// The revision of the mesh release. + string Revision { get; set; } + /// List of revisions available for upgrade of a specific mesh revision + string[] Upgrade { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.json.cs new file mode 100644 index 000000000000..902f29c02185 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevision.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Holds information on upgrades and compatibility for given major.minor mesh release. + /// + public partial class MeshRevision + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MeshRevision(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MeshRevision(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (string)__jsonRevision : (string)Revision;} + {_upgrade = If( json?.PropertyT("upgrades"), out var __jsonUpgrades) ? If( __jsonUpgrades as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Upgrade;} + {_compatibleWith = If( json?.PropertyT("compatibleWith"), out var __jsonCompatibleWith) ? If( __jsonCompatibleWith as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICompatibleVersions) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CompatibleVersions.FromJson(__p) )) ))() : null : CompatibleWith;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._revision)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._revision.ToString()) : null, "revision" ,container.Add ); + if (null != this._upgrade) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._upgrade ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("upgrades",__w); + } + if (null != this._compatibleWith) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._compatibleWith ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("compatibleWith",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.PowerShell.cs new file mode 100644 index 000000000000..f6c55010b1bf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.PowerShell.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Mesh revision profile for a mesh. + [System.ComponentModel.TypeConverter(typeof(MeshRevisionProfileTypeConverter))] + public partial class MeshRevisionProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MeshRevisionProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MeshRevisionProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MeshRevisionProfile(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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("MeshRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal)this).MeshRevision = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[]) content.GetValueForProperty("MeshRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal)this).MeshRevision, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MeshRevisionProfile(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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfilePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("MeshRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal)this).MeshRevision = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[]) content.GetValueForProperty("MeshRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal)this).MeshRevision, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Mesh revision profile for a mesh. + [System.ComponentModel.TypeConverter(typeof(MeshRevisionProfileTypeConverter))] + public partial interface IMeshRevisionProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.TypeConverter.cs new file mode 100644 index 000000000000..c03ec3a66fe0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MeshRevisionProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MeshRevisionProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MeshRevisionProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MeshRevisionProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.cs new file mode 100644 index 000000000000..bf35c881e1b5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Mesh revision profile for a mesh. + public partial class MeshRevisionProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[] MeshRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfilePropertiesInternal)Property).MeshRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfilePropertiesInternal)Property).MeshRevision = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfileProperties()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties _property; + + /// Mesh revision profile properties for a mesh + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfileProperties()); set => this._property = value; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public MeshRevisionProfile() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Mesh revision profile for a mesh. + public partial interface IMeshRevisionProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"meshRevisions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[] MeshRevision { get; set; } + + } + /// Mesh revision profile for a mesh. + internal partial interface IMeshRevisionProfileInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[] MeshRevision { get; set; } + /// Mesh revision profile properties for a mesh + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.json.cs new file mode 100644 index 000000000000..e0246fa1d86c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Mesh revision profile for a mesh. + public partial class MeshRevisionProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MeshRevisionProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MeshRevisionProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfileProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.PowerShell.cs new file mode 100644 index 000000000000..bb8b8ca0cb5a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Holds an array of MeshRevisionsProfiles + [System.ComponentModel.TypeConverter(typeof(MeshRevisionProfileListTypeConverter))] + public partial class MeshRevisionProfileList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MeshRevisionProfileList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MeshRevisionProfileList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MeshRevisionProfileList(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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal)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 MeshRevisionProfileList(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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Holds an array of MeshRevisionsProfiles + [System.ComponentModel.TypeConverter(typeof(MeshRevisionProfileListTypeConverter))] + public partial interface IMeshRevisionProfileList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.TypeConverter.cs new file mode 100644 index 000000000000..632c9eb65ea3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MeshRevisionProfileListTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MeshRevisionProfileList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MeshRevisionProfileList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MeshRevisionProfileList.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.cs new file mode 100644 index 000000000000..79d33505e526 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Holds an array of MeshRevisionsProfiles + public partial class MeshRevisionProfileList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next set of mesh revision profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile[] _value; + + /// Array of service mesh add-on revision profiles for all supported mesh modes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public MeshRevisionProfileList() + { + + } + } + /// Holds an array of MeshRevisionsProfiles + public partial interface IMeshRevisionProfileList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next set of mesh revision profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next set of mesh revision profile.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Array of service mesh add-on revision profiles for all supported mesh modes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of service mesh add-on revision profiles for all supported mesh modes.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile[] Value { get; set; } + + } + /// Holds an array of MeshRevisionsProfiles + internal partial interface IMeshRevisionProfileListInternal + + { + /// The URL to get the next set of mesh revision profile. + string NextLink { get; set; } + /// Array of service mesh add-on revision profiles for all supported mesh modes. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.json.cs new file mode 100644 index 000000000000..5ad79b371026 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileList.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Holds an array of MeshRevisionsProfiles + public partial class MeshRevisionProfileList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MeshRevisionProfileList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MeshRevisionProfileList(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionProfile.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.PowerShell.cs new file mode 100644 index 000000000000..7a9dc8c3a3b6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Mesh revision profile properties for a mesh + [System.ComponentModel.TypeConverter(typeof(MeshRevisionProfilePropertiesTypeConverter))] + public partial class MeshRevisionProfileProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MeshRevisionProfileProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MeshRevisionProfileProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MeshRevisionProfileProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeshRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfilePropertiesInternal)this).MeshRevision = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[]) content.GetValueForProperty("MeshRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfilePropertiesInternal)this).MeshRevision, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MeshRevisionProfileProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MeshRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfilePropertiesInternal)this).MeshRevision = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[]) content.GetValueForProperty("MeshRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfilePropertiesInternal)this).MeshRevision, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Mesh revision profile properties for a mesh + [System.ComponentModel.TypeConverter(typeof(MeshRevisionProfilePropertiesTypeConverter))] + public partial interface IMeshRevisionProfileProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.TypeConverter.cs new file mode 100644 index 000000000000..38f15057d120 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MeshRevisionProfilePropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MeshRevisionProfileProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MeshRevisionProfileProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MeshRevisionProfileProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.cs new file mode 100644 index 000000000000..86e05a41c7f1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Mesh revision profile properties for a mesh + public partial class MeshRevisionProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfilePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[] _meshRevision; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[] MeshRevision { get => this._meshRevision; set => this._meshRevision = value; } + + /// Creates an new instance. + public MeshRevisionProfileProperties() + { + + } + } + /// Mesh revision profile properties for a mesh + public partial interface IMeshRevisionProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"meshRevisions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[] MeshRevision { get; set; } + + } + /// Mesh revision profile properties for a mesh + internal partial interface IMeshRevisionProfilePropertiesInternal + + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision[] MeshRevision { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.json.cs new file mode 100644 index 000000000000..8b011939baac --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshRevisionProfileProperties.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Mesh revision profile properties for a mesh + public partial class MeshRevisionProfileProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MeshRevisionProfileProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MeshRevisionProfileProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_meshRevision = If( json?.PropertyT("meshRevisions"), out var __jsonMeshRevisions) ? If( __jsonMeshRevisions as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshRevision) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevision.FromJson(__u) )) ))() : null : MeshRevision;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._meshRevision) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._meshRevision ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("meshRevisions",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.PowerShell.cs new file mode 100644 index 000000000000..6bd806d1e189 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.PowerShell.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Upgrade profile for given mesh. + [System.ComponentModel.TypeConverter(typeof(MeshUpgradeProfileTypeConverter))] + public partial class MeshUpgradeProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MeshUpgradeProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MeshUpgradeProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MeshUpgradeProfile(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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Revision, global::System.Convert.ToString); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Upgrade = (string[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("CompatibleWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).CompatibleWith = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[]) content.GetValueForProperty("CompatibleWith",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).CompatibleWith, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CompatibleVersionsTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MeshUpgradeProfile(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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevisionTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Revision, global::System.Convert.ToString); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Upgrade = (string[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("CompatibleWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).CompatibleWith = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[]) content.GetValueForProperty("CompatibleWith",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal)this).CompatibleWith, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CompatibleVersionsTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Upgrade profile for given mesh. + [System.ComponentModel.TypeConverter(typeof(MeshUpgradeProfileTypeConverter))] + public partial interface IMeshUpgradeProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.TypeConverter.cs new file mode 100644 index 000000000000..9f39b42d5c6b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MeshUpgradeProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MeshUpgradeProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MeshUpgradeProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MeshUpgradeProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.cs new file mode 100644 index 000000000000..47c68807fdf3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Upgrade profile for given mesh. + public partial class MeshUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(); + + /// + /// List of items this revision of service mesh is compatible with, and their associated versions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[] CompatibleWith { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)Property).CompatibleWith; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)Property).CompatibleWith = value ?? null /* arrayOf */; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevision()); set { {_property = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision _property; + + /// + /// Holds information on upgrades and compatibility for given major.minor mesh release. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevision()); set => this._property = value; } + + /// The revision of the mesh release. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)Property).Revision = value ?? null; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; } + + /// List of revisions available for upgrade of a specific mesh revision + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] Upgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)Property).Upgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)Property).Upgrade = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public MeshUpgradeProfile() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Upgrade profile for given mesh. + public partial interface IMeshUpgradeProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource + { + /// + /// List of items this revision of service mesh is compatible with, and their associated versions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of items this revision of service mesh is compatible with, and their associated versions.", + SerializedName = @"compatibleWith", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[] CompatibleWith { get; set; } + /// The revision of the mesh release. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The revision of the mesh release.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(string) })] + string Revision { get; set; } + /// List of revisions available for upgrade of a specific mesh revision + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of revisions available for upgrade of a specific mesh revision", + SerializedName = @"upgrades", + PossibleTypes = new [] { typeof(string) })] + string[] Upgrade { get; set; } + + } + /// Upgrade profile for given mesh. + internal partial interface IMeshUpgradeProfileInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal + { + /// + /// List of items this revision of service mesh is compatible with, and their associated versions. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[] CompatibleWith { get; set; } + /// + /// Holds information on upgrades and compatibility for given major.minor mesh release. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision Property { get; set; } + /// The revision of the mesh release. + string Revision { get; set; } + /// List of revisions available for upgrade of a specific mesh revision + string[] Upgrade { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.json.cs new file mode 100644 index 000000000000..2f22d9efb64c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Upgrade profile for given mesh. + public partial class MeshUpgradeProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MeshUpgradeProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MeshUpgradeProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevision.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.PowerShell.cs new file mode 100644 index 000000000000..1c6b0f498b08 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Holds an array of MeshUpgradeProfiles + [System.ComponentModel.TypeConverter(typeof(MeshUpgradeProfileListTypeConverter))] + public partial class MeshUpgradeProfileList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MeshUpgradeProfileList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MeshUpgradeProfileList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MeshUpgradeProfileList(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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal)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 MeshUpgradeProfileList(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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Holds an array of MeshUpgradeProfiles + [System.ComponentModel.TypeConverter(typeof(MeshUpgradeProfileListTypeConverter))] + public partial interface IMeshUpgradeProfileList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.TypeConverter.cs new file mode 100644 index 000000000000..738e0a4e1985 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MeshUpgradeProfileListTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MeshUpgradeProfileList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MeshUpgradeProfileList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MeshUpgradeProfileList.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.cs new file mode 100644 index 000000000000..50cc3db7e4fc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Holds an array of MeshUpgradeProfiles + public partial class MeshUpgradeProfileList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next set of mesh upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile[] _value; + + /// Array of supported service mesh add-on upgrade profiles. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public MeshUpgradeProfileList() + { + + } + } + /// Holds an array of MeshUpgradeProfiles + public partial interface IMeshUpgradeProfileList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next set of mesh upgrade profile. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next set of mesh upgrade profile.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Array of supported service mesh add-on upgrade profiles. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of supported service mesh add-on upgrade profiles.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile[] Value { get; set; } + + } + /// Holds an array of MeshUpgradeProfiles + internal partial interface IMeshUpgradeProfileListInternal + + { + /// The URL to get the next set of mesh upgrade profile. + string NextLink { get; set; } + /// Array of supported service mesh add-on upgrade profiles. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.json.cs new file mode 100644 index 000000000000..4a0666b0c504 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileList.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Holds an array of MeshUpgradeProfiles + public partial class MeshUpgradeProfileList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MeshUpgradeProfileList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MeshUpgradeProfileList(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshUpgradeProfile.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.PowerShell.cs new file mode 100644 index 000000000000..0cb8f74268b1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Mesh upgrade profile properties for a major.minor release. + [System.ComponentModel.TypeConverter(typeof(MeshUpgradeProfilePropertiesTypeConverter))] + public partial class MeshUpgradeProfileProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MeshUpgradeProfileProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MeshUpgradeProfileProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MeshUpgradeProfileProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Revision, global::System.Convert.ToString); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Upgrade = (string[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("CompatibleWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).CompatibleWith = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[]) content.GetValueForProperty("CompatibleWith",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).CompatibleWith, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CompatibleVersionsTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MeshUpgradeProfileProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Revision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Revision, global::System.Convert.ToString); + } + if (content.Contains("Upgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Upgrade = (string[]) content.GetValueForProperty("Upgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).Upgrade, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("CompatibleWith")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).CompatibleWith = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[]) content.GetValueForProperty("CompatibleWith",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)this).CompatibleWith, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CompatibleVersionsTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Mesh upgrade profile properties for a major.minor release. + [System.ComponentModel.TypeConverter(typeof(MeshUpgradeProfilePropertiesTypeConverter))] + public partial interface IMeshUpgradeProfileProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.TypeConverter.cs new file mode 100644 index 000000000000..1b8ae6ed062c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MeshUpgradeProfilePropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MeshUpgradeProfileProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MeshUpgradeProfileProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MeshUpgradeProfileProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.cs new file mode 100644 index 000000000000..a49e5d48ff21 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Mesh upgrade profile properties for a major.minor release. + public partial class MeshUpgradeProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfilePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision __meshRevision = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevision(); + + /// + /// List of items this revision of service mesh is compatible with, and their associated versions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICompatibleVersions[] CompatibleWith { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)__meshRevision).CompatibleWith; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)__meshRevision).CompatibleWith = value ?? null /* arrayOf */; } + + /// The revision of the mesh release. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)__meshRevision).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)__meshRevision).Revision = value ?? null; } + + /// List of revisions available for upgrade of a specific mesh revision + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string[] Upgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)__meshRevision).Upgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal)__meshRevision).Upgrade = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public MeshUpgradeProfileProperties() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__meshRevision), __meshRevision); + await eventListener.AssertObjectIsValid(nameof(__meshRevision), __meshRevision); + } + } + /// Mesh upgrade profile properties for a major.minor release. + public partial interface IMeshUpgradeProfileProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevision + { + + } + /// Mesh upgrade profile properties for a major.minor release. + internal partial interface IMeshUpgradeProfilePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.json.cs new file mode 100644 index 000000000000..62df75ed0ac3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/MeshUpgradeProfileProperties.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Mesh upgrade profile properties for a major.minor release. + public partial class MeshUpgradeProfileProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new MeshUpgradeProfileProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal MeshUpgradeProfileProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __meshRevision = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MeshRevision(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __meshRevision?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.PowerShell.cs new file mode 100644 index 000000000000..630afcbe5a7a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// This addon can be used to configure network monitoring and generate network monitoring data in Prometheus format + /// + [System.ComponentModel.TypeConverter(typeof(NetworkMonitoringTypeConverter))] + public partial class NetworkMonitoring + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkMonitoring(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkMonitoring(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkMonitoring(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoringInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoringInternal)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 NetworkMonitoring(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoringInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoringInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This addon can be used to configure network monitoring and generate network monitoring data in Prometheus format + [System.ComponentModel.TypeConverter(typeof(NetworkMonitoringTypeConverter))] + public partial interface INetworkMonitoring + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.TypeConverter.cs new file mode 100644 index 000000000000..abfbfc9dbdee --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkMonitoringTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.INetworkMonitoring ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkMonitoring.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkMonitoring.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkMonitoring.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.cs new file mode 100644 index 000000000000..5dee51af85b0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// This addon can be used to configure network monitoring and generate network monitoring data in Prometheus format + /// + public partial class NetworkMonitoring : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoringInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Enable or disable the network monitoring plugin on the cluster + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Creates an new instance. + public NetworkMonitoring() + { + + } + } + /// This addon can be used to configure network monitoring and generate network monitoring data in Prometheus format + public partial interface INetworkMonitoring : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Enable or disable the network monitoring plugin on the cluster + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable or disable the network monitoring plugin on the cluster", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// This addon can be used to configure network monitoring and generate network monitoring data in Prometheus format + internal partial interface INetworkMonitoringInternal + + { + /// Enable or disable the network monitoring plugin on the cluster + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.json.cs new file mode 100644 index 000000000000..5f2439220e7b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkMonitoring.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// This addon can be used to configure network monitoring and generate network monitoring data in Prometheus format + /// + public partial class NetworkMonitoring + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkMonitoring FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new NetworkMonitoring(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkMonitoring(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.PowerShell.cs new file mode 100644 index 000000000000..7cfb0419cfcd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// network profile for managed cluster snapshot, these properties are read only. + [System.ComponentModel.TypeConverter(typeof(NetworkProfileForSnapshotTypeConverter))] + public partial class NetworkProfileForSnapshot + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkProfileForSnapshot(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkProfileForSnapshot(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkProfileForSnapshot(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("LoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).LoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("LoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).LoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NetworkProfileForSnapshot(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetworkPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin?) content.GetValueForProperty("NetworkPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin.CreateFrom); + } + if (content.Contains("NetworkPluginMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPluginMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode?) content.GetValueForProperty("NetworkPluginMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPluginMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode.CreateFrom); + } + if (content.Contains("NetworkPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPolicy = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy?) content.GetValueForProperty("NetworkPolicy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkPolicy, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy.CreateFrom); + } + if (content.Contains("NetworkMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkMode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode?) content.GetValueForProperty("NetworkMode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).NetworkMode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode.CreateFrom); + } + if (content.Contains("LoadBalancerSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).LoadBalancerSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku?) content.GetValueForProperty("LoadBalancerSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal)this).LoadBalancerSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// network profile for managed cluster snapshot, these properties are read only. + [System.ComponentModel.TypeConverter(typeof(NetworkProfileForSnapshotTypeConverter))] + public partial interface INetworkProfileForSnapshot + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.TypeConverter.cs new file mode 100644 index 000000000000..1d409cf90274 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkProfileForSnapshotTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkProfileForSnapshot.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkProfileForSnapshot.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkProfileForSnapshot.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.cs new file mode 100644 index 000000000000..bc9adebc5dee --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// network profile for managed cluster snapshot, these properties are read only. + public partial class NetworkProfileForSnapshot : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshotInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? _loadBalancerSku; + + /// loadBalancerSku for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? LoadBalancerSku { get => this._loadBalancerSku; set => this._loadBalancerSku = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? _networkMode; + + /// networkMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkMode { get => this._networkMode; set => this._networkMode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? _networkPlugin; + + /// networkPlugin for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkPlugin { get => this._networkPlugin; set => this._networkPlugin = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? _networkPluginMode; + + /// NetworkPluginMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkPluginMode { get => this._networkPluginMode; set => this._networkPluginMode = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? _networkPolicy; + + /// networkPolicy for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkPolicy { get => this._networkPolicy; set => this._networkPolicy = value; } + + /// Creates an new instance. + public NetworkProfileForSnapshot() + { + + } + } + /// network profile for managed cluster snapshot, these properties are read only. + public partial interface INetworkProfileForSnapshot : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// loadBalancerSku for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"loadBalancerSku for managed cluster snapshot.", + SerializedName = @"loadBalancerSku", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? LoadBalancerSku { get; set; } + /// networkMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkMode for managed cluster snapshot.", + SerializedName = @"networkMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkMode { get; set; } + /// networkPlugin for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkPlugin for managed cluster snapshot.", + SerializedName = @"networkPlugin", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkPlugin { get; set; } + /// NetworkPluginMode for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NetworkPluginMode for managed cluster snapshot.", + SerializedName = @"networkPluginMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkPluginMode { get; set; } + /// networkPolicy for managed cluster snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"networkPolicy for managed cluster snapshot.", + SerializedName = @"networkPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkPolicy { get; set; } + + } + /// network profile for managed cluster snapshot, these properties are read only. + internal partial interface INetworkProfileForSnapshotInternal + + { + /// loadBalancerSku for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku? LoadBalancerSku { get; set; } + /// networkMode for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode? NetworkMode { get; set; } + /// networkPlugin for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin? NetworkPlugin { get; set; } + /// NetworkPluginMode for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode? NetworkPluginMode { get; set; } + /// networkPolicy for managed cluster snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy? NetworkPolicy { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.json.cs new file mode 100644 index 000000000000..dcbfca2827e3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/NetworkProfileForSnapshot.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// network profile for managed cluster snapshot, these properties are read only. + public partial class NetworkProfileForSnapshot + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.INetworkProfileForSnapshot FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new NetworkProfileForSnapshot(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkProfileForSnapshot(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_networkPlugin = If( json?.PropertyT("networkPlugin"), out var __jsonNetworkPlugin) ? (string)__jsonNetworkPlugin : (string)NetworkPlugin;} + {_networkPluginMode = If( json?.PropertyT("networkPluginMode"), out var __jsonNetworkPluginMode) ? (string)__jsonNetworkPluginMode : (string)NetworkPluginMode;} + {_networkPolicy = If( json?.PropertyT("networkPolicy"), out var __jsonNetworkPolicy) ? (string)__jsonNetworkPolicy : (string)NetworkPolicy;} + {_networkMode = If( json?.PropertyT("networkMode"), out var __jsonNetworkMode) ? (string)__jsonNetworkMode : (string)NetworkMode;} + {_loadBalancerSku = If( json?.PropertyT("loadBalancerSku"), out var __jsonLoadBalancerSku) ? (string)__jsonLoadBalancerSku : (string)LoadBalancerSku;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._networkPlugin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._networkPlugin.ToString()) : null, "networkPlugin" ,container.Add ); + AddIf( null != (((object)this._networkPluginMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._networkPluginMode.ToString()) : null, "networkPluginMode" ,container.Add ); + AddIf( null != (((object)this._networkPolicy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._networkPolicy.ToString()) : null, "networkPolicy" ,container.Add ); + AddIf( null != (((object)this._networkMode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._networkMode.ToString()) : null, "networkMode" ,container.Add ); + AddIf( null != (((object)this._loadBalancerSku)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._loadBalancerSku.ToString()) : null, "loadBalancerSku" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.PowerShell.cs new file mode 100644 index 000000000000..9ee4b680822e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The OS option profile. + [System.ComponentModel.TypeConverter(typeof(OSOptionProfileTypeConverter))] + public partial class OSOptionProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OSOptionProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OSOptionProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OSOptionProfile(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.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionPropertyListTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("OSOptionPropertyList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).OSOptionPropertyList = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[]) content.GetValueForProperty("OSOptionPropertyList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).OSOptionPropertyList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionPropertyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OSOptionProfile(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.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionPropertyListTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("OSOptionPropertyList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).OSOptionPropertyList = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[]) content.GetValueForProperty("OSOptionPropertyList",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal)this).OSOptionPropertyList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionPropertyTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The OS option profile. + [System.ComponentModel.TypeConverter(typeof(OSOptionProfileTypeConverter))] + public partial interface IOSOptionProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.TypeConverter.cs new file mode 100644 index 000000000000..47fc18a81d96 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OSOptionProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOSOptionProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OSOptionProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OSOptionProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OSOptionProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.cs new file mode 100644 index 000000000000..66377a5b1756 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The OS option profile. + public partial class OSOptionProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal + { + + /// Backing field for property. + private string _id; + + /// The ID of the OS option resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionPropertyList()); set { {_property = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfileInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the OS option resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// The list of OS options. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[] OSOptionPropertyList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyListInternal)Property).OSOptionPropertyList1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyListInternal)Property).OSOptionPropertyList1 = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList _property; + + /// The list of OS options. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionPropertyList()); set => this._property = value; } + + /// Backing field for property. + private string _type; + + /// The type of the OS option resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public OSOptionProfile() + { + + } + } + /// The OS option profile. + public partial interface IOSOptionProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The ID of the OS option resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID of the OS option resource.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The name of the OS option resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the OS option resource.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The list of OS options. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of OS options.", + SerializedName = @"osOptionPropertyList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[] OSOptionPropertyList { get; set; } + /// The type of the OS option resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the OS option resource.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The OS option profile. + internal partial interface IOSOptionProfileInternal + + { + /// The ID of the OS option resource. + string Id { get; set; } + /// The name of the OS option resource. + string Name { get; set; } + /// The list of OS options. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[] OSOptionPropertyList { get; set; } + /// The list of OS options. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList Property { get; set; } + /// The type of the OS option resource. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.json.cs new file mode 100644 index 000000000000..cbc8cd757532 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The OS option profile. + public partial class OSOptionProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OSOptionProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OSOptionProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionPropertyList.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.PowerShell.cs new file mode 100644 index 000000000000..095298dd0e9f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// OS option property. + [System.ComponentModel.TypeConverter(typeof(OSOptionPropertyTypeConverter))] + public partial class OSOptionProperty + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OSOptionProperty(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OSOptionProperty(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OSOptionProperty(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyInternal)this).OSType, global::System.Convert.ToString); + } + if (content.Contains("EnableFipsImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyInternal)this).EnableFipsImage = (bool) content.GetValueForProperty("EnableFipsImage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyInternal)this).EnableFipsImage, (__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 OSOptionProperty(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyInternal)this).OSType, global::System.Convert.ToString); + } + if (content.Contains("EnableFipsImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyInternal)this).EnableFipsImage = (bool) content.GetValueForProperty("EnableFipsImage",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyInternal)this).EnableFipsImage, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// OS option property. + [System.ComponentModel.TypeConverter(typeof(OSOptionPropertyTypeConverter))] + public partial interface IOSOptionProperty + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.TypeConverter.cs new file mode 100644 index 000000000000..2e3a85dacf89 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OSOptionPropertyTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOSOptionProperty ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OSOptionProperty.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OSOptionProperty.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OSOptionProperty.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.cs new file mode 100644 index 000000000000..7e27ea9d064d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// OS option property. + public partial class OSOptionProperty : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyInternal + { + + /// Backing field for property. + private bool _enableFipsImage; + + /// Whether the image is FIPS-enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool EnableFipsImage { get => this._enableFipsImage; set => this._enableFipsImage = value; } + + /// Backing field for property. + private string _oSType; + + /// The OS type. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string OSType { get => this._oSType; set => this._oSType = value; } + + /// Creates an new instance. + public OSOptionProperty() + { + + } + } + /// OS option property. + public partial interface IOSOptionProperty : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Whether the image is FIPS-enabled. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Whether the image is FIPS-enabled.", + SerializedName = @"enable-fips-image", + PossibleTypes = new [] { typeof(bool) })] + bool EnableFipsImage { get; set; } + /// The OS type. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The OS type.", + SerializedName = @"os-type", + PossibleTypes = new [] { typeof(string) })] + string OSType { get; set; } + + } + /// OS option property. + internal partial interface IOSOptionPropertyInternal + + { + /// Whether the image is FIPS-enabled. + bool EnableFipsImage { get; set; } + /// The OS type. + string OSType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.json.cs new file mode 100644 index 000000000000..ff0130a1876f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionProperty.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// OS option property. + public partial class OSOptionProperty + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OSOptionProperty(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OSOptionProperty(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_oSType = If( json?.PropertyT("os-type"), out var __jsonOSType) ? (string)__jsonOSType : (string)OSType;} + {_enableFipsImage = If( json?.PropertyT("enable-fips-image"), out var __jsonEnableFipsImage) ? (bool)__jsonEnableFipsImage : EnableFipsImage;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._oSType.ToString()) : null, "os-type" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean(this._enableFipsImage), "enable-fips-image" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.PowerShell.cs new file mode 100644 index 000000000000..77e32c3f8747 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The list of OS option properties. + [System.ComponentModel.TypeConverter(typeof(OSOptionPropertyListTypeConverter))] + public partial class OSOptionPropertyList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OSOptionPropertyList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OSOptionPropertyList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OSOptionPropertyList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OSOptionPropertyList1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyListInternal)this).OSOptionPropertyList1 = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[]) content.GetValueForProperty("OSOptionPropertyList1",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyListInternal)this).OSOptionPropertyList1, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionPropertyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OSOptionPropertyList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OSOptionPropertyList1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyListInternal)this).OSOptionPropertyList1 = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[]) content.GetValueForProperty("OSOptionPropertyList1",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyListInternal)this).OSOptionPropertyList1, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionPropertyTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The list of OS option properties. + [System.ComponentModel.TypeConverter(typeof(OSOptionPropertyListTypeConverter))] + public partial interface IOSOptionPropertyList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.TypeConverter.cs new file mode 100644 index 000000000000..8ea3016931f0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OSOptionPropertyListTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OSOptionPropertyList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OSOptionPropertyList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OSOptionPropertyList.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.cs new file mode 100644 index 000000000000..930be6c20fc7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of OS option properties. + public partial class OSOptionPropertyList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyListInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[] _oSOptionPropertyList1; + + /// The list of OS options. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[] OSOptionPropertyList1 { get => this._oSOptionPropertyList1; set => this._oSOptionPropertyList1 = value; } + + /// Creates an new instance. + public OSOptionPropertyList() + { + + } + } + /// The list of OS option properties. + public partial interface IOSOptionPropertyList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The list of OS options. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of OS options.", + SerializedName = @"osOptionPropertyList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[] OSOptionPropertyList1 { get; set; } + + } + /// The list of OS option properties. + internal partial interface IOSOptionPropertyListInternal + + { + /// The list of OS options. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProperty[] OSOptionPropertyList1 { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.json.cs new file mode 100644 index 000000000000..75c2bbf1ab07 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OSOptionPropertyList.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The list of OS option properties. + public partial class OSOptionPropertyList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionPropertyList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OSOptionPropertyList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OSOptionPropertyList(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_oSOptionPropertyList1 = If( json?.PropertyT("osOptionPropertyList"), out var __jsonOSOptionPropertyList) ? If( __jsonOSOptionPropertyList as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOSOptionProperty) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OSOptionProperty.FromJson(__u) )) ))() : null : OSOptionPropertyList1;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._oSOptionPropertyList1) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._oSOptionPropertyList1 ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("osOptionPropertyList",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.PowerShell.cs new file mode 100644 index 000000000000..33b83214b1ed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The List Operation response. + [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); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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.ContainerService.Models.Api20240402Preview.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.ContainerService.Models.Api20240402Preview.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValueTypeConverter.ConvertFrom)); + } + 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.ContainerService.Models.Api20240402Preview.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValueTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The List Operation response. + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial interface IOperationListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.TypeConverter.cs new file mode 100644 index 000000000000..0f4299bff3a1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOperationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.cs new file mode 100644 index 000000000000..05d315e33164 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The List Operation response. + public partial class OperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationListResultInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue[] _value; + + /// The list of operations + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue[] Value { get => this._value; } + + /// Creates an new instance. + public OperationListResult() + { + + } + } + /// The List Operation response. + public partial interface IOperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The list of operations + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The list of operations", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue[] Value { get; } + + } + /// The List Operation response. + internal partial interface IOperationListResultInternal + + { + /// The list of operations + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.json.cs new file mode 100644 index 000000000000..5db6449524d4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationListResult.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The List Operation response. + 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.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IOperationValue) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValue.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.PowerShell.cs new file mode 100644 index 000000000000..2d1b47a77068 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The operations list. It contains an URL link to get the next set of results. + [System.ComponentModel.TypeConverter(typeof(OperationStatusResultListTypeConverter))] + public partial class OperationStatusResultList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusResultList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusResultList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusResultList(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.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResultTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal)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 OperationStatusResultList(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.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResultTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The operations list. It contains an URL link to get the next set of results. + [System.ComponentModel.TypeConverter(typeof(OperationStatusResultListTypeConverter))] + public partial interface IOperationStatusResultList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.TypeConverter.cs new file mode 100644 index 000000000000..086efe5c4275 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusResultListTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOperationStatusResultList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatusResultList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatusResultList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatusResultList.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.cs new file mode 100644 index 000000000000..1f9a3f913374 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The operations list. It contains an URL link to get the next set of results. + public partial class OperationStatusResultList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultList, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultListInternal.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[] _value; + + /// List of operations + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[] Value { get => this._value; } + + /// Creates an new instance. + public OperationStatusResultList() + { + + } + } + /// The operations list. It contains an URL link to get the next set of results. + public partial interface IOperationStatusResultList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// URL to get the next set of operation list results (if there are any). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of operations", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[] Value { get; } + + } + /// The operations list. It contains an URL link to get the next set of results. + internal partial interface IOperationStatusResultListInternal + + { + /// URL to get the next set of operation list results (if there are any). + string NextLink { get; set; } + /// List of operations + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.json.cs new file mode 100644 index 000000000000..b4f43f99ba40 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationStatusResultList.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The operations list. It contains an URL link to get the next set of results. + public partial class OperationStatusResultList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OperationStatusResultList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatusResultList(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api40.IOperationStatusResult) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResult.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.PowerShell.cs new file mode 100644 index 000000000000..f5b077246fb5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Describes the properties of a Operation value. + [System.ComponentModel.TypeConverter(typeof(OperationValueTypeConverter))] + public partial class OperationValue + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationValue(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationValue(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationValue(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.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValueDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayProvider, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationValue(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.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValueDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal)this).DisplayProvider, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes the properties of a Operation value. + [System.ComponentModel.TypeConverter(typeof(OperationValueTypeConverter))] + public partial interface IOperationValue + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.TypeConverter.cs new file mode 100644 index 000000000000..531461f1ce2f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationValueTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOperationValue ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationValue.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationValue.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationValue.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.cs new file mode 100644 index 000000000000..cb78db1a3b6f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Describes the properties of a Operation value. + public partial class OperationValue : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay _display; + + /// Describes the properties of a Operation Value Display. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValueDisplay()); set => this._display = value; } + + /// The description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Description; } + + /// The display name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Operation; } + + /// The resource provider for the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Provider; } + + /// The display name of the resource the operation applies to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Resource; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OperationValueDisplay()); set { {_display = value;} } } + + /// Internal Acessors for DisplayDescription + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Description = value; } + + /// Internal Acessors for DisplayOperation + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Operation = value; } + + /// Internal Acessors for DisplayProvider + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Provider = value; } + + /// Internal Acessors for DisplayResource + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)Display).Resource = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Origin + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueInternal.Origin { get => this._origin; set { {_origin = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _origin; + + /// The origin of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Origin { get => this._origin; } + + /// Creates an new instance. + public OperationValue() + { + + } + } + /// Describes the properties of a Operation value. + public partial interface IOperationValue : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the operation.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; } + /// The display name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The display name of the operation.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; } + /// The resource provider for the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resource provider for the operation.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; } + /// The display name of the resource the operation applies to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The display name of the resource the operation applies to.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; } + /// The name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The origin of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The origin of the operation.", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(string) })] + string Origin { get; } + + } + /// Describes the properties of a Operation value. + internal partial interface IOperationValueInternal + + { + /// Describes the properties of a Operation Value Display. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay Display { get; set; } + /// The description of the operation. + string DisplayDescription { get; set; } + /// The display name of the operation. + string DisplayOperation { get; set; } + /// The resource provider for the operation. + string DisplayProvider { get; set; } + /// The display name of the resource the operation applies to. + string DisplayResource { get; set; } + /// The name of the operation. + string Name { get; set; } + /// The origin of the operation. + string Origin { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.json.cs new file mode 100644 index 000000000000..43e1d6edbaae --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValue.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Describes the properties of a Operation value. + public partial class OperationValue + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OperationValue(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OperationValue(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.OperationValueDisplay.FromJson(__jsonDisplay) : Display;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + {_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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.PowerShell.cs new file mode 100644 index 000000000000..898913ceafdd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Describes the properties of a Operation Value Display. + [System.ComponentModel.TypeConverter(typeof(OperationValueDisplayTypeConverter))] + public partial class OperationValueDisplay + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationValueDisplay(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationValueDisplay(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationValueDisplay(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Provider, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationValueDisplay(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal)this).Provider, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes the properties of a Operation Value Display. + [System.ComponentModel.TypeConverter(typeof(OperationValueDisplayTypeConverter))] + public partial interface IOperationValueDisplay + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.TypeConverter.cs new file mode 100644 index 000000000000..4c28cfd46dda --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationValueDisplayTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOperationValueDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationValueDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationValueDisplay.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationValueDisplay.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.cs new file mode 100644 index 000000000000..50a348227b0e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Describes the properties of a Operation Value Display. + public partial class OperationValueDisplay : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// The description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Operation + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + + /// Internal Acessors for Provider + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + + /// Internal Acessors for Resource + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } + + /// Backing field for property. + private string _operation; + + /// The display name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Operation { get => this._operation; } + + /// Backing field for property. + private string _provider; + + /// The resource provider for the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Provider { get => this._provider; } + + /// Backing field for property. + private string _resource; + + /// The display name of the resource the operation applies to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Resource { get => this._resource; } + + /// Creates an new instance. + public OperationValueDisplay() + { + + } + } + /// Describes the properties of a Operation Value Display. + public partial interface IOperationValueDisplay : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The description of the operation.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// The display name of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The display name of the operation.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; } + /// The resource provider for the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resource provider for the operation.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; } + /// The display name of the resource the operation applies to. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The display name of the resource the operation applies to.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; } + + } + /// Describes the properties of a Operation Value Display. + internal partial interface IOperationValueDisplayInternal + + { + /// The description of the operation. + string Description { get; set; } + /// The display name of the operation. + string Operation { get; set; } + /// The resource provider for the operation. + string Provider { get; set; } + /// The display name of the resource the operation applies to. + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.json.cs new file mode 100644 index 000000000000..ab66d3b22f1a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OperationValueDisplay.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Describes the properties of a Operation Value Display. + public partial class OperationValueDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValueDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OperationValueDisplay(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OperationValueDisplay(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.PowerShell.cs new file mode 100644 index 000000000000..dcd2d649e7a4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Egress endpoints which AKS agent nodes connect to for common purpose. + [System.ComponentModel.TypeConverter(typeof(OutboundEnvironmentEndpointTypeConverter))] + public partial class OutboundEnvironmentEndpoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OutboundEnvironmentEndpoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OutboundEnvironmentEndpoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OutboundEnvironmentEndpoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDependencyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OutboundEnvironmentEndpoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDependencyTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Egress endpoints which AKS agent nodes connect to for common purpose. + [System.ComponentModel.TypeConverter(typeof(OutboundEnvironmentEndpointTypeConverter))] + public partial interface IOutboundEnvironmentEndpoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.TypeConverter.cs new file mode 100644 index 000000000000..72eceaf3afec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OutboundEnvironmentEndpointTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OutboundEnvironmentEndpoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OutboundEnvironmentEndpoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OutboundEnvironmentEndpoint.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.cs new file mode 100644 index 000000000000..05054c647e6f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Egress endpoints which AKS agent nodes connect to for common purpose. + public partial class OutboundEnvironmentEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointInternal + { + + /// Backing field for property. + private string _category; + + /// + /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Category { get => this._category; set => this._category = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency[] _endpoint; + + /// The endpoints that AKS agent nodes connect to + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency[] Endpoint { get => this._endpoint; set => this._endpoint = value; } + + /// Creates an new instance. + public OutboundEnvironmentEndpoint() + { + + } + } + /// Egress endpoints which AKS agent nodes connect to for common purpose. + public partial interface IOutboundEnvironmentEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc.", + SerializedName = @"category", + PossibleTypes = new [] { typeof(string) })] + string Category { get; set; } + /// The endpoints that AKS agent nodes connect to + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The endpoints that AKS agent nodes connect to", + SerializedName = @"endpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency[] Endpoint { get; set; } + + } + /// Egress endpoints which AKS agent nodes connect to for common purpose. + internal partial interface IOutboundEnvironmentEndpointInternal + + { + /// + /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. + /// + string Category { get; set; } + /// The endpoints that AKS agent nodes connect to + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IEndpointDependency[] Endpoint { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.json.cs new file mode 100644 index 000000000000..149b2652f736 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpoint.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Egress endpoints which AKS agent nodes connect to for common purpose. + public partial class OutboundEnvironmentEndpoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OutboundEnvironmentEndpoint(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OutboundEnvironmentEndpoint(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} + {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? If( __jsonEndpoints as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IEndpointDependency) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.EndpointDependency.FromJson(__u) )) ))() : null : Endpoint;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._category.ToString()) : null, "category" ,container.Add ); + if (null != this._endpoint) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._endpoint ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("endpoints",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.PowerShell.cs new file mode 100644 index 000000000000..f8a62fd26610 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.PowerShell.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Collection of OutboundEnvironmentEndpoint + [System.ComponentModel.TypeConverter(typeof(OutboundEnvironmentEndpointCollectionTypeConverter))] + public partial class OutboundEnvironmentEndpointCollection + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OutboundEnvironmentEndpointCollection(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OutboundEnvironmentEndpointCollection(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OutboundEnvironmentEndpointCollection(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.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OutboundEnvironmentEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal)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 OutboundEnvironmentEndpointCollection(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.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OutboundEnvironmentEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Collection of OutboundEnvironmentEndpoint + [System.ComponentModel.TypeConverter(typeof(OutboundEnvironmentEndpointCollectionTypeConverter))] + public partial interface IOutboundEnvironmentEndpointCollection + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.TypeConverter.cs new file mode 100644 index 000000000000..62b7bda87807 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OutboundEnvironmentEndpointCollectionTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OutboundEnvironmentEndpointCollection.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OutboundEnvironmentEndpointCollection.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OutboundEnvironmentEndpointCollection.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.cs new file mode 100644 index 000000000000..4a364201f7e4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Collection of OutboundEnvironmentEndpoint + public partial class OutboundEnvironmentEndpointCollection : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to next page of resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint[] _value; + + /// Collection of resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public OutboundEnvironmentEndpointCollection() + { + + } + } + /// Collection of OutboundEnvironmentEndpoint + public partial interface IOutboundEnvironmentEndpointCollection : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Link to next page of resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to next page of resources.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Collection of resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Collection of resources.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint[] Value { get; set; } + + } + /// Collection of OutboundEnvironmentEndpoint + internal partial interface IOutboundEnvironmentEndpointCollectionInternal + + { + /// Link to next page of resources. + string NextLink { get; set; } + /// Collection of resources. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.json.cs new file mode 100644 index 000000000000..a0f49ad1460b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/OutboundEnvironmentEndpointCollection.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Collection of OutboundEnvironmentEndpoint + public partial class OutboundEnvironmentEndpointCollection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OutboundEnvironmentEndpointCollection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OutboundEnvironmentEndpointCollection(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.OutboundEnvironmentEndpoint.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.PowerShell.cs new file mode 100644 index 000000000000..0b980ed5d68d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The port range. + [System.ComponentModel.TypeConverter(typeof(PortRangeTypeConverter))] + public partial class PortRange + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PortRange(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PortRange(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PortRange(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PortStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).PortStart = (int?) content.GetValueForProperty("PortStart",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).PortStart, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PortEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).PortEnd = (int?) content.GetValueForProperty("PortEnd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).PortEnd, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PortRange(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PortStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).PortStart = (int?) content.GetValueForProperty("PortStart",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).PortStart, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PortEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).PortEnd = (int?) content.GetValueForProperty("PortEnd",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).PortEnd, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The port range. + [System.ComponentModel.TypeConverter(typeof(PortRangeTypeConverter))] + public partial interface IPortRange + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.TypeConverter.cs new file mode 100644 index 000000000000..21c50c0b8a7f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PortRangeTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPortRange ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PortRange.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PortRange.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PortRange.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.cs new file mode 100644 index 000000000000..483765a93799 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The port range. + public partial class PortRange : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRangeInternal + { + + /// Backing field for property. + private int? _portEnd; + + /// + /// The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? PortEnd { get => this._portEnd; set => this._portEnd = value; } + + /// Backing field for property. + private int? _portStart; + + /// + /// The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? PortStart { get => this._portStart; set => this._portStart = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol? _protocol; + + /// The network protocol of the port. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol? Protocol { get => this._protocol; set => this._protocol = value; } + + /// Creates an new instance. + public PortRange() + { + + } + } + /// The port range. + public partial interface IPortRange : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart.", + SerializedName = @"portEnd", + PossibleTypes = new [] { typeof(int) })] + int? PortEnd { get; set; } + /// + /// The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd.", + SerializedName = @"portStart", + PossibleTypes = new [] { typeof(int) })] + int? PortStart { get; set; } + /// The network protocol of the port. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network protocol of the port.", + SerializedName = @"protocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol? Protocol { get; set; } + + } + /// The port range. + internal partial interface IPortRangeInternal + + { + /// + /// The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart. + /// + int? PortEnd { get; set; } + /// + /// The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd. + /// + int? PortStart { get; set; } + /// The network protocol of the port. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol? Protocol { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.json.cs new file mode 100644 index 000000000000..5f313196ebd1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PortRange.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The port range. + public partial class PortRange + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new PortRange(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal PortRange(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_portStart = If( json?.PropertyT("portStart"), out var __jsonPortStart) ? (int?)__jsonPortStart : PortStart;} + {_portEnd = If( json?.PropertyT("portEnd"), out var __jsonPortEnd) ? (int?)__jsonPortEnd : PortEnd;} + {_protocol = If( json?.PropertyT("protocol"), out var __jsonProtocol) ? (string)__jsonProtocol : (string)Protocol;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._portStart ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._portStart) : null, "portStart" ,container.Add ); + AddIf( null != this._portEnd ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._portEnd) : null, "portEnd" ,container.Add ); + AddIf( null != (((object)this._protocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._protocol.ToString()) : null, "protocol" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.PowerShell.cs new file mode 100644 index 000000000000..6c8c62213df0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Describes the Power State of the cluster + [System.ComponentModel.TypeConverter(typeof(PowerStateTypeConverter))] + public partial class PowerState + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PowerState(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PowerState(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PowerState(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.ContainerService.Models.Api20240402Preview.IPowerStateInternal)this).Code = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerStateInternal)this).Code, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PowerState(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.ContainerService.Models.Api20240402Preview.IPowerStateInternal)this).Code = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerStateInternal)this).Code, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Describes the Power State of the cluster + [System.ComponentModel.TypeConverter(typeof(PowerStateTypeConverter))] + public partial interface IPowerState + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.TypeConverter.cs new file mode 100644 index 000000000000..b940c8368ec0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PowerStateTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPowerState ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PowerState.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PowerState.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PowerState.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.cs new file mode 100644 index 000000000000..d733a3b88036 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Describes the Power State of the cluster + public partial class PowerState : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerStateInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? _code; + + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? Code { get => this._code; set => this._code = value; } + + /// Creates an new instance. + public PowerState() + { + + } + } + /// Describes the Power State of the cluster + public partial interface IPowerState : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Tells whether the cluster is Running or Stopped + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tells whether the cluster is Running or Stopped", + SerializedName = @"code", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? Code { get; set; } + + } + /// Describes the Power State of the cluster + internal partial interface IPowerStateInternal + + { + /// Tells whether the cluster is Running or Stopped + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code? Code { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.json.cs new file mode 100644 index 000000000000..81ec76daf7bd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PowerState.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Describes the Power State of the cluster + public partial class PowerState + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPowerState FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new PowerState(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal PowerState(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.PowerShell.cs new file mode 100644 index 000000000000..d0c9dae62650 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Private endpoint which a connection belongs to. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointTypeConverter))] + public partial class PrivateEndpoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpoint(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.ContainerService.Models.Api20240402Preview.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpoint(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.ContainerService.Models.Api20240402Preview.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Private endpoint which a connection belongs to. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointTypeConverter))] + public partial interface IPrivateEndpoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.TypeConverter.cs new file mode 100644 index 000000000000..1e7a2fe033a9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateEndpoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpoint.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.cs new file mode 100644 index 000000000000..9e38b6006d8b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Private endpoint which a connection belongs to. + public partial class PrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointInternal + { + + /// Backing field for property. + private string _id; + + /// The resource ID of the private endpoint + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Creates an new instance. + public PrivateEndpoint() + { + + } + } + /// Private endpoint which a connection belongs to. + public partial interface IPrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The resource ID of the private endpoint + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the private endpoint", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + } + /// Private endpoint which a connection belongs to. + internal partial interface IPrivateEndpointInternal + + { + /// The resource ID of the private endpoint + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.json.cs new file mode 100644 index 000000000000..77b6f5a84b32 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpoint.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Private endpoint which a connection belongs to. + public partial class PrivateEndpoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new PrivateEndpoint(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpoint(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.PowerShell.cs new file mode 100644 index 000000000000..cc31e5f2e4af --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A private endpoint connection + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] + public partial class PrivateEndpointConnection + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnection(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnection(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnection(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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnection(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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A private endpoint connection + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] + public partial interface IPrivateEndpointConnection + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.TypeConverter.cs new file mode 100644 index 000000000000..b28a0812e94c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointConnectionTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpointConnection.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpointConnection.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpointConnection.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..90e967a889eb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A private endpoint connection + public partial class PrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal + { + + /// Backing field for property. + private string _id; + + /// The ID of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// The resource ID of the private endpoint + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value ?? null; } + + /// The private link service connection description. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + + /// The private link service connection status. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties _property; + + /// The properties of a private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionProperties()); set => this._property = value; } + + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; } + + /// Backing field for property. + private string _type; + + /// The resource type. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public PrivateEndpointConnection() + { + + } + } + /// A private endpoint connection + public partial interface IPrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The ID of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ID of the private endpoint connection.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The name of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the private endpoint connection.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The resource ID of the private endpoint + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the private endpoint", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; set; } + /// The private link service connection description. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link service connection description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// The private link service connection status. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link service connection status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + /// The resource type. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The resource type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// A private endpoint connection + internal partial interface IPrivateEndpointConnectionInternal + + { + /// The ID of the private endpoint connection. + string Id { get; set; } + /// The name of the private endpoint connection. + string Name { get; set; } + /// The resource of private endpoint. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint PrivateEndpoint { get; set; } + /// The resource ID of the private endpoint + string PrivateEndpointId { get; set; } + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// The private link service connection description. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// The private link service connection status. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The properties of a private endpoint connection. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties Property { get; set; } + /// The current provisioning state. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + /// The resource type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.json.cs new file mode 100644 index 000000000000..675c931ea4a1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnection.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A private endpoint connection + public partial class PrivateEndpointConnection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new PrivateEndpointConnection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnection(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.PowerShell.cs new file mode 100644 index 000000000000..972e31a67d4e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A list of private endpoint connections + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] + public partial class PrivateEndpointConnectionListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnectionListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnectionListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnectionListResult(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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnectionListResult(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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnectionTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A list of private endpoint connections + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] + public partial interface IPrivateEndpointConnectionListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.TypeConverter.cs new file mode 100644 index 000000000000..c51d9405d03f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointConnectionListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpointConnectionListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..a6388c974062 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A list of private endpoint connections + public partial class PrivateEndpointConnectionListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection[] _value; + + /// The collection value. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PrivateEndpointConnectionListResult() + { + + } + } + /// A list of private endpoint connections + public partial interface IPrivateEndpointConnectionListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The collection value. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The collection value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection[] Value { get; set; } + + } + /// A list of private endpoint connections + internal partial interface IPrivateEndpointConnectionListResultInternal + + { + /// The collection value. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.json.cs new file mode 100644 index 000000000000..643f3003ea21 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A list of private endpoint connections + public partial class PrivateEndpointConnectionListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointConnection.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.PowerShell.cs new file mode 100644 index 000000000000..098f99974245 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Properties of a private endpoint connection. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionPropertiesTypeConverter))] + public partial class PrivateEndpointConnectionProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnectionProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnectionProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnectionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnectionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of a private endpoint connection. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionPropertiesTypeConverter))] + public partial interface IPrivateEndpointConnectionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.TypeConverter.cs new file mode 100644 index 000000000000..cb7012a9267a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointConnectionPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpointConnectionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..fae8acfa06f9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties of a private endpoint connection. + public partial class PrivateEndpointConnectionProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal + { + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpoint()); set { {_privateEndpoint = value;} } } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint _privateEndpoint; + + /// The resource of private endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpoint()); set => this._privateEndpoint = value; } + + /// The resource ID of the private endpoint + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointInternal)PrivateEndpoint).Id = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } + + /// The private link service connection description. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + + /// The private link service connection status. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState? _provisioningState; + + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Creates an new instance. + public PrivateEndpointConnectionProperties() + { + + } + } + /// Properties of a private endpoint connection. + public partial interface IPrivateEndpointConnectionProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The resource ID of the private endpoint + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the private endpoint", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; set; } + /// The private link service connection description. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link service connection description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// The private link service connection status. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link service connection status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The current provisioning state. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + + } + /// Properties of a private endpoint connection. + internal partial interface IPrivateEndpointConnectionPropertiesInternal + + { + /// The resource of private endpoint. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpoint PrivateEndpoint { get; set; } + /// The resource ID of the private endpoint + string PrivateEndpointId { get; set; } + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// The private link service connection description. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// The private link service connection status. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The current provisioning state. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.json.cs new file mode 100644 index 000000000000..c2e159b7893c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateEndpointConnectionProperties.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties of a private endpoint connection. + public partial class PrivateEndpointConnectionProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null,serializationMode) : null, "privateEndpoint" ,container.Add ); + AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.PowerShell.cs new file mode 100644 index 000000000000..02dd7d379d6d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A private link resource + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceTypeConverter))] + public partial class PrivateLinkResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkResource(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.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("PrivateLinkServiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).PrivateLinkServiceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateLinkResource(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.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("PrivateLinkServiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal)this).PrivateLinkServiceId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A private link resource + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceTypeConverter))] + public partial interface IPrivateLinkResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.TypeConverter.cs new file mode 100644 index 000000000000..0e70251761b6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkResourceTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkResource.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.cs new file mode 100644 index 000000000000..4fac77c348fe --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A private link resource + public partial class PrivateLinkResource : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal + { + + /// Backing field for property. + private string _groupId; + + /// The group ID of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string GroupId { get => this._groupId; set => this._groupId = value; } + + /// Backing field for property. + private string _id; + + /// The ID of the private link resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for PrivateLinkServiceId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourceInternal.PrivateLinkServiceId { get => this._privateLinkServiceId; set { {_privateLinkServiceId = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the private link resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _privateLinkServiceId; + + /// + /// The private link service ID of the resource, this field is exposed only to NRP internally. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string PrivateLinkServiceId { get => this._privateLinkServiceId; } + + /// Backing field for property. + private string[] _requiredMember; + + /// The RequiredMembers of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] RequiredMember { get => this._requiredMember; set => this._requiredMember = value; } + + /// Backing field for property. + private string _type; + + /// The resource type. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public PrivateLinkResource() + { + + } + } + /// A private link resource + public partial interface IPrivateLinkResource : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The group ID of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The group ID of the resource.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; set; } + /// The ID of the private link resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the private link resource.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The name of the private link resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the private link resource.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// The private link service ID of the resource, this field is exposed only to NRP internally. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The private link service ID of the resource, this field is exposed only to NRP internally.", + SerializedName = @"privateLinkServiceID", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceId { get; } + /// The RequiredMembers of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The RequiredMembers of the resource", + SerializedName = @"requiredMembers", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredMember { get; set; } + /// The resource type. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; set; } + + } + /// A private link resource + internal partial interface IPrivateLinkResourceInternal + + { + /// The group ID of the resource. + string GroupId { get; set; } + /// The ID of the private link resource. + string Id { get; set; } + /// The name of the private link resource. + string Name { get; set; } + /// + /// The private link service ID of the resource, this field is exposed only to NRP internally. + /// + string PrivateLinkServiceId { get; set; } + /// The RequiredMembers of the resource + string[] RequiredMember { get; set; } + /// The resource type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.json.cs new file mode 100644 index 000000000000..92ba9b48295c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResource.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A private link resource + public partial class PrivateLinkResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new PrivateLinkResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResource(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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;} + {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} + {_requiredMember = If( json?.PropertyT("requiredMembers"), out var __jsonRequiredMembers) ? If( __jsonRequiredMembers as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : RequiredMember;} + {_privateLinkServiceId = If( json?.PropertyT("privateLinkServiceID"), out var __jsonPrivateLinkServiceId) ? (string)__jsonPrivateLinkServiceId : (string)PrivateLinkServiceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId" ,container.Add ); + if (null != this._requiredMember) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._requiredMember ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("requiredMembers",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._privateLinkServiceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._privateLinkServiceId.ToString()) : null, "privateLinkServiceID" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.PowerShell.cs new file mode 100644 index 000000000000..a36aa3ef4f0b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A list of private link resources + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcesListResultTypeConverter))] + public partial class PrivateLinkResourcesListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkResourcesListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkResourcesListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkResourcesListResult(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.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResourceTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateLinkResourcesListResult(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.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResourceTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A list of private link resources + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcesListResultTypeConverter))] + public partial interface IPrivateLinkResourcesListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.TypeConverter.cs new file mode 100644 index 000000000000..add25dfaa4a9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkResourcesListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkResourcesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkResourcesListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkResourcesListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.cs new file mode 100644 index 000000000000..aef87b954354 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A list of private link resources + public partial class PrivateLinkResourcesListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] _value; + + /// The collection value. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PrivateLinkResourcesListResult() + { + + } + } + /// A list of private link resources + public partial interface IPrivateLinkResourcesListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The collection value. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The collection value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] Value { get; set; } + + } + /// A list of private link resources + internal partial interface IPrivateLinkResourcesListResultInternal + + { + /// The collection value. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.json.cs new file mode 100644 index 000000000000..dc5df4d48959 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkResourcesListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A list of private link resources + public partial class PrivateLinkResourcesListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new PrivateLinkResourcesListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResourcesListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.PowerShell.cs new file mode 100644 index 000000000000..e424ab6a5835 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The state of a private link service connection. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkServiceConnectionStateTypeConverter))] + public partial class PrivateLinkServiceConnectionState + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkServiceConnectionState(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkServiceConnectionState(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkServiceConnectionState(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)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 PrivateLinkServiceConnectionState(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The state of a private link service connection. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkServiceConnectionStateTypeConverter))] + public partial interface IPrivateLinkServiceConnectionState + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.TypeConverter.cs new file mode 100644 index 000000000000..5565fbe93409 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkServiceConnectionStateTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkServiceConnectionState.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkServiceConnectionState.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkServiceConnectionState.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..81da3ae365ee --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The state of a private link service connection. + public partial class PrivateLinkServiceConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionStateInternal + { + + /// Backing field for property. + private string _description; + + /// The private link service connection description. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? _status; + + /// The private link service connection status. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public PrivateLinkServiceConnectionState() + { + + } + } + /// The state of a private link service connection. + public partial interface IPrivateLinkServiceConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The private link service connection description. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link service connection description.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// The private link service connection status. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link service connection status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? Status { get; set; } + + } + /// The state of a private link service connection. + internal partial interface IPrivateLinkServiceConnectionStateInternal + + { + /// The private link service connection description. + string Description { get; set; } + /// The private link service connection status. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.json.cs new file mode 100644 index 000000000000..29cfc478f720 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/PrivateLinkServiceConnectionState.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The state of a private link service connection. + public partial class PrivateLinkServiceConnectionState + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new PrivateLinkServiceConnectionState(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkServiceConnectionState(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.PowerShell.cs new file mode 100644 index 000000000000..6375ab6922b2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + /// + [System.ComponentModel.TypeConverter(typeof(RebalanceLoadBalancersRequestBodyTypeConverter))] + public partial class RebalanceLoadBalancersRequestBody + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RebalanceLoadBalancersRequestBody(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RebalanceLoadBalancersRequestBody(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RebalanceLoadBalancersRequestBody(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LoadBalancerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBodyInternal)this).LoadBalancerName = (string[]) content.GetValueForProperty("LoadBalancerName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBodyInternal)this).LoadBalancerName, __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 RebalanceLoadBalancersRequestBody(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LoadBalancerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBodyInternal)this).LoadBalancerName = (string[]) content.GetValueForProperty("LoadBalancerName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBodyInternal)this).LoadBalancerName, __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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + [System.ComponentModel.TypeConverter(typeof(RebalanceLoadBalancersRequestBodyTypeConverter))] + public partial interface IRebalanceLoadBalancersRequestBody + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.TypeConverter.cs new file mode 100644 index 000000000000..a1df9bbb1f09 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RebalanceLoadBalancersRequestBodyTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RebalanceLoadBalancersRequestBody.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RebalanceLoadBalancersRequestBody.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RebalanceLoadBalancersRequestBody.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.cs new file mode 100644 index 000000000000..ae6009e68aac --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + /// + public partial class RebalanceLoadBalancersRequestBody : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBodyInternal + { + + /// Backing field for property. + private string[] _loadBalancerName; + + /// The load balancer names list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] LoadBalancerName { get => this._loadBalancerName; set => this._loadBalancerName = value; } + + /// Creates an new instance. + public RebalanceLoadBalancersRequestBody() + { + + } + } + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + public partial interface IRebalanceLoadBalancersRequestBody : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The load balancer names list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The load balancer names list.", + SerializedName = @"loadBalancerNames", + PossibleTypes = new [] { typeof(string) })] + string[] LoadBalancerName { get; set; } + + } + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + internal partial interface IRebalanceLoadBalancersRequestBodyInternal + + { + /// The load balancer names list. + string[] LoadBalancerName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.json.cs new file mode 100644 index 000000000000..13d8fcbc6915 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RebalanceLoadBalancersRequestBody.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + /// + public partial class RebalanceLoadBalancersRequestBody + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new RebalanceLoadBalancersRequestBody(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal RebalanceLoadBalancersRequestBody(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_loadBalancerName = If( json?.PropertyT("loadBalancerNames"), out var __jsonLoadBalancerNames) ? If( __jsonLoadBalancerNames as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : LoadBalancerName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._loadBalancerName) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._loadBalancerName ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("loadBalancerNames",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.PowerShell.cs new file mode 100644 index 000000000000..0253b56519a7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + /// + [System.ComponentModel.TypeConverter(typeof(RelativeMonthlyScheduleTypeConverter))] + public partial class RelativeMonthlySchedule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RelativeMonthlySchedule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RelativeMonthlySchedule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RelativeMonthlySchedule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).IntervalMonth = (int) content.GetValueForProperty("IntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).IntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).WeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("WeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).WeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("DayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).DayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("DayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).DayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RelativeMonthlySchedule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).IntervalMonth = (int) content.GetValueForProperty("IntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).IntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).WeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("WeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).WeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("DayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).DayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("DayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)this).DayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + [System.ComponentModel.TypeConverter(typeof(RelativeMonthlyScheduleTypeConverter))] + public partial interface IRelativeMonthlySchedule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.TypeConverter.cs new file mode 100644 index 000000000000..ae4fb97ee525 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RelativeMonthlyScheduleTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RelativeMonthlySchedule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RelativeMonthlySchedule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RelativeMonthlySchedule.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.cs new file mode 100644 index 000000000000..8da97461b73d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + /// + public partial class RelativeMonthlySchedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay _dayOfWeek; + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay DayOfWeek { get => this._dayOfWeek; set => this._dayOfWeek = value; } + + /// Backing field for property. + private int _intervalMonth; + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int IntervalMonth { get => this._intervalMonth; set => this._intervalMonth = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type _weekIndex; + + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type WeekIndex { get => this._weekIndex; set => this._weekIndex = value; } + + /// Creates an new instance. + public RelativeMonthlySchedule() + { + + } + } + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + public partial interface IRelativeMonthlySchedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay DayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int IntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.", + SerializedName = @"weekIndex", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type WeekIndex { get; set; } + + } + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + internal partial interface IRelativeMonthlyScheduleInternal + + { + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay DayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + int IntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type WeekIndex { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.json.cs new file mode 100644 index 000000000000..6730aea8ae83 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RelativeMonthlySchedule.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + /// + public partial class RelativeMonthlySchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new RelativeMonthlySchedule(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal RelativeMonthlySchedule(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_intervalMonth = If( json?.PropertyT("intervalMonths"), out var __jsonIntervalMonths) ? (int)__jsonIntervalMonths : IntervalMonth;} + {_weekIndex = If( json?.PropertyT("weekIndex"), out var __jsonWeekIndex) ? (string)__jsonWeekIndex : (string)WeekIndex;} + {_dayOfWeek = If( json?.PropertyT("dayOfWeek"), out var __jsonDayOfWeek) ? (string)__jsonDayOfWeek : (string)DayOfWeek;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber(this._intervalMonth), "intervalMonths" ,container.Add ); + AddIf( null != (((object)this._weekIndex)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._weekIndex.ToString()) : null, "weekIndex" ,container.Add ); + AddIf( null != (((object)this._dayOfWeek)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._dayOfWeek.ToString()) : null, "dayOfWeek" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.PowerShell.cs new file mode 100644 index 000000000000..20a1642fd17d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A reference to an Azure resource. + [System.ComponentModel.TypeConverter(typeof(ResourceReferenceTypeConverter))] + public partial class ResourceReference + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceReference(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceReference(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceReference(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.ContainerService.Models.Api20240402Preview.IResourceReferenceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReferenceInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceReference(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.ContainerService.Models.Api20240402Preview.IResourceReferenceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReferenceInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A reference to an Azure resource. + [System.ComponentModel.TypeConverter(typeof(ResourceReferenceTypeConverter))] + public partial interface IResourceReference + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.TypeConverter.cs new file mode 100644 index 000000000000..ac063b1c3d26 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceReferenceTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IResourceReference ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceReference.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceReference.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceReference.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.cs new file mode 100644 index 000000000000..179135367a66 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A reference to an Azure resource. + public partial class ResourceReference : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReferenceInternal + { + + /// Backing field for property. + private string _id; + + /// The fully qualified Azure resource id. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Creates an new instance. + public ResourceReference() + { + + } + } + /// A reference to an Azure resource. + public partial interface IResourceReference : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The fully qualified Azure resource id. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The fully qualified Azure resource id.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + } + /// A reference to an Azure resource. + internal partial interface IResourceReferenceInternal + + { + /// The fully qualified Azure resource id. + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.json.cs new file mode 100644 index 000000000000..fc185e2a8888 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ResourceReference.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A reference to an Azure resource. + public partial class ResourceReference + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IResourceReference FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ResourceReference(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceReference(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.PowerShell.cs new file mode 100644 index 000000000000..10c03acd90d2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A run command request + [System.ComponentModel.TypeConverter(typeof(RunCommandRequestTypeConverter))] + public partial class RunCommandRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RunCommandRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RunCommandRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RunCommandRequest(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.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).Command = (string) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).Command, global::System.Convert.ToString); + } + if (content.Contains("Context")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).Context = (string) content.GetValueForProperty("Context",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).Context, global::System.Convert.ToString); + } + if (content.Contains("ClusterToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).ClusterToken = (string) content.GetValueForProperty("ClusterToken",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).ClusterToken, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RunCommandRequest(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.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).Command = (string) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).Command, global::System.Convert.ToString); + } + if (content.Contains("Context")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).Context = (string) content.GetValueForProperty("Context",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).Context, global::System.Convert.ToString); + } + if (content.Contains("ClusterToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).ClusterToken = (string) content.GetValueForProperty("ClusterToken",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal)this).ClusterToken, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A run command request + [System.ComponentModel.TypeConverter(typeof(RunCommandRequestTypeConverter))] + public partial interface IRunCommandRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.TypeConverter.cs new file mode 100644 index 000000000000..1d13a47f43af --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RunCommandRequestTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IRunCommandRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RunCommandRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RunCommandRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RunCommandRequest.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.cs new file mode 100644 index 000000000000..defe50cd5117 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A run command request + public partial class RunCommandRequest : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequestInternal + { + + /// Backing field for property. + private string _clusterToken; + + /// AuthToken issued for AKS AAD Server App. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ClusterToken { get => this._clusterToken; set => this._clusterToken = value; } + + /// Backing field for property. + private string _command; + + /// The command to run. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Command { get => this._command; set => this._command = value; } + + /// Backing field for property. + private string _context; + + /// A base64 encoded zip file containing the files required by the command. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Context { get => this._context; set => this._context = value; } + + /// Creates an new instance. + public RunCommandRequest() + { + + } + } + /// A run command request + public partial interface IRunCommandRequest : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// AuthToken issued for AKS AAD Server App. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"AuthToken issued for AKS AAD Server App.", + SerializedName = @"clusterToken", + PossibleTypes = new [] { typeof(string) })] + string ClusterToken { get; set; } + /// The command to run. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The command to run.", + SerializedName = @"command", + PossibleTypes = new [] { typeof(string) })] + string Command { get; set; } + /// A base64 encoded zip file containing the files required by the command. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64 encoded zip file containing the files required by the command.", + SerializedName = @"context", + PossibleTypes = new [] { typeof(string) })] + string Context { get; set; } + + } + /// A run command request + internal partial interface IRunCommandRequestInternal + + { + /// AuthToken issued for AKS AAD Server App. + string ClusterToken { get; set; } + /// The command to run. + string Command { get; set; } + /// A base64 encoded zip file containing the files required by the command. + string Context { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.json.cs new file mode 100644 index 000000000000..6ba25923a16f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandRequest.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A run command request + public partial class RunCommandRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new RunCommandRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal RunCommandRequest(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_command = If( json?.PropertyT("command"), out var __jsonCommand) ? (string)__jsonCommand : (string)Command;} + {_context = If( json?.PropertyT("context"), out var __jsonContext) ? (string)__jsonContext : (string)Context;} + {_clusterToken = If( json?.PropertyT("clusterToken"), out var __jsonClusterToken) ? (string)__jsonClusterToken : (string)ClusterToken;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._command)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._command.ToString()) : null, "command" ,container.Add ); + AddIf( null != (((object)this._context)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._context.ToString()) : null, "context" ,container.Add ); + AddIf( null != (((object)this._clusterToken)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._clusterToken.ToString()) : null, "clusterToken" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.PowerShell.cs new file mode 100644 index 000000000000..ab108bfaff80 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.PowerShell.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// run command result. + [System.ComponentModel.TypeConverter(typeof(RunCommandResultTypeConverter))] + public partial class RunCommandResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RunCommandResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RunCommandResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RunCommandResult(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.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CommandResultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ExitCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).ExitCode = (int?) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).ExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StartedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FinishedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Log")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Log = (string) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Log, global::System.Convert.ToString); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Reason = (string) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Reason, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RunCommandResult(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.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CommandResultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ExitCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).ExitCode = (int?) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).ExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("StartedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FinishedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Log")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Log = (string) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Log, global::System.Convert.ToString); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Reason = (string) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal)this).Reason, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// run command result. + [System.ComponentModel.TypeConverter(typeof(RunCommandResultTypeConverter))] + public partial interface IRunCommandResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.TypeConverter.cs new file mode 100644 index 000000000000..f28cc5924a7e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RunCommandResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IRunCommandResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RunCommandResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RunCommandResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RunCommandResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.cs new file mode 100644 index 000000000000..8cb753c70abd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// run command result. + public partial class RunCommandResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal + { + + /// The exit code of the command + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? ExitCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).ExitCode; } + + /// The time when the command finished. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? FinishedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).FinishedAt; } + + /// Backing field for property. + private string _id; + + /// The command id. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// The command output. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Log { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).Log; } + + /// Internal Acessors for ExitCode + int? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal.ExitCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).ExitCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).ExitCode = value; } + + /// Internal Acessors for FinishedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal.FinishedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).FinishedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).FinishedAt = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Log + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal.Log { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).Log; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).Log = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CommandResultProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Reason + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal.Reason { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).Reason; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).Reason = value; } + + /// Internal Acessors for StartedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResultInternal.StartedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).StartedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).StartedAt = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties _property; + + /// Properties of command result. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CommandResultProperties()); set => this._property = value; } + + /// provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).ProvisioningState; } + + /// An explanation of why provisioningState is set to failed (if so). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Reason { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).Reason; } + + /// The time when the command started. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? StartedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultPropertiesInternal)Property).StartedAt; } + + /// Creates an new instance. + public RunCommandResult() + { + + } + } + /// run command result. + public partial interface IRunCommandResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The exit code of the command + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The exit code of the command", + SerializedName = @"exitCode", + PossibleTypes = new [] { typeof(int) })] + int? ExitCode { get; } + /// The time when the command finished. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the command finished.", + SerializedName = @"finishedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FinishedAt { get; } + /// The command id. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The command id.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The command output. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The command output.", + SerializedName = @"logs", + PossibleTypes = new [] { typeof(string) })] + string Log { get; } + /// provisioning State + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"provisioning State", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + string ProvisioningState { get; } + /// An explanation of why provisioningState is set to failed (if so). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"An explanation of why provisioningState is set to failed (if so).", + SerializedName = @"reason", + PossibleTypes = new [] { typeof(string) })] + string Reason { get; } + /// The time when the command started. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The time when the command started.", + SerializedName = @"startedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartedAt { get; } + + } + /// run command result. + internal partial interface IRunCommandResultInternal + + { + /// The exit code of the command + int? ExitCode { get; set; } + /// The time when the command finished. + global::System.DateTime? FinishedAt { get; set; } + /// The command id. + string Id { get; set; } + /// The command output. + string Log { get; set; } + /// Properties of command result. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICommandResultProperties Property { get; set; } + /// provisioning State + string ProvisioningState { get; set; } + /// An explanation of why provisioningState is set to failed (if so). + string Reason { get; set; } + /// The time when the command started. + global::System.DateTime? StartedAt { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.json.cs new file mode 100644 index 000000000000..ea35695f1efd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/RunCommandResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// run command result. + public partial class RunCommandResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new RunCommandResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal RunCommandResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CommandResultProperties.FromJson(__jsonProperties) : Property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.PowerShell.cs new file mode 100644 index 000000000000..e6d717c11a45 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Available Safeguards Version + [System.ComponentModel.TypeConverter(typeof(SafeguardsAvailableVersionTypeConverter))] + public partial class SafeguardsAvailableVersion + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SafeguardsAvailableVersion(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SafeguardsAvailableVersion(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SafeguardsAvailableVersion(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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("IsDefaultVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).IsDefaultVersion = (bool?) content.GetValueForProperty("IsDefaultVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).IsDefaultVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Support")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).Support = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport?) content.GetValueForProperty("Support",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).Support, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SafeguardsAvailableVersion(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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("IsDefaultVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).IsDefaultVersion = (bool?) content.GetValueForProperty("IsDefaultVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).IsDefaultVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Support")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).Support = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport?) content.GetValueForProperty("Support",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal)this).Support, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Available Safeguards Version + [System.ComponentModel.TypeConverter(typeof(SafeguardsAvailableVersionTypeConverter))] + public partial interface ISafeguardsAvailableVersion + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.TypeConverter.cs new file mode 100644 index 000000000000..4af02f81731e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SafeguardsAvailableVersionTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SafeguardsAvailableVersion.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SafeguardsAvailableVersion.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SafeguardsAvailableVersion.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.cs new file mode 100644 index 000000000000..82862aa315b9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Available Safeguards Version + public partial class SafeguardsAvailableVersion : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; } + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? IsDefaultVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)Property).IsDefaultVersion; } + + /// Internal Acessors for IsDefaultVersion + bool? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal.IsDefaultVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)Property).IsDefaultVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)Property).IsDefaultVersion = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsProperties()); set { {_property = value;} } } + + /// Internal Acessors for Support + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionInternal.Support { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)Property).Support; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)Property).Support = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties _property; + + /// Whether the version is default or not and support info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsProperties()); set => this._property = value; } + + /// Whether the version is preview or stable. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport? Support { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)Property).Support; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public SafeguardsAvailableVersion() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Available Safeguards Version + public partial interface ISafeguardsAvailableVersion : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"isDefaultVersion", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDefaultVersion { get; } + /// Whether the version is preview or stable. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether the version is preview or stable.", + SerializedName = @"support", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport? Support { get; } + + } + /// Available Safeguards Version + internal partial interface ISafeguardsAvailableVersionInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal + { + bool? IsDefaultVersion { get; set; } + /// Whether the version is default or not and support info. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties Property { get; set; } + /// Whether the version is preview or stable. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport? Support { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.json.cs new file mode 100644 index 000000000000..25accb5c17fb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersion.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Available Safeguards Version + public partial class SafeguardsAvailableVersion + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new SafeguardsAvailableVersion(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal SafeguardsAvailableVersion(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionsProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.PowerShell.cs new file mode 100644 index 000000000000..f56ac459c39d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Hold values properties, which is array of SafeguardsVersions + [System.ComponentModel.TypeConverter(typeof(SafeguardsAvailableVersionsListTypeConverter))] + public partial class SafeguardsAvailableVersionsList + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SafeguardsAvailableVersionsList(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SafeguardsAvailableVersionsList(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SafeguardsAvailableVersionsList(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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal)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 SafeguardsAvailableVersionsList(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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Hold values properties, which is array of SafeguardsVersions + [System.ComponentModel.TypeConverter(typeof(SafeguardsAvailableVersionsListTypeConverter))] + public partial interface ISafeguardsAvailableVersionsList + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.TypeConverter.cs new file mode 100644 index 000000000000..c0fa37c4a959 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SafeguardsAvailableVersionsListTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SafeguardsAvailableVersionsList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SafeguardsAvailableVersionsList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SafeguardsAvailableVersionsList.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.cs new file mode 100644 index 000000000000..a88c9b6640c8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Hold values properties, which is array of SafeguardsVersions + public partial class SafeguardsAvailableVersionsList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next Safeguards available version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion[] _value; + + /// Array of AKS supported Safeguards versions. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public SafeguardsAvailableVersionsList() + { + + } + } + /// Hold values properties, which is array of SafeguardsVersions + public partial interface ISafeguardsAvailableVersionsList : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next Safeguards available version. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next Safeguards available version.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Array of AKS supported Safeguards versions. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of AKS supported Safeguards versions.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion[] Value { get; set; } + + } + /// Hold values properties, which is array of SafeguardsVersions + internal partial interface ISafeguardsAvailableVersionsListInternal + + { + /// The URL to get the next Safeguards available version. + string NextLink { get; set; } + /// Array of AKS supported Safeguards versions. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.json.cs new file mode 100644 index 000000000000..dcd73ab684b4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsList.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Hold values properties, which is array of SafeguardsVersions + public partial class SafeguardsAvailableVersionsList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new SafeguardsAvailableVersionsList(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal SafeguardsAvailableVersionsList(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SafeguardsAvailableVersion.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.PowerShell.cs new file mode 100644 index 000000000000..ad2dc2bc32ae --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.PowerShell.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Whether the version is default or not and support info. + [System.ComponentModel.TypeConverter(typeof(SafeguardsAvailableVersionsPropertiesTypeConverter))] + public partial class SafeguardsAvailableVersionsProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SafeguardsAvailableVersionsProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SafeguardsAvailableVersionsProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SafeguardsAvailableVersionsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsDefaultVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)this).IsDefaultVersion = (bool?) content.GetValueForProperty("IsDefaultVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)this).IsDefaultVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Support")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)this).Support = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport?) content.GetValueForProperty("Support",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)this).Support, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SafeguardsAvailableVersionsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IsDefaultVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)this).IsDefaultVersion = (bool?) content.GetValueForProperty("IsDefaultVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)this).IsDefaultVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Support")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)this).Support = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport?) content.GetValueForProperty("Support",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal)this).Support, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Whether the version is default or not and support info. + [System.ComponentModel.TypeConverter(typeof(SafeguardsAvailableVersionsPropertiesTypeConverter))] + public partial interface ISafeguardsAvailableVersionsProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.TypeConverter.cs new file mode 100644 index 000000000000..b9d34a79cdc3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SafeguardsAvailableVersionsPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SafeguardsAvailableVersionsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SafeguardsAvailableVersionsProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SafeguardsAvailableVersionsProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.cs new file mode 100644 index 000000000000..5db13e3ee9ef --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Whether the version is default or not and support info. + public partial class SafeguardsAvailableVersionsProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal + { + + /// Backing field for property. + private bool? _isDefaultVersion; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? IsDefaultVersion { get => this._isDefaultVersion; } + + /// Internal Acessors for IsDefaultVersion + bool? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal.IsDefaultVersion { get => this._isDefaultVersion; set { {_isDefaultVersion = value;} } } + + /// Internal Acessors for Support + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsPropertiesInternal.Support { get => this._support; set { {_support = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport? _support; + + /// Whether the version is preview or stable. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport? Support { get => this._support; } + + /// Creates an new instance. + public SafeguardsAvailableVersionsProperties() + { + + } + } + /// Whether the version is default or not and support info. + public partial interface ISafeguardsAvailableVersionsProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"", + SerializedName = @"isDefaultVersion", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDefaultVersion { get; } + /// Whether the version is preview or stable. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether the version is preview or stable.", + SerializedName = @"support", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport? Support { get; } + + } + /// Whether the version is default or not and support info. + internal partial interface ISafeguardsAvailableVersionsPropertiesInternal + + { + bool? IsDefaultVersion { get; set; } + /// Whether the version is preview or stable. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport? Support { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.json.cs new file mode 100644 index 000000000000..0c695cdbae29 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsAvailableVersionsProperties.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Whether the version is default or not and support info. + public partial class SafeguardsAvailableVersionsProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new SafeguardsAvailableVersionsProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal SafeguardsAvailableVersionsProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_isDefaultVersion = If( json?.PropertyT("isDefaultVersion"), out var __jsonIsDefaultVersion) ? (bool?)__jsonIsDefaultVersion : IsDefaultVersion;} + {_support = If( json?.PropertyT("support"), out var __jsonSupport) ? (string)__jsonSupport : (string)Support;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._isDefaultVersion ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._isDefaultVersion) : null, "isDefaultVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._support)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._support.ToString()) : null, "support" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.PowerShell.cs new file mode 100644 index 000000000000..bc9d653b8c38 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The Safeguards profile. + [System.ComponentModel.TypeConverter(typeof(SafeguardsProfileTypeConverter))] + public partial class SafeguardsProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SafeguardsProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SafeguardsProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SafeguardsProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).SystemExcludedNamespace = (string[]) content.GetValueForProperty("SystemExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).SystemExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Level")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).Level = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).Level, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level.CreateFrom); + } + if (content.Contains("ExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).ExcludedNamespace = (string[]) content.GetValueForProperty("ExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).ExcludedNamespace, __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 SafeguardsProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).SystemExcludedNamespace = (string[]) content.GetValueForProperty("SystemExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).SystemExcludedNamespace, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Level")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).Level = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).Level, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level.CreateFrom); + } + if (content.Contains("ExcludedNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).ExcludedNamespace = (string[]) content.GetValueForProperty("ExcludedNamespace",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal)this).ExcludedNamespace, __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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Safeguards profile. + [System.ComponentModel.TypeConverter(typeof(SafeguardsProfileTypeConverter))] + public partial interface ISafeguardsProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.TypeConverter.cs new file mode 100644 index 000000000000..eb760cdf0e00 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SafeguardsProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISafeguardsProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SafeguardsProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SafeguardsProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SafeguardsProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.cs new file mode 100644 index 000000000000..d0060b43d5df --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The Safeguards profile. + public partial class SafeguardsProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal + { + + /// Backing field for property. + private string[] _excludedNamespace; + + /// List of namespaces excluded from Safeguards checks + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] ExcludedNamespace { get => this._excludedNamespace; set => this._excludedNamespace = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level _level; + + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level Level { get => this._level; set => this._level = value; } + + /// Internal Acessors for SystemExcludedNamespace + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfileInternal.SystemExcludedNamespace { get => this._systemExcludedNamespace; set { {_systemExcludedNamespace = value;} } } + + /// Backing field for property. + private string[] _systemExcludedNamespace; + + /// List of namespaces specified by AKS to be excluded from Safeguards + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] SystemExcludedNamespace { get => this._systemExcludedNamespace; } + + /// Backing field for property. + private string _version; + + /// The version of constraints to use + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public SafeguardsProfile() + { + + } + } + /// The Safeguards profile. + public partial interface ISafeguardsProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// List of namespaces excluded from Safeguards checks + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of namespaces excluded from Safeguards checks", + SerializedName = @"excludedNamespaces", + PossibleTypes = new [] { typeof(string) })] + string[] ExcludedNamespace { get; set; } + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces", + SerializedName = @"level", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level Level { get; set; } + /// List of namespaces specified by AKS to be excluded from Safeguards + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of namespaces specified by AKS to be excluded from Safeguards", + SerializedName = @"systemExcludedNamespaces", + PossibleTypes = new [] { typeof(string) })] + string[] SystemExcludedNamespace { get; } + /// The version of constraints to use + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of constraints to use", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// The Safeguards profile. + internal partial interface ISafeguardsProfileInternal + + { + /// List of namespaces excluded from Safeguards checks + string[] ExcludedNamespace { get; set; } + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level Level { get; set; } + /// List of namespaces specified by AKS to be excluded from Safeguards + string[] SystemExcludedNamespace { get; set; } + /// The version of constraints to use + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.json.cs new file mode 100644 index 000000000000..26f3746fc322 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SafeguardsProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The Safeguards profile. + public partial class SafeguardsProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new SafeguardsProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal SafeguardsProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_systemExcludedNamespace = If( json?.PropertyT("systemExcludedNamespaces"), out var __jsonSystemExcludedNamespaces) ? If( __jsonSystemExcludedNamespaces as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SystemExcludedNamespace;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_level = If( json?.PropertyT("level"), out var __jsonLevel) ? (string)__jsonLevel : (string)Level;} + {_excludedNamespace = If( json?.PropertyT("excludedNamespaces"), out var __jsonExcludedNamespaces) ? If( __jsonExcludedNamespaces as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ExcludedNamespace;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._systemExcludedNamespace) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._systemExcludedNamespace ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("systemExcludedNamespaces",__w); + } + } + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + AddIf( null != (((object)this._level)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._level.ToString()) : null, "level" ,container.Add ); + if (null != this._excludedNamespace) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._excludedNamespace ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("excludedNamespaces",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.PowerShell.cs new file mode 100644 index 000000000000..e233be9ca288 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Specifications on how to scale a VirtualMachines agent pool. + [System.ComponentModel.TypeConverter(typeof(ScaleProfileTypeConverter))] + public partial class ScaleProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ScaleProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ScaleProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ScaleProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Manual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)this).Manual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("Manual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)this).Manual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("Autoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)this).Autoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("Autoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)this).Autoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ScaleProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Manual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)this).Manual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("Manual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)this).Manual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("Autoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)this).Autoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("Autoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)this).Autoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Specifications on how to scale a VirtualMachines agent pool. + [System.ComponentModel.TypeConverter(typeof(ScaleProfileTypeConverter))] + public partial interface IScaleProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.TypeConverter.cs new file mode 100644 index 000000000000..1395d15f63f6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ScaleProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IScaleProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ScaleProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ScaleProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ScaleProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.cs new file mode 100644 index 000000000000..c2ba198d5b0c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifications on how to scale a VirtualMachines agent pool. + public partial class ScaleProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] _autoscale; + + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] Autoscale { get => this._autoscale; set => this._autoscale = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] _manual; + + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] Manual { get => this._manual; set => this._manual = value; } + + /// Creates an new instance. + public ScaleProfile() + { + + } + } + /// Specifications on how to scale a VirtualMachines agent pool. + public partial interface IScaleProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed.", + SerializedName = @"autoscale", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] Autoscale { get; set; } + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed.", + SerializedName = @"manual", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] Manual { get; set; } + + } + /// Specifications on how to scale a VirtualMachines agent pool. + internal partial interface IScaleProfileInternal + + { + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] Autoscale { get; set; } + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] Manual { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.json.cs new file mode 100644 index 000000000000..e88593277c41 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ScaleProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifications on how to scale a VirtualMachines agent pool. + public partial class ScaleProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ScaleProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ScaleProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_manual = If( json?.PropertyT("manual"), out var __jsonManual) ? If( __jsonManual as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManualScaleProfile) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfile.FromJson(__u) )) ))() : null : Manual;} + {_autoscale = If( json?.PropertyT("autoscale"), out var __jsonAutoscale) ? If( __jsonAutoscale as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAutoScaleProfile) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfile.FromJson(__p) )) ))() : null : Autoscale;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._manual) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._manual ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("manual",__w); + } + if (null != this._autoscale) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._autoscale ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("autoscale",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.PowerShell.cs new file mode 100644 index 000000000000..b9e55f518301 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' + /// for your maintenance schedule. + /// + [System.ComponentModel.TypeConverter(typeof(ScheduleTypeConverter))] + public partial class Schedule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Schedule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Schedule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Schedule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Daily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).Daily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule) content.GetValueForProperty("Daily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).Daily, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("Weekly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).Weekly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule) content.GetValueForProperty("Weekly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).Weekly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("AbsoluteMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule) content.GetValueForProperty("AbsoluteMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("RelativeMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule) content.GetValueForProperty("RelativeMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DailyIntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).DailyIntervalDay = (int) content.GetValueForProperty("DailyIntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).DailyIntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyIntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).WeeklyIntervalWeek = (int) content.GetValueForProperty("WeeklyIntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).WeeklyIntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).WeeklyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("WeeklyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).WeeklyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("AbsoluteMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthlyIntervalMonth = (int) content.GetValueForProperty("AbsoluteMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AbsoluteMonthlyDayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthlyDayOfMonth = (int) content.GetValueForProperty("AbsoluteMonthlyDayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthlyDayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyIntervalMonth = (int) content.GetValueForProperty("RelativeMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyWeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyWeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("RelativeMonthlyWeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyWeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("RelativeMonthlyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("RelativeMonthlyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Schedule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Daily")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).Daily = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule) content.GetValueForProperty("Daily",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).Daily, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("Weekly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).Weekly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule) content.GetValueForProperty("Weekly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).Weekly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("AbsoluteMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule) content.GetValueForProperty("AbsoluteMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("RelativeMonthly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthly = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule) content.GetValueForProperty("RelativeMonthly",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthly, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlyScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("DailyIntervalDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).DailyIntervalDay = (int) content.GetValueForProperty("DailyIntervalDay",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).DailyIntervalDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyIntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).WeeklyIntervalWeek = (int) content.GetValueForProperty("WeeklyIntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).WeeklyIntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("WeeklyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).WeeklyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("WeeklyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).WeeklyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("AbsoluteMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthlyIntervalMonth = (int) content.GetValueForProperty("AbsoluteMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AbsoluteMonthlyDayOfMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthlyDayOfMonth = (int) content.GetValueForProperty("AbsoluteMonthlyDayOfMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).AbsoluteMonthlyDayOfMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyIntervalMonth")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyIntervalMonth = (int) content.GetValueForProperty("RelativeMonthlyIntervalMonth",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyIntervalMonth, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RelativeMonthlyWeekIndex")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyWeekIndex = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) content.GetValueForProperty("RelativeMonthlyWeekIndex",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyWeekIndex, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type.CreateFrom); + } + if (content.Contains("RelativeMonthlyDayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyDayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("RelativeMonthlyDayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal)this).RelativeMonthlyDayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' + /// for your maintenance schedule. + [System.ComponentModel.TypeConverter(typeof(ScheduleTypeConverter))] + public partial interface ISchedule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.TypeConverter.cs new file mode 100644 index 000000000000..c08c041a6aa7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ScheduleTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISchedule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Schedule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Schedule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Schedule.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.cs new file mode 100644 index 000000000000..90b663e3b767 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' + /// for your maintenance schedule. + /// + public partial class Schedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule _absoluteMonthly; + + /// + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule AbsoluteMonthly { get => (this._absoluteMonthly = this._absoluteMonthly ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlySchedule()); set => this._absoluteMonthly = value; } + + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? AbsoluteMonthlyDayOfMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)AbsoluteMonthly).DayOfMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)AbsoluteMonthly).DayOfMonth = value ?? default(int); } + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? AbsoluteMonthlyIntervalMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)AbsoluteMonthly).IntervalMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlyScheduleInternal)AbsoluteMonthly).IntervalMonth = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule _daily; + + /// For schedules like: 'recur every day' or 'recur every 3 days'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule Daily { get => (this._daily = this._daily ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailySchedule()); set => this._daily = value; } + + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? DailyIntervalDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailyScheduleInternal)Daily).IntervalDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailyScheduleInternal)Daily).IntervalDay = value ?? default(int); } + + /// Internal Acessors for AbsoluteMonthly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal.AbsoluteMonthly { get => (this._absoluteMonthly = this._absoluteMonthly ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlySchedule()); set { {_absoluteMonthly = value;} } } + + /// Internal Acessors for Daily + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal.Daily { get => (this._daily = this._daily ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailySchedule()); set { {_daily = value;} } } + + /// Internal Acessors for RelativeMonthly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal.RelativeMonthly { get => (this._relativeMonthly = this._relativeMonthly ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlySchedule()); set { {_relativeMonthly = value;} } } + + /// Internal Acessors for Weekly + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScheduleInternal.Weekly { get => (this._weekly = this._weekly ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklySchedule()); set { {_weekly = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule _relativeMonthly; + + /// + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule RelativeMonthly { get => (this._relativeMonthly = this._relativeMonthly ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlySchedule()); set => this._relativeMonthly = value; } + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)RelativeMonthly).DayOfWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)RelativeMonthly).DayOfWeek = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); } + + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? RelativeMonthlyIntervalMonth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)RelativeMonthly).IntervalMonth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)RelativeMonthly).IntervalMonth = value ?? default(int); } + + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)RelativeMonthly).WeekIndex; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlyScheduleInternal)RelativeMonthly).WeekIndex = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule _weekly; + + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule Weekly { get => (this._weekly = this._weekly ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklySchedule()); set => this._weekly = value; } + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)Weekly).DayOfWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)Weekly).DayOfWeek = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); } + + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public int? WeeklyIntervalWeek { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)Weekly).IntervalWeek; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)Weekly).IntervalWeek = value ?? default(int); } + + /// Creates an new instance. + public Schedule() + { + + } + } + /// One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' + /// for your maintenance schedule. + public partial interface ISchedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The date of the month. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date of the month.", + SerializedName = @"dayOfMonth", + PossibleTypes = new [] { typeof(int) })] + int? AbsoluteMonthlyDayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int? AbsoluteMonthlyIntervalMonth { get; set; } + /// Specifies the number of days between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of days between each set of occurrences.", + SerializedName = @"intervalDays", + PossibleTypes = new [] { typeof(int) })] + int? DailyIntervalDay { get; set; } + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + int? RelativeMonthlyIntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.", + SerializedName = @"weekIndex", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get; set; } + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of weeks between each set of occurrences.", + SerializedName = @"intervalWeeks", + PossibleTypes = new [] { typeof(int) })] + int? WeeklyIntervalWeek { get; set; } + + } + /// One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' + /// for your maintenance schedule. + internal partial interface IScheduleInternal + + { + /// + /// For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAbsoluteMonthlySchedule AbsoluteMonthly { get; set; } + /// The date of the month. + int? AbsoluteMonthlyDayOfMonth { get; set; } + /// Specifies the number of months between each set of occurrences. + int? AbsoluteMonthlyIntervalMonth { get; set; } + /// For schedules like: 'recur every day' or 'recur every 3 days'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDailySchedule Daily { get; set; } + /// Specifies the number of days between each set of occurrences. + int? DailyIntervalDay { get; set; } + /// + /// For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRelativeMonthlySchedule RelativeMonthly { get; set; } + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? RelativeMonthlyDayOfWeek { get; set; } + /// Specifies the number of months between each set of occurrences. + int? RelativeMonthlyIntervalMonth { get; set; } + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type? RelativeMonthlyWeekIndex { get; set; } + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule Weekly { get; set; } + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? WeeklyDayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + int? WeeklyIntervalWeek { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.json.cs new file mode 100644 index 000000000000..3e09b43a1137 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Schedule.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' + /// for your maintenance schedule. + /// + public partial class Schedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new Schedule(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal Schedule(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_daily = If( json?.PropertyT("daily"), out var __jsonDaily) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.DailySchedule.FromJson(__jsonDaily) : Daily;} + {_weekly = If( json?.PropertyT("weekly"), out var __jsonWeekly) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.WeeklySchedule.FromJson(__jsonWeekly) : Weekly;} + {_absoluteMonthly = If( json?.PropertyT("absoluteMonthly"), out var __jsonAbsoluteMonthly) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AbsoluteMonthlySchedule.FromJson(__jsonAbsoluteMonthly) : AbsoluteMonthly;} + {_relativeMonthly = If( json?.PropertyT("relativeMonthly"), out var __jsonRelativeMonthly) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RelativeMonthlySchedule.FromJson(__jsonRelativeMonthly) : RelativeMonthly;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._daily ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._daily.ToJson(null,serializationMode) : null, "daily" ,container.Add ); + AddIf( null != this._weekly ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._weekly.ToJson(null,serializationMode) : null, "weekly" ,container.Add ); + AddIf( null != this._absoluteMonthly ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._absoluteMonthly.ToJson(null,serializationMode) : null, "absoluteMonthly" ,container.Add ); + AddIf( null != this._relativeMonthly ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._relativeMonthly.ToJson(null,serializationMode) : null, "relativeMonthly" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.PowerShell.cs new file mode 100644 index 000000000000..428cc8e447c8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Service mesh profile for a managed cluster. + [System.ComponentModel.TypeConverter(typeof(ServiceMeshProfileTypeConverter))] + public partial class ServiceMeshProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceMeshProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceMeshProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceMeshProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Istio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).Istio = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh) content.GetValueForProperty("Istio",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).Istio, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMeshTypeConverter.ConvertFrom); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode.CreateFrom); + } + if (content.Contains("IstioComponent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioComponent = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents) content.GetValueForProperty("IstioComponent",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioComponent, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponentsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioCertificateAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioCertificateAuthority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority) content.GetValueForProperty("IstioCertificateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioCertificateAuthority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("IstioRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioRevision = (string[]) content.GetValueForProperty("IstioRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioRevision, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ComponentIngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).ComponentIngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("ComponentIngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).ComponentIngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("ComponentEgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).ComponentEgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("ComponentEgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).ComponentEgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("CertificateAuthorityPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).CertificateAuthorityPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("CertificateAuthorityPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).CertificateAuthorityPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginCertChainObjectName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceMeshProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Istio")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).Istio = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh) content.GetValueForProperty("Istio",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).Istio, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMeshTypeConverter.ConvertFrom); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode.CreateFrom); + } + if (content.Contains("IstioComponent")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioComponent = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents) content.GetValueForProperty("IstioComponent",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioComponent, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioComponentsTypeConverter.ConvertFrom); + } + if (content.Contains("IstioCertificateAuthority")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioCertificateAuthority = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority) content.GetValueForProperty("IstioCertificateAuthority",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioCertificateAuthority, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("IstioRevision")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioRevision = (string[]) content.GetValueForProperty("IstioRevision",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).IstioRevision, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ComponentIngressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).ComponentIngressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[]) content.GetValueForProperty("ComponentIngressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).ComponentIngressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioIngressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("ComponentEgressGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).ComponentEgressGateway = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[]) content.GetValueForProperty("ComponentEgressGateway",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).ComponentEgressGateway, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioEgressGatewayTypeConverter.ConvertFrom)); + } + if (content.Contains("CertificateAuthorityPlugin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).CertificateAuthorityPlugin = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority) content.GetValueForProperty("CertificateAuthorityPlugin",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).CertificateAuthorityPlugin, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioPluginCertificateAuthorityTypeConverter.ConvertFrom); + } + if (content.Contains("PluginKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginKeyVaultId = (string) content.GetValueForProperty("PluginKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("PluginCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginCertObjectName = (string) content.GetValueForProperty("PluginCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginKeyObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginKeyObjectName = (string) content.GetValueForProperty("PluginKeyObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginKeyObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginRootCertObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginRootCertObjectName = (string) content.GetValueForProperty("PluginRootCertObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginRootCertObjectName, global::System.Convert.ToString); + } + if (content.Contains("PluginCertChainObjectName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginCertChainObjectName = (string) content.GetValueForProperty("PluginCertChainObjectName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal)this).PluginCertChainObjectName, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Service mesh profile for a managed cluster. + [System.ComponentModel.TypeConverter(typeof(ServiceMeshProfileTypeConverter))] + public partial interface IServiceMeshProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.TypeConverter.cs new file mode 100644 index 000000000000..10579562e654 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceMeshProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IServiceMeshProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceMeshProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceMeshProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceMeshProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.cs new file mode 100644 index 000000000000..2d06c080be22 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Service mesh profile for a managed cluster. + public partial class ServiceMeshProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal + { + + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).ComponentEgressGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).ComponentEgressGateway = value ?? null /* arrayOf */; } + + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).ComponentIngressGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).ComponentIngressGateway = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh _istio; + + /// Istio service mesh configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh Istio { get => (this._istio = this._istio ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMesh()); set => this._istio = value; } + + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] IstioRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).Revision = value ?? null /* arrayOf */; } + + /// Internal Acessors for CertificateAuthorityPlugin + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal.CertificateAuthorityPlugin { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).CertificateAuthorityPlugin; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).CertificateAuthorityPlugin = value; } + + /// Internal Acessors for Istio + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal.Istio { get => (this._istio = this._istio ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMesh()); set { {_istio = value;} } } + + /// Internal Acessors for IstioCertificateAuthority + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal.IstioCertificateAuthority { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).CertificateAuthority; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).CertificateAuthority = value; } + + /// Internal Acessors for IstioComponent + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfileInternal.IstioComponent { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).Component; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).Component = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode _mode; + + /// Mode of the service mesh. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode Mode { get => this._mode; set => this._mode = value; } + + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertChainObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginCertChainObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginCertChainObjectName = value ?? null; } + + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginCertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginCertObjectName = value ?? null; } + + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginKeyObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginKeyObjectName = value ?? null; } + + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginKeyVaultId = value ?? null; } + + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string PluginRootCertObjectName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginRootCertObjectName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMeshInternal)Istio).PluginRootCertObjectName = value ?? null; } + + /// Creates an new instance. + public ServiceMeshProfile() + { + + } + } + /// Service mesh profile for a managed cluster. + public partial interface IServiceMeshProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Istio egress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio egress gateways.", + SerializedName = @"egressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get; set; } + /// Istio ingress gateways. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio ingress gateways.", + SerializedName = @"ingressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get; set; } + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade", + SerializedName = @"revisions", + PossibleTypes = new [] { typeof(string) })] + string[] IstioRevision { get; set; } + /// Mode of the service mesh. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Mode of the service mesh.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode Mode { get; set; } + /// Certificate chain object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate chain object name in Azure Key Vault.", + SerializedName = @"certChainObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate object name in Azure Key Vault.", + SerializedName = @"certObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate private key object name in Azure Key Vault.", + SerializedName = @"keyObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the Key Vault.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Root certificate object name in Azure Key Vault.", + SerializedName = @"rootCertObjectName", + PossibleTypes = new [] { typeof(string) })] + string PluginRootCertObjectName { get; set; } + + } + /// Service mesh profile for a managed cluster. + internal partial interface IServiceMeshProfileInternal + + { + /// Plugin certificates information for Service Mesh. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioPluginCertificateAuthority CertificateAuthorityPlugin { get; set; } + /// Istio egress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get; set; } + /// Istio ingress gateways. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get; set; } + /// Istio service mesh configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioServiceMesh Istio { get; set; } + /// + /// Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin certificates as described + /// here https://aka.ms/asm-plugin-ca + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioCertificateAuthority IstioCertificateAuthority { get; set; } + /// Istio components configuration. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioComponents IstioComponent { get; set; } + /// + /// The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + string[] IstioRevision { get; set; } + /// Mode of the service mesh. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode Mode { get; set; } + /// Certificate chain object name in Azure Key Vault. + string PluginCertChainObjectName { get; set; } + /// Intermediate certificate object name in Azure Key Vault. + string PluginCertObjectName { get; set; } + /// Intermediate certificate private key object name in Azure Key Vault. + string PluginKeyObjectName { get; set; } + /// The resource ID of the Key Vault. + string PluginKeyVaultId { get; set; } + /// Root certificate object name in Azure Key Vault. + string PluginRootCertObjectName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.json.cs new file mode 100644 index 000000000000..1156ebe77aa3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/ServiceMeshProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Service mesh profile for a managed cluster. + public partial class ServiceMeshProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IServiceMeshProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ServiceMeshProfile(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceMeshProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_istio = If( json?.PropertyT("istio"), out var __jsonIstio) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IstioServiceMesh.FromJson(__jsonIstio) : Istio;} + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._istio ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._istio.ToJson(null,serializationMode) : null, "istio" ,container.Add ); + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.PowerShell.cs new file mode 100644 index 000000000000..c24f50f3d2f4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.PowerShell.cs @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// A node pool snapshot resource. + [System.ComponentModel.TypeConverter(typeof(SnapshotTypeConverter))] + public partial class Snapshot + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Snapshot(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Snapshot(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Snapshot(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.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).SnapshotType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType?) content.GetValueForProperty("SnapshotType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).SnapshotType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType.CreateFrom); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Snapshot(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.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).SnapshotType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType?) content.GetValueForProperty("SnapshotType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).SnapshotType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType.CreateFrom); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal)this).CreationDataSourceResourceId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A node pool snapshot resource. + [System.ComponentModel.TypeConverter(typeof(SnapshotTypeConverter))] + public partial interface ISnapshot + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.TypeConverter.cs new file mode 100644 index 000000000000..bbc9eb9cec2c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SnapshotTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISnapshot ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Snapshot.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Snapshot.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Snapshot.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.cs new file mode 100644 index 000000000000..14e7a2a30eca --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.cs @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A node pool snapshot resource. + public partial class Snapshot : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource(); + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CreationDataSourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).CreationDataSourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).CreationDataSourceResourceId = value ?? null; } + + /// Whether to use a FIPS-enabled OS. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public bool? EnableFips { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).EnableFips; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id; } + + /// The version of Kubernetes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).KubernetesVersion; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// Internal Acessors for CreationData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal.CreationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).CreationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).CreationData = value; } + + /// Internal Acessors for EnableFips + bool? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal.EnableFips { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).EnableFips; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).EnableFips = value; } + + /// Internal Acessors for KubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal.KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).KubernetesVersion = value; } + + /// Internal Acessors for NodeImageVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal.NodeImageVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).NodeImageVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).NodeImageVersion = value; } + + /// Internal Acessors for OSSku + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal.OSSku { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).OSSku; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).OSSku = value; } + + /// Internal Acessors for OSType + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal.OSType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).OSType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).OSType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotProperties()); set { {_property = value;} } } + + /// Internal Acessors for VMSize + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotInternal.VMSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).VMSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).VMSize = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Name; } + + /// The version of node image. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string NodeImageVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).NodeImageVersion; } + + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).OSSku; } + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).OSType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties _property; + + /// Properties of a snapshot. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotProperties()); set => this._property = value; } + + /// The type of a snapshot. The default is NodePool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).SnapshotType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).SnapshotType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType)""); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__trackedResource).Type; } + + /// The size of the VM. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string VMSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)Property).VMSize; } + + /// Creates an new instance. + public Snapshot() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// A node pool snapshot resource. + public partial interface ISnapshot : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource + { + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string CreationDataSourceResourceId { get; set; } + /// Whether to use a FIPS-enabled OS. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether to use a FIPS-enabled OS.", + SerializedName = @"enableFIPS", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableFips { get; } + /// The version of Kubernetes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of Kubernetes.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; } + /// The version of node image. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of node image.", + SerializedName = @"nodeImageVersion", + PossibleTypes = new [] { typeof(string) })] + string NodeImageVersion { get; } + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated.", + SerializedName = @"osSku", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get; } + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get; } + /// The type of a snapshot. The default is NodePool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of a snapshot. The default is NodePool.", + SerializedName = @"snapshotType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get; set; } + /// The size of the VM. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The size of the VM.", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + string VMSize { get; } + + } + /// A node pool snapshot resource. + internal partial interface ISnapshotInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal + { + /// + /// CreationData to be used to specify the source agent pool resource ID to create this snapshot. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + string CreationDataSourceResourceId { get; set; } + /// Whether to use a FIPS-enabled OS. + bool? EnableFips { get; set; } + /// The version of Kubernetes. + string KubernetesVersion { get; set; } + /// The version of node image. + string NodeImageVersion { get; set; } + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get; set; } + /// The operating system type. The default is Linux. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get; set; } + /// Properties of a snapshot. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties Property { get; set; } + /// The type of a snapshot. The default is NodePool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get; set; } + /// The size of the VM. + string VMSize { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.json.cs new file mode 100644 index 000000000000..b2a4c08077a7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/Snapshot.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// A node pool snapshot resource. + public partial class Snapshot + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new Snapshot(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal Snapshot(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.PowerShell.cs new file mode 100644 index 000000000000..b343edb8adab --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The response from the List Snapshots operation. + [System.ComponentModel.TypeConverter(typeof(SnapshotListResultTypeConverter))] + public partial class SnapshotListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SnapshotListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SnapshotListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SnapshotListResult(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.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal)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 SnapshotListResult(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.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.SnapshotTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List Snapshots operation. + [System.ComponentModel.TypeConverter(typeof(SnapshotListResultTypeConverter))] + public partial interface ISnapshotListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.TypeConverter.cs new file mode 100644 index 000000000000..efd5798bcc2b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SnapshotListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISnapshotListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SnapshotListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SnapshotListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SnapshotListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.cs new file mode 100644 index 000000000000..4e4e9ce3e6f1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Snapshots operation. + public partial class SnapshotListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// The URL to get the next set of snapshot results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot[] _value; + + /// The list of snapshots. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public SnapshotListResult() + { + + } + } + /// The response from the List Snapshots operation. + public partial interface ISnapshotListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The URL to get the next set of snapshot results. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The URL to get the next set of snapshot results.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The list of snapshots. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of snapshots.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot[] Value { get; set; } + + } + /// The response from the List Snapshots operation. + internal partial interface ISnapshotListResultInternal + + { + /// The URL to get the next set of snapshot results. + string NextLink { get; set; } + /// The list of snapshots. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.json.cs new file mode 100644 index 000000000000..4be64a277941 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The response from the List Snapshots operation. + public partial class SnapshotListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new SnapshotListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal SnapshotListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.ISnapshot) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Snapshot.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.PowerShell.cs new file mode 100644 index 000000000000..a9eb4292b5e9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.PowerShell.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Properties used to configure a node pool snapshot. + [System.ComponentModel.TypeConverter(typeof(SnapshotPropertiesTypeConverter))] + public partial class SnapshotProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SnapshotProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SnapshotProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SnapshotProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).SnapshotType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType?) content.GetValueForProperty("SnapshotType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).SnapshotType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType.CreateFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).CreationDataSourceResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SnapshotProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).CreationData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData) content.GetValueForProperty("CreationData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).CreationData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationDataTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).SnapshotType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType?) content.GetValueForProperty("SnapshotType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).SnapshotType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType.CreateFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("NodeImageVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).NodeImageVersion = (string) content.GetValueForProperty("NodeImageVersion",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).NodeImageVersion, global::System.Convert.ToString); + } + if (content.Contains("OSType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).OSType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType?) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).OSType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType.CreateFrom); + } + if (content.Contains("OSSku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).OSSku = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku?) content.GetValueForProperty("OSSku",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).OSSku, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku.CreateFrom); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("EnableFips")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).EnableFips = (bool?) content.GetValueForProperty("EnableFips",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).EnableFips, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CreationDataSourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).CreationDataSourceResourceId = (string) content.GetValueForProperty("CreationDataSourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal)this).CreationDataSourceResourceId, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties used to configure a node pool snapshot. + [System.ComponentModel.TypeConverter(typeof(SnapshotPropertiesTypeConverter))] + public partial interface ISnapshotProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.TypeConverter.cs new file mode 100644 index 000000000000..69921d6d6477 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SnapshotPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISnapshotProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SnapshotProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SnapshotProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SnapshotProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.cs new file mode 100644 index 000000000000..2e521e0a15f9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties used to configure a node pool snapshot. + public partial class SnapshotProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData _creationData; + + /// + /// CreationData to be used to specify the source agent pool resource ID to create this snapshot. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get => (this._creationData = this._creationData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData()); set => this._creationData = value; } + + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string CreationDataSourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)CreationData).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationDataInternal)CreationData).SourceResourceId = value ?? null; } + + /// Backing field for property. + private bool? _enableFips; + + /// Whether to use a FIPS-enabled OS. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? EnableFips { get => this._enableFips; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// The version of Kubernetes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; } + + /// Internal Acessors for CreationData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal.CreationData { get => (this._creationData = this._creationData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData()); set { {_creationData = value;} } } + + /// Internal Acessors for EnableFips + bool? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal.EnableFips { get => this._enableFips; set { {_enableFips = value;} } } + + /// Internal Acessors for KubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal.KubernetesVersion { get => this._kubernetesVersion; set { {_kubernetesVersion = value;} } } + + /// Internal Acessors for NodeImageVersion + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal.NodeImageVersion { get => this._nodeImageVersion; set { {_nodeImageVersion = value;} } } + + /// Internal Acessors for OSSku + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal.OSSku { get => this._oSSku; set { {_oSSku = value;} } } + + /// Internal Acessors for OSType + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal.OSType { get => this._oSType; set { {_oSType = value;} } } + + /// Internal Acessors for VMSize + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotPropertiesInternal.VMSize { get => this._vMSize; set { {_vMSize = value;} } } + + /// Backing field for property. + private string _nodeImageVersion; + + /// The version of node image. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NodeImageVersion { get => this._nodeImageVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? _oSSku; + + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get => this._oSSku; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? _oSType; + + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get => this._oSType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? _snapshotType; + + /// The type of a snapshot. The default is NodePool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get => this._snapshotType; set => this._snapshotType = value; } + + /// Backing field for property. + private string _vMSize; + + /// The size of the VM. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string VMSize { get => this._vMSize; } + + /// Creates an new instance. + public SnapshotProperties() + { + + } + } + /// Properties used to configure a node pool snapshot. + public partial interface ISnapshotProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// This is the ARM ID of the source object to be used to create the target object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string CreationDataSourceResourceId { get; set; } + /// Whether to use a FIPS-enabled OS. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Whether to use a FIPS-enabled OS.", + SerializedName = @"enableFIPS", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableFips { get; } + /// The version of Kubernetes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of Kubernetes.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; } + /// The version of node image. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of node image.", + SerializedName = @"nodeImageVersion", + PossibleTypes = new [] { typeof(string) })] + string NodeImageVersion { get; } + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated.", + SerializedName = @"osSku", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get; } + /// The operating system type. The default is Linux. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get; } + /// The type of a snapshot. The default is NodePool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of a snapshot. The default is NodePool.", + SerializedName = @"snapshotType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get; set; } + /// The size of the VM. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The size of the VM.", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + string VMSize { get; } + + } + /// Properties used to configure a node pool snapshot. + internal partial interface ISnapshotPropertiesInternal + + { + /// + /// CreationData to be used to specify the source agent pool resource ID to create this snapshot. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICreationData CreationData { get; set; } + /// This is the ARM ID of the source object to be used to create the target object. + string CreationDataSourceResourceId { get; set; } + /// Whether to use a FIPS-enabled OS. + bool? EnableFips { get; set; } + /// The version of Kubernetes. + string KubernetesVersion { get; set; } + /// The version of node image. + string NodeImageVersion { get; set; } + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku? OSSku { get; set; } + /// The operating system type. The default is Linux. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType? OSType { get; set; } + /// The type of a snapshot. The default is NodePool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType? SnapshotType { get; set; } + /// The size of the VM. + string VMSize { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.json.cs new file mode 100644 index 000000000000..6736cb321980 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SnapshotProperties.json.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties used to configure a node pool snapshot. + public partial class SnapshotProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new SnapshotProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal SnapshotProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_creationData = If( json?.PropertyT("creationData"), out var __jsonCreationData) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.CreationData.FromJson(__jsonCreationData) : CreationData;} + {_snapshotType = If( json?.PropertyT("snapshotType"), out var __jsonSnapshotType) ? (string)__jsonSnapshotType : (string)SnapshotType;} + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} + {_nodeImageVersion = If( json?.PropertyT("nodeImageVersion"), out var __jsonNodeImageVersion) ? (string)__jsonNodeImageVersion : (string)NodeImageVersion;} + {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)OSType;} + {_oSSku = If( json?.PropertyT("osSku"), out var __jsonOSSku) ? (string)__jsonOSSku : (string)OSSku;} + {_vMSize = If( json?.PropertyT("vmSize"), out var __jsonVMSize) ? (string)__jsonVMSize : (string)VMSize;} + {_enableFips = If( json?.PropertyT("enableFIPS"), out var __jsonEnableFips) ? (bool?)__jsonEnableFips : EnableFips;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._creationData ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._creationData.ToJson(null,serializationMode) : null, "creationData" ,container.Add ); + AddIf( null != (((object)this._snapshotType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._snapshotType.ToString()) : null, "snapshotType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nodeImageVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nodeImageVersion.ToString()) : null, "nodeImageVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._oSSku)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._oSSku.ToString()) : null, "osSku" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._vMSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._vMSize.ToString()) : null, "vmSize" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._enableFips ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enableFips) : null, "enableFIPS" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.PowerShell.cs new file mode 100644 index 000000000000..29fea8cce61d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Reference to another subresource. + [System.ComponentModel.TypeConverter(typeof(SubResourceTypeConverter))] + public partial class SubResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SubResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SubResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SubResource(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.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)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 SubResource(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.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal)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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Reference to another subresource. + [System.ComponentModel.TypeConverter(typeof(SubResourceTypeConverter))] + public partial interface ISubResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.TypeConverter.cs new file mode 100644 index 000000000000..e161fa138f7c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SubResourceTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISubResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SubResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SubResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SubResource.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.cs new file mode 100644 index 000000000000..0d5e65c1b4fb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Reference to another subresource. + public partial class SubResource : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal + { + + /// Backing field for property. + private string _id; + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// + /// The name of the resource that is unique within a resource group. This name can be used to access the resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// Resource type + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public SubResource() + { + + } + } + /// Reference to another subresource. + public partial interface ISubResource : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource ID.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// + /// The name of the resource that is unique within a resource group. This name can be used to access the resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the resource that is unique within a resource group. This name can be used to access the resource.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// Resource type + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource type", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// Reference to another subresource. + internal partial interface ISubResourceInternal + + { + /// Resource ID. + string Id { get; set; } + /// + /// The name of the resource that is unique within a resource group. This name can be used to access the resource. + /// + string Name { get; set; } + /// Resource type + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.json.cs new file mode 100644 index 000000000000..d56155c8676e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SubResource.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Reference to another subresource. + public partial class SubResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISubResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new SubResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal SubResource(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.PowerShell.cs new file mode 100644 index 000000000000..ef113fa05d68 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.PowerShell.cs @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Sysctl settings for Linux agent nodes. + [System.ComponentModel.TypeConverter(typeof(SysctlConfigTypeConverter))] + public partial class SysctlConfig + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SysctlConfig(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SysctlConfig(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SysctlConfig(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetCoreSomaxconn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreSomaxconn = (int?) content.GetValueForProperty("NetCoreSomaxconn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreSomaxconn, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreNetdevMaxBacklog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreNetdevMaxBacklog = (int?) content.GetValueForProperty("NetCoreNetdevMaxBacklog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreNetdevMaxBacklog, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreRmemDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreRmemDefault = (int?) content.GetValueForProperty("NetCoreRmemDefault",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreRmemDefault, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreRmemMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreRmemMax = (int?) content.GetValueForProperty("NetCoreRmemMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreRmemMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreWmemDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreWmemDefault = (int?) content.GetValueForProperty("NetCoreWmemDefault",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreWmemDefault, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreWmemMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreWmemMax = (int?) content.GetValueForProperty("NetCoreWmemMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreWmemMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreOptmemMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreOptmemMax = (int?) content.GetValueForProperty("NetCoreOptmemMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreOptmemMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpMaxSynBacklog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpMaxSynBacklog = (int?) content.GetValueForProperty("NetIpv4TcpMaxSynBacklog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpMaxSynBacklog, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpMaxTwBucket")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpMaxTwBucket = (int?) content.GetValueForProperty("NetIpv4TcpMaxTwBucket",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpMaxTwBucket, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpFinTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpFinTimeout = (int?) content.GetValueForProperty("NetIpv4TcpFinTimeout",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpFinTimeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpKeepaliveTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpKeepaliveTime = (int?) content.GetValueForProperty("NetIpv4TcpKeepaliveTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpKeepaliveTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpKeepaliveProbe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpKeepaliveProbe = (int?) content.GetValueForProperty("NetIpv4TcpKeepaliveProbe",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpKeepaliveProbe, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpkeepaliveIntvl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpkeepaliveIntvl = (int?) content.GetValueForProperty("NetIpv4TcpkeepaliveIntvl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpkeepaliveIntvl, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpTwReuse")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpTwReuse = (bool?) content.GetValueForProperty("NetIpv4TcpTwReuse",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpTwReuse, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetIpv4IPLocalPortRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4IPLocalPortRange = (string) content.GetValueForProperty("NetIpv4IPLocalPortRange",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4IPLocalPortRange, global::System.Convert.ToString); + } + if (content.Contains("NetIpv4NeighDefaultGcThresh1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh1 = (int?) content.GetValueForProperty("NetIpv4NeighDefaultGcThresh1",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh1, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4NeighDefaultGcThresh2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh2 = (int?) content.GetValueForProperty("NetIpv4NeighDefaultGcThresh2",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh2, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4NeighDefaultGcThresh3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh3 = (int?) content.GetValueForProperty("NetIpv4NeighDefaultGcThresh3",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh3, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetNetfilterNfConntrackMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetNetfilterNfConntrackMax = (int?) content.GetValueForProperty("NetNetfilterNfConntrackMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetNetfilterNfConntrackMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetNetfilterNfConntrackBucket")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetNetfilterNfConntrackBucket = (int?) content.GetValueForProperty("NetNetfilterNfConntrackBucket",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetNetfilterNfConntrackBucket, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FsInotifyMaxUserWatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsInotifyMaxUserWatch = (int?) content.GetValueForProperty("FsInotifyMaxUserWatch",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsInotifyMaxUserWatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FsFileMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsFileMax = (int?) content.GetValueForProperty("FsFileMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsFileMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FsAioMaxNr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsAioMaxNr = (int?) content.GetValueForProperty("FsAioMaxNr",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsAioMaxNr, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FsNrOpen")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsNrOpen = (int?) content.GetValueForProperty("FsNrOpen",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsNrOpen, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KernelThreadsMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).KernelThreadsMax = (int?) content.GetValueForProperty("KernelThreadsMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).KernelThreadsMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMMaxMapCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMMaxMapCount = (int?) content.GetValueForProperty("VMMaxMapCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMMaxMapCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMSwappiness")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMSwappiness = (int?) content.GetValueForProperty("VMSwappiness",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMSwappiness, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMVfsCachePressure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMVfsCachePressure = (int?) content.GetValueForProperty("VMVfsCachePressure",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMVfsCachePressure, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SysctlConfig(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NetCoreSomaxconn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreSomaxconn = (int?) content.GetValueForProperty("NetCoreSomaxconn",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreSomaxconn, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreNetdevMaxBacklog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreNetdevMaxBacklog = (int?) content.GetValueForProperty("NetCoreNetdevMaxBacklog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreNetdevMaxBacklog, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreRmemDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreRmemDefault = (int?) content.GetValueForProperty("NetCoreRmemDefault",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreRmemDefault, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreRmemMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreRmemMax = (int?) content.GetValueForProperty("NetCoreRmemMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreRmemMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreWmemDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreWmemDefault = (int?) content.GetValueForProperty("NetCoreWmemDefault",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreWmemDefault, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreWmemMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreWmemMax = (int?) content.GetValueForProperty("NetCoreWmemMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreWmemMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetCoreOptmemMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreOptmemMax = (int?) content.GetValueForProperty("NetCoreOptmemMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetCoreOptmemMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpMaxSynBacklog")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpMaxSynBacklog = (int?) content.GetValueForProperty("NetIpv4TcpMaxSynBacklog",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpMaxSynBacklog, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpMaxTwBucket")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpMaxTwBucket = (int?) content.GetValueForProperty("NetIpv4TcpMaxTwBucket",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpMaxTwBucket, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpFinTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpFinTimeout = (int?) content.GetValueForProperty("NetIpv4TcpFinTimeout",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpFinTimeout, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpKeepaliveTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpKeepaliveTime = (int?) content.GetValueForProperty("NetIpv4TcpKeepaliveTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpKeepaliveTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpKeepaliveProbe")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpKeepaliveProbe = (int?) content.GetValueForProperty("NetIpv4TcpKeepaliveProbe",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpKeepaliveProbe, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpkeepaliveIntvl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpkeepaliveIntvl = (int?) content.GetValueForProperty("NetIpv4TcpkeepaliveIntvl",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpkeepaliveIntvl, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4TcpTwReuse")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpTwReuse = (bool?) content.GetValueForProperty("NetIpv4TcpTwReuse",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4TcpTwReuse, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetIpv4IPLocalPortRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4IPLocalPortRange = (string) content.GetValueForProperty("NetIpv4IPLocalPortRange",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4IPLocalPortRange, global::System.Convert.ToString); + } + if (content.Contains("NetIpv4NeighDefaultGcThresh1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh1 = (int?) content.GetValueForProperty("NetIpv4NeighDefaultGcThresh1",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh1, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4NeighDefaultGcThresh2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh2 = (int?) content.GetValueForProperty("NetIpv4NeighDefaultGcThresh2",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh2, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetIpv4NeighDefaultGcThresh3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh3 = (int?) content.GetValueForProperty("NetIpv4NeighDefaultGcThresh3",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetIpv4NeighDefaultGcThresh3, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetNetfilterNfConntrackMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetNetfilterNfConntrackMax = (int?) content.GetValueForProperty("NetNetfilterNfConntrackMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetNetfilterNfConntrackMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NetNetfilterNfConntrackBucket")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetNetfilterNfConntrackBucket = (int?) content.GetValueForProperty("NetNetfilterNfConntrackBucket",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).NetNetfilterNfConntrackBucket, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FsInotifyMaxUserWatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsInotifyMaxUserWatch = (int?) content.GetValueForProperty("FsInotifyMaxUserWatch",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsInotifyMaxUserWatch, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FsFileMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsFileMax = (int?) content.GetValueForProperty("FsFileMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsFileMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FsAioMaxNr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsAioMaxNr = (int?) content.GetValueForProperty("FsAioMaxNr",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsAioMaxNr, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("FsNrOpen")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsNrOpen = (int?) content.GetValueForProperty("FsNrOpen",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).FsNrOpen, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("KernelThreadsMax")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).KernelThreadsMax = (int?) content.GetValueForProperty("KernelThreadsMax",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).KernelThreadsMax, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMMaxMapCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMMaxMapCount = (int?) content.GetValueForProperty("VMMaxMapCount",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMMaxMapCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMSwappiness")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMSwappiness = (int?) content.GetValueForProperty("VMSwappiness",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMSwappiness, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("VMVfsCachePressure")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMVfsCachePressure = (int?) content.GetValueForProperty("VMVfsCachePressure",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal)this).VMVfsCachePressure, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Sysctl settings for Linux agent nodes. + [System.ComponentModel.TypeConverter(typeof(SysctlConfigTypeConverter))] + public partial interface ISysctlConfig + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.TypeConverter.cs new file mode 100644 index 000000000000..dab8d1c666a0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SysctlConfigTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISysctlConfig ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SysctlConfig.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SysctlConfig.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SysctlConfig.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.cs new file mode 100644 index 000000000000..ed90db89978a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Sysctl settings for Linux agent nodes. + public partial class SysctlConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfigInternal + { + + /// Backing field for property. + private int? _fsAioMaxNr; + + /// Sysctl setting fs.aio-max-nr. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? FsAioMaxNr { get => this._fsAioMaxNr; set => this._fsAioMaxNr = value; } + + /// Backing field for property. + private int? _fsFileMax; + + /// Sysctl setting fs.file-max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? FsFileMax { get => this._fsFileMax; set => this._fsFileMax = value; } + + /// Backing field for property. + private int? _fsInotifyMaxUserWatch; + + /// Sysctl setting fs.inotify.max_user_watches. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? FsInotifyMaxUserWatch { get => this._fsInotifyMaxUserWatch; set => this._fsInotifyMaxUserWatch = value; } + + /// Backing field for property. + private int? _fsNrOpen; + + /// Sysctl setting fs.nr_open. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? FsNrOpen { get => this._fsNrOpen; set => this._fsNrOpen = value; } + + /// Backing field for property. + private int? _kernelThreadsMax; + + /// Sysctl setting kernel.threads-max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? KernelThreadsMax { get => this._kernelThreadsMax; set => this._kernelThreadsMax = value; } + + /// Backing field for property. + private int? _netCoreNetdevMaxBacklog; + + /// Sysctl setting net.core.netdev_max_backlog. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetCoreNetdevMaxBacklog { get => this._netCoreNetdevMaxBacklog; set => this._netCoreNetdevMaxBacklog = value; } + + /// Backing field for property. + private int? _netCoreOptmemMax; + + /// Sysctl setting net.core.optmem_max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetCoreOptmemMax { get => this._netCoreOptmemMax; set => this._netCoreOptmemMax = value; } + + /// Backing field for property. + private int? _netCoreRmemDefault; + + /// Sysctl setting net.core.rmem_default. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetCoreRmemDefault { get => this._netCoreRmemDefault; set => this._netCoreRmemDefault = value; } + + /// Backing field for property. + private int? _netCoreRmemMax; + + /// Sysctl setting net.core.rmem_max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetCoreRmemMax { get => this._netCoreRmemMax; set => this._netCoreRmemMax = value; } + + /// Backing field for property. + private int? _netCoreSomaxconn; + + /// Sysctl setting net.core.somaxconn. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetCoreSomaxconn { get => this._netCoreSomaxconn; set => this._netCoreSomaxconn = value; } + + /// Backing field for property. + private int? _netCoreWmemDefault; + + /// Sysctl setting net.core.wmem_default. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetCoreWmemDefault { get => this._netCoreWmemDefault; set => this._netCoreWmemDefault = value; } + + /// Backing field for property. + private int? _netCoreWmemMax; + + /// Sysctl setting net.core.wmem_max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetCoreWmemMax { get => this._netCoreWmemMax; set => this._netCoreWmemMax = value; } + + /// Backing field for property. + private string _netIpv4IPLocalPortRange; + + /// Sysctl setting net.ipv4.ip_local_port_range. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NetIpv4IPLocalPortRange { get => this._netIpv4IPLocalPortRange; set => this._netIpv4IPLocalPortRange = value; } + + /// Backing field for property. + private int? _netIpv4NeighDefaultGcThresh1; + + /// Sysctl setting net.ipv4.neigh.default.gc_thresh1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetIpv4NeighDefaultGcThresh1 { get => this._netIpv4NeighDefaultGcThresh1; set => this._netIpv4NeighDefaultGcThresh1 = value; } + + /// Backing field for property. + private int? _netIpv4NeighDefaultGcThresh2; + + /// Sysctl setting net.ipv4.neigh.default.gc_thresh2. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetIpv4NeighDefaultGcThresh2 { get => this._netIpv4NeighDefaultGcThresh2; set => this._netIpv4NeighDefaultGcThresh2 = value; } + + /// Backing field for property. + private int? _netIpv4NeighDefaultGcThresh3; + + /// Sysctl setting net.ipv4.neigh.default.gc_thresh3. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetIpv4NeighDefaultGcThresh3 { get => this._netIpv4NeighDefaultGcThresh3; set => this._netIpv4NeighDefaultGcThresh3 = value; } + + /// Backing field for property. + private int? _netIpv4TcpFinTimeout; + + /// Sysctl setting net.ipv4.tcp_fin_timeout. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetIpv4TcpFinTimeout { get => this._netIpv4TcpFinTimeout; set => this._netIpv4TcpFinTimeout = value; } + + /// Backing field for property. + private int? _netIpv4TcpKeepaliveProbe; + + /// Sysctl setting net.ipv4.tcp_keepalive_probes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetIpv4TcpKeepaliveProbe { get => this._netIpv4TcpKeepaliveProbe; set => this._netIpv4TcpKeepaliveProbe = value; } + + /// Backing field for property. + private int? _netIpv4TcpKeepaliveTime; + + /// Sysctl setting net.ipv4.tcp_keepalive_time. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetIpv4TcpKeepaliveTime { get => this._netIpv4TcpKeepaliveTime; set => this._netIpv4TcpKeepaliveTime = value; } + + /// Backing field for property. + private int? _netIpv4TcpMaxSynBacklog; + + /// Sysctl setting net.ipv4.tcp_max_syn_backlog. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetIpv4TcpMaxSynBacklog { get => this._netIpv4TcpMaxSynBacklog; set => this._netIpv4TcpMaxSynBacklog = value; } + + /// Backing field for property. + private int? _netIpv4TcpMaxTwBucket; + + /// Sysctl setting net.ipv4.tcp_max_tw_buckets. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetIpv4TcpMaxTwBucket { get => this._netIpv4TcpMaxTwBucket; set => this._netIpv4TcpMaxTwBucket = value; } + + /// Backing field for property. + private bool? _netIpv4TcpTwReuse; + + /// Sysctl setting net.ipv4.tcp_tw_reuse. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? NetIpv4TcpTwReuse { get => this._netIpv4TcpTwReuse; set => this._netIpv4TcpTwReuse = value; } + + /// Backing field for property. + private int? _netIpv4TcpkeepaliveIntvl; + + /// Sysctl setting net.ipv4.tcp_keepalive_intvl. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetIpv4TcpkeepaliveIntvl { get => this._netIpv4TcpkeepaliveIntvl; set => this._netIpv4TcpkeepaliveIntvl = value; } + + /// Backing field for property. + private int? _netNetfilterNfConntrackBucket; + + /// Sysctl setting net.netfilter.nf_conntrack_buckets. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetNetfilterNfConntrackBucket { get => this._netNetfilterNfConntrackBucket; set => this._netNetfilterNfConntrackBucket = value; } + + /// Backing field for property. + private int? _netNetfilterNfConntrackMax; + + /// Sysctl setting net.netfilter.nf_conntrack_max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? NetNetfilterNfConntrackMax { get => this._netNetfilterNfConntrackMax; set => this._netNetfilterNfConntrackMax = value; } + + /// Backing field for property. + private int? _vMMaxMapCount; + + /// Sysctl setting vm.max_map_count. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? VMMaxMapCount { get => this._vMMaxMapCount; set => this._vMMaxMapCount = value; } + + /// Backing field for property. + private int? _vMSwappiness; + + /// Sysctl setting vm.swappiness. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? VMSwappiness { get => this._vMSwappiness; set => this._vMSwappiness = value; } + + /// Backing field for property. + private int? _vMVfsCachePressure; + + /// Sysctl setting vm.vfs_cache_pressure. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? VMVfsCachePressure { get => this._vMVfsCachePressure; set => this._vMVfsCachePressure = value; } + + /// Creates an new instance. + public SysctlConfig() + { + + } + } + /// Sysctl settings for Linux agent nodes. + public partial interface ISysctlConfig : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Sysctl setting fs.aio-max-nr. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting fs.aio-max-nr.", + SerializedName = @"fsAioMaxNr", + PossibleTypes = new [] { typeof(int) })] + int? FsAioMaxNr { get; set; } + /// Sysctl setting fs.file-max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting fs.file-max.", + SerializedName = @"fsFileMax", + PossibleTypes = new [] { typeof(int) })] + int? FsFileMax { get; set; } + /// Sysctl setting fs.inotify.max_user_watches. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting fs.inotify.max_user_watches.", + SerializedName = @"fsInotifyMaxUserWatches", + PossibleTypes = new [] { typeof(int) })] + int? FsInotifyMaxUserWatch { get; set; } + /// Sysctl setting fs.nr_open. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting fs.nr_open.", + SerializedName = @"fsNrOpen", + PossibleTypes = new [] { typeof(int) })] + int? FsNrOpen { get; set; } + /// Sysctl setting kernel.threads-max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting kernel.threads-max.", + SerializedName = @"kernelThreadsMax", + PossibleTypes = new [] { typeof(int) })] + int? KernelThreadsMax { get; set; } + /// Sysctl setting net.core.netdev_max_backlog. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.core.netdev_max_backlog.", + SerializedName = @"netCoreNetdevMaxBacklog", + PossibleTypes = new [] { typeof(int) })] + int? NetCoreNetdevMaxBacklog { get; set; } + /// Sysctl setting net.core.optmem_max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.core.optmem_max.", + SerializedName = @"netCoreOptmemMax", + PossibleTypes = new [] { typeof(int) })] + int? NetCoreOptmemMax { get; set; } + /// Sysctl setting net.core.rmem_default. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.core.rmem_default.", + SerializedName = @"netCoreRmemDefault", + PossibleTypes = new [] { typeof(int) })] + int? NetCoreRmemDefault { get; set; } + /// Sysctl setting net.core.rmem_max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.core.rmem_max.", + SerializedName = @"netCoreRmemMax", + PossibleTypes = new [] { typeof(int) })] + int? NetCoreRmemMax { get; set; } + /// Sysctl setting net.core.somaxconn. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.core.somaxconn.", + SerializedName = @"netCoreSomaxconn", + PossibleTypes = new [] { typeof(int) })] + int? NetCoreSomaxconn { get; set; } + /// Sysctl setting net.core.wmem_default. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.core.wmem_default.", + SerializedName = @"netCoreWmemDefault", + PossibleTypes = new [] { typeof(int) })] + int? NetCoreWmemDefault { get; set; } + /// Sysctl setting net.core.wmem_max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.core.wmem_max.", + SerializedName = @"netCoreWmemMax", + PossibleTypes = new [] { typeof(int) })] + int? NetCoreWmemMax { get; set; } + /// Sysctl setting net.ipv4.ip_local_port_range. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.ip_local_port_range.", + SerializedName = @"netIpv4IpLocalPortRange", + PossibleTypes = new [] { typeof(string) })] + string NetIpv4IPLocalPortRange { get; set; } + /// Sysctl setting net.ipv4.neigh.default.gc_thresh1. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.neigh.default.gc_thresh1.", + SerializedName = @"netIpv4NeighDefaultGcThresh1", + PossibleTypes = new [] { typeof(int) })] + int? NetIpv4NeighDefaultGcThresh1 { get; set; } + /// Sysctl setting net.ipv4.neigh.default.gc_thresh2. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.neigh.default.gc_thresh2.", + SerializedName = @"netIpv4NeighDefaultGcThresh2", + PossibleTypes = new [] { typeof(int) })] + int? NetIpv4NeighDefaultGcThresh2 { get; set; } + /// Sysctl setting net.ipv4.neigh.default.gc_thresh3. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.neigh.default.gc_thresh3.", + SerializedName = @"netIpv4NeighDefaultGcThresh3", + PossibleTypes = new [] { typeof(int) })] + int? NetIpv4NeighDefaultGcThresh3 { get; set; } + /// Sysctl setting net.ipv4.tcp_fin_timeout. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.tcp_fin_timeout.", + SerializedName = @"netIpv4TcpFinTimeout", + PossibleTypes = new [] { typeof(int) })] + int? NetIpv4TcpFinTimeout { get; set; } + /// Sysctl setting net.ipv4.tcp_keepalive_probes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.tcp_keepalive_probes.", + SerializedName = @"netIpv4TcpKeepaliveProbes", + PossibleTypes = new [] { typeof(int) })] + int? NetIpv4TcpKeepaliveProbe { get; set; } + /// Sysctl setting net.ipv4.tcp_keepalive_time. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.tcp_keepalive_time.", + SerializedName = @"netIpv4TcpKeepaliveTime", + PossibleTypes = new [] { typeof(int) })] + int? NetIpv4TcpKeepaliveTime { get; set; } + /// Sysctl setting net.ipv4.tcp_max_syn_backlog. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.tcp_max_syn_backlog.", + SerializedName = @"netIpv4TcpMaxSynBacklog", + PossibleTypes = new [] { typeof(int) })] + int? NetIpv4TcpMaxSynBacklog { get; set; } + /// Sysctl setting net.ipv4.tcp_max_tw_buckets. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.tcp_max_tw_buckets.", + SerializedName = @"netIpv4TcpMaxTwBuckets", + PossibleTypes = new [] { typeof(int) })] + int? NetIpv4TcpMaxTwBucket { get; set; } + /// Sysctl setting net.ipv4.tcp_tw_reuse. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.tcp_tw_reuse.", + SerializedName = @"netIpv4TcpTwReuse", + PossibleTypes = new [] { typeof(bool) })] + bool? NetIpv4TcpTwReuse { get; set; } + /// Sysctl setting net.ipv4.tcp_keepalive_intvl. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.ipv4.tcp_keepalive_intvl.", + SerializedName = @"netIpv4TcpkeepaliveIntvl", + PossibleTypes = new [] { typeof(int) })] + int? NetIpv4TcpkeepaliveIntvl { get; set; } + /// Sysctl setting net.netfilter.nf_conntrack_buckets. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.netfilter.nf_conntrack_buckets.", + SerializedName = @"netNetfilterNfConntrackBuckets", + PossibleTypes = new [] { typeof(int) })] + int? NetNetfilterNfConntrackBucket { get; set; } + /// Sysctl setting net.netfilter.nf_conntrack_max. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting net.netfilter.nf_conntrack_max.", + SerializedName = @"netNetfilterNfConntrackMax", + PossibleTypes = new [] { typeof(int) })] + int? NetNetfilterNfConntrackMax { get; set; } + /// Sysctl setting vm.max_map_count. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting vm.max_map_count.", + SerializedName = @"vmMaxMapCount", + PossibleTypes = new [] { typeof(int) })] + int? VMMaxMapCount { get; set; } + /// Sysctl setting vm.swappiness. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting vm.swappiness.", + SerializedName = @"vmSwappiness", + PossibleTypes = new [] { typeof(int) })] + int? VMSwappiness { get; set; } + /// Sysctl setting vm.vfs_cache_pressure. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl setting vm.vfs_cache_pressure.", + SerializedName = @"vmVfsCachePressure", + PossibleTypes = new [] { typeof(int) })] + int? VMVfsCachePressure { get; set; } + + } + /// Sysctl settings for Linux agent nodes. + internal partial interface ISysctlConfigInternal + + { + /// Sysctl setting fs.aio-max-nr. + int? FsAioMaxNr { get; set; } + /// Sysctl setting fs.file-max. + int? FsFileMax { get; set; } + /// Sysctl setting fs.inotify.max_user_watches. + int? FsInotifyMaxUserWatch { get; set; } + /// Sysctl setting fs.nr_open. + int? FsNrOpen { get; set; } + /// Sysctl setting kernel.threads-max. + int? KernelThreadsMax { get; set; } + /// Sysctl setting net.core.netdev_max_backlog. + int? NetCoreNetdevMaxBacklog { get; set; } + /// Sysctl setting net.core.optmem_max. + int? NetCoreOptmemMax { get; set; } + /// Sysctl setting net.core.rmem_default. + int? NetCoreRmemDefault { get; set; } + /// Sysctl setting net.core.rmem_max. + int? NetCoreRmemMax { get; set; } + /// Sysctl setting net.core.somaxconn. + int? NetCoreSomaxconn { get; set; } + /// Sysctl setting net.core.wmem_default. + int? NetCoreWmemDefault { get; set; } + /// Sysctl setting net.core.wmem_max. + int? NetCoreWmemMax { get; set; } + /// Sysctl setting net.ipv4.ip_local_port_range. + string NetIpv4IPLocalPortRange { get; set; } + /// Sysctl setting net.ipv4.neigh.default.gc_thresh1. + int? NetIpv4NeighDefaultGcThresh1 { get; set; } + /// Sysctl setting net.ipv4.neigh.default.gc_thresh2. + int? NetIpv4NeighDefaultGcThresh2 { get; set; } + /// Sysctl setting net.ipv4.neigh.default.gc_thresh3. + int? NetIpv4NeighDefaultGcThresh3 { get; set; } + /// Sysctl setting net.ipv4.tcp_fin_timeout. + int? NetIpv4TcpFinTimeout { get; set; } + /// Sysctl setting net.ipv4.tcp_keepalive_probes. + int? NetIpv4TcpKeepaliveProbe { get; set; } + /// Sysctl setting net.ipv4.tcp_keepalive_time. + int? NetIpv4TcpKeepaliveTime { get; set; } + /// Sysctl setting net.ipv4.tcp_max_syn_backlog. + int? NetIpv4TcpMaxSynBacklog { get; set; } + /// Sysctl setting net.ipv4.tcp_max_tw_buckets. + int? NetIpv4TcpMaxTwBucket { get; set; } + /// Sysctl setting net.ipv4.tcp_tw_reuse. + bool? NetIpv4TcpTwReuse { get; set; } + /// Sysctl setting net.ipv4.tcp_keepalive_intvl. + int? NetIpv4TcpkeepaliveIntvl { get; set; } + /// Sysctl setting net.netfilter.nf_conntrack_buckets. + int? NetNetfilterNfConntrackBucket { get; set; } + /// Sysctl setting net.netfilter.nf_conntrack_max. + int? NetNetfilterNfConntrackMax { get; set; } + /// Sysctl setting vm.max_map_count. + int? VMMaxMapCount { get; set; } + /// Sysctl setting vm.swappiness. + int? VMSwappiness { get; set; } + /// Sysctl setting vm.vfs_cache_pressure. + int? VMVfsCachePressure { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.json.cs new file mode 100644 index 000000000000..b00606635c42 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/SysctlConfig.json.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Sysctl settings for Linux agent nodes. + public partial class SysctlConfig + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new SysctlConfig(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal SysctlConfig(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_netCoreSomaxconn = If( json?.PropertyT("netCoreSomaxconn"), out var __jsonNetCoreSomaxconn) ? (int?)__jsonNetCoreSomaxconn : NetCoreSomaxconn;} + {_netCoreNetdevMaxBacklog = If( json?.PropertyT("netCoreNetdevMaxBacklog"), out var __jsonNetCoreNetdevMaxBacklog) ? (int?)__jsonNetCoreNetdevMaxBacklog : NetCoreNetdevMaxBacklog;} + {_netCoreRmemDefault = If( json?.PropertyT("netCoreRmemDefault"), out var __jsonNetCoreRmemDefault) ? (int?)__jsonNetCoreRmemDefault : NetCoreRmemDefault;} + {_netCoreRmemMax = If( json?.PropertyT("netCoreRmemMax"), out var __jsonNetCoreRmemMax) ? (int?)__jsonNetCoreRmemMax : NetCoreRmemMax;} + {_netCoreWmemDefault = If( json?.PropertyT("netCoreWmemDefault"), out var __jsonNetCoreWmemDefault) ? (int?)__jsonNetCoreWmemDefault : NetCoreWmemDefault;} + {_netCoreWmemMax = If( json?.PropertyT("netCoreWmemMax"), out var __jsonNetCoreWmemMax) ? (int?)__jsonNetCoreWmemMax : NetCoreWmemMax;} + {_netCoreOptmemMax = If( json?.PropertyT("netCoreOptmemMax"), out var __jsonNetCoreOptmemMax) ? (int?)__jsonNetCoreOptmemMax : NetCoreOptmemMax;} + {_netIpv4TcpMaxSynBacklog = If( json?.PropertyT("netIpv4TcpMaxSynBacklog"), out var __jsonNetIpv4TcpMaxSynBacklog) ? (int?)__jsonNetIpv4TcpMaxSynBacklog : NetIpv4TcpMaxSynBacklog;} + {_netIpv4TcpMaxTwBucket = If( json?.PropertyT("netIpv4TcpMaxTwBuckets"), out var __jsonNetIpv4TcpMaxTwBuckets) ? (int?)__jsonNetIpv4TcpMaxTwBuckets : NetIpv4TcpMaxTwBucket;} + {_netIpv4TcpFinTimeout = If( json?.PropertyT("netIpv4TcpFinTimeout"), out var __jsonNetIpv4TcpFinTimeout) ? (int?)__jsonNetIpv4TcpFinTimeout : NetIpv4TcpFinTimeout;} + {_netIpv4TcpKeepaliveTime = If( json?.PropertyT("netIpv4TcpKeepaliveTime"), out var __jsonNetIpv4TcpKeepaliveTime) ? (int?)__jsonNetIpv4TcpKeepaliveTime : NetIpv4TcpKeepaliveTime;} + {_netIpv4TcpKeepaliveProbe = If( json?.PropertyT("netIpv4TcpKeepaliveProbes"), out var __jsonNetIpv4TcpKeepaliveProbes) ? (int?)__jsonNetIpv4TcpKeepaliveProbes : NetIpv4TcpKeepaliveProbe;} + {_netIpv4TcpkeepaliveIntvl = If( json?.PropertyT("netIpv4TcpkeepaliveIntvl"), out var __jsonNetIpv4TcpkeepaliveIntvl) ? (int?)__jsonNetIpv4TcpkeepaliveIntvl : NetIpv4TcpkeepaliveIntvl;} + {_netIpv4TcpTwReuse = If( json?.PropertyT("netIpv4TcpTwReuse"), out var __jsonNetIpv4TcpTwReuse) ? (bool?)__jsonNetIpv4TcpTwReuse : NetIpv4TcpTwReuse;} + {_netIpv4IPLocalPortRange = If( json?.PropertyT("netIpv4IpLocalPortRange"), out var __jsonNetIpv4IPLocalPortRange) ? (string)__jsonNetIpv4IPLocalPortRange : (string)NetIpv4IPLocalPortRange;} + {_netIpv4NeighDefaultGcThresh1 = If( json?.PropertyT("netIpv4NeighDefaultGcThresh1"), out var __jsonNetIpv4NeighDefaultGcThresh1) ? (int?)__jsonNetIpv4NeighDefaultGcThresh1 : NetIpv4NeighDefaultGcThresh1;} + {_netIpv4NeighDefaultGcThresh2 = If( json?.PropertyT("netIpv4NeighDefaultGcThresh2"), out var __jsonNetIpv4NeighDefaultGcThresh2) ? (int?)__jsonNetIpv4NeighDefaultGcThresh2 : NetIpv4NeighDefaultGcThresh2;} + {_netIpv4NeighDefaultGcThresh3 = If( json?.PropertyT("netIpv4NeighDefaultGcThresh3"), out var __jsonNetIpv4NeighDefaultGcThresh3) ? (int?)__jsonNetIpv4NeighDefaultGcThresh3 : NetIpv4NeighDefaultGcThresh3;} + {_netNetfilterNfConntrackMax = If( json?.PropertyT("netNetfilterNfConntrackMax"), out var __jsonNetNetfilterNfConntrackMax) ? (int?)__jsonNetNetfilterNfConntrackMax : NetNetfilterNfConntrackMax;} + {_netNetfilterNfConntrackBucket = If( json?.PropertyT("netNetfilterNfConntrackBuckets"), out var __jsonNetNetfilterNfConntrackBuckets) ? (int?)__jsonNetNetfilterNfConntrackBuckets : NetNetfilterNfConntrackBucket;} + {_fsInotifyMaxUserWatch = If( json?.PropertyT("fsInotifyMaxUserWatches"), out var __jsonFsInotifyMaxUserWatches) ? (int?)__jsonFsInotifyMaxUserWatches : FsInotifyMaxUserWatch;} + {_fsFileMax = If( json?.PropertyT("fsFileMax"), out var __jsonFsFileMax) ? (int?)__jsonFsFileMax : FsFileMax;} + {_fsAioMaxNr = If( json?.PropertyT("fsAioMaxNr"), out var __jsonFsAioMaxNr) ? (int?)__jsonFsAioMaxNr : FsAioMaxNr;} + {_fsNrOpen = If( json?.PropertyT("fsNrOpen"), out var __jsonFsNrOpen) ? (int?)__jsonFsNrOpen : FsNrOpen;} + {_kernelThreadsMax = If( json?.PropertyT("kernelThreadsMax"), out var __jsonKernelThreadsMax) ? (int?)__jsonKernelThreadsMax : KernelThreadsMax;} + {_vMMaxMapCount = If( json?.PropertyT("vmMaxMapCount"), out var __jsonVMMaxMapCount) ? (int?)__jsonVMMaxMapCount : VMMaxMapCount;} + {_vMSwappiness = If( json?.PropertyT("vmSwappiness"), out var __jsonVMSwappiness) ? (int?)__jsonVMSwappiness : VMSwappiness;} + {_vMVfsCachePressure = If( json?.PropertyT("vmVfsCachePressure"), out var __jsonVMVfsCachePressure) ? (int?)__jsonVMVfsCachePressure : VMVfsCachePressure;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._netCoreSomaxconn ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netCoreSomaxconn) : null, "netCoreSomaxconn" ,container.Add ); + AddIf( null != this._netCoreNetdevMaxBacklog ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netCoreNetdevMaxBacklog) : null, "netCoreNetdevMaxBacklog" ,container.Add ); + AddIf( null != this._netCoreRmemDefault ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netCoreRmemDefault) : null, "netCoreRmemDefault" ,container.Add ); + AddIf( null != this._netCoreRmemMax ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netCoreRmemMax) : null, "netCoreRmemMax" ,container.Add ); + AddIf( null != this._netCoreWmemDefault ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netCoreWmemDefault) : null, "netCoreWmemDefault" ,container.Add ); + AddIf( null != this._netCoreWmemMax ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netCoreWmemMax) : null, "netCoreWmemMax" ,container.Add ); + AddIf( null != this._netCoreOptmemMax ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netCoreOptmemMax) : null, "netCoreOptmemMax" ,container.Add ); + AddIf( null != this._netIpv4TcpMaxSynBacklog ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netIpv4TcpMaxSynBacklog) : null, "netIpv4TcpMaxSynBacklog" ,container.Add ); + AddIf( null != this._netIpv4TcpMaxTwBucket ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netIpv4TcpMaxTwBucket) : null, "netIpv4TcpMaxTwBuckets" ,container.Add ); + AddIf( null != this._netIpv4TcpFinTimeout ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netIpv4TcpFinTimeout) : null, "netIpv4TcpFinTimeout" ,container.Add ); + AddIf( null != this._netIpv4TcpKeepaliveTime ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netIpv4TcpKeepaliveTime) : null, "netIpv4TcpKeepaliveTime" ,container.Add ); + AddIf( null != this._netIpv4TcpKeepaliveProbe ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netIpv4TcpKeepaliveProbe) : null, "netIpv4TcpKeepaliveProbes" ,container.Add ); + AddIf( null != this._netIpv4TcpkeepaliveIntvl ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netIpv4TcpkeepaliveIntvl) : null, "netIpv4TcpkeepaliveIntvl" ,container.Add ); + AddIf( null != this._netIpv4TcpTwReuse ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._netIpv4TcpTwReuse) : null, "netIpv4TcpTwReuse" ,container.Add ); + AddIf( null != (((object)this._netIpv4IPLocalPortRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._netIpv4IPLocalPortRange.ToString()) : null, "netIpv4IpLocalPortRange" ,container.Add ); + AddIf( null != this._netIpv4NeighDefaultGcThresh1 ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netIpv4NeighDefaultGcThresh1) : null, "netIpv4NeighDefaultGcThresh1" ,container.Add ); + AddIf( null != this._netIpv4NeighDefaultGcThresh2 ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netIpv4NeighDefaultGcThresh2) : null, "netIpv4NeighDefaultGcThresh2" ,container.Add ); + AddIf( null != this._netIpv4NeighDefaultGcThresh3 ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netIpv4NeighDefaultGcThresh3) : null, "netIpv4NeighDefaultGcThresh3" ,container.Add ); + AddIf( null != this._netNetfilterNfConntrackMax ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netNetfilterNfConntrackMax) : null, "netNetfilterNfConntrackMax" ,container.Add ); + AddIf( null != this._netNetfilterNfConntrackBucket ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._netNetfilterNfConntrackBucket) : null, "netNetfilterNfConntrackBuckets" ,container.Add ); + AddIf( null != this._fsInotifyMaxUserWatch ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._fsInotifyMaxUserWatch) : null, "fsInotifyMaxUserWatches" ,container.Add ); + AddIf( null != this._fsFileMax ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._fsFileMax) : null, "fsFileMax" ,container.Add ); + AddIf( null != this._fsAioMaxNr ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._fsAioMaxNr) : null, "fsAioMaxNr" ,container.Add ); + AddIf( null != this._fsNrOpen ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._fsNrOpen) : null, "fsNrOpen" ,container.Add ); + AddIf( null != this._kernelThreadsMax ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._kernelThreadsMax) : null, "kernelThreadsMax" ,container.Add ); + AddIf( null != this._vMMaxMapCount ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._vMMaxMapCount) : null, "vmMaxMapCount" ,container.Add ); + AddIf( null != this._vMSwappiness ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._vMSwappiness) : null, "vmSwappiness" ,container.Add ); + AddIf( null != this._vMVfsCachePressure ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._vMVfsCachePressure) : null, "vmVfsCachePressure" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.PowerShell.cs new file mode 100644 index 000000000000..e4ee8ef4730a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Tags object for patch operations. + [System.ComponentModel.TypeConverter(typeof(TagsObjectTypeConverter))] + public partial class TagsObject + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TagsObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TagsObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TagsObject(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.ContainerService.Models.Api20240402Preview.ITagsObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObjectTagsTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TagsObject(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.ContainerService.Models.Api20240402Preview.ITagsObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObjectTagsTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Tags object for patch operations. + [System.ComponentModel.TypeConverter(typeof(TagsObjectTypeConverter))] + public partial interface ITagsObject + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.TypeConverter.cs new file mode 100644 index 000000000000..2adb3b22c22a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TagsObjectTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITagsObject ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TagsObject.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TagsObject.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TagsObject.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.cs new file mode 100644 index 000000000000..63ad6be907f5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Tags object for patch operations. + public partial class TagsObject : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObjectTags()); set => this._tag = value; } + + /// Creates an new instance. + public TagsObject() + { + + } + } + /// Tags object for patch operations. + public partial interface ITagsObject : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags Tag { get; set; } + + } + /// Tags object for patch operations. + internal partial interface ITagsObjectInternal + + { + /// Resource tags. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.json.cs new file mode 100644 index 000000000000..9f12c8b89ca3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObject.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Tags object for patch operations. + public partial class TagsObject + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TagsObject(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TagsObject(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObjectTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.PowerShell.cs new file mode 100644 index 000000000000..a1bf1db76145 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TagsObjectTagsTypeConverter))] + public partial class TagsObjectTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TagsObjectTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TagsObjectTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TagsObjectTags(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 TagsObjectTags(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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TagsObjectTagsTypeConverter))] + public partial interface ITagsObjectTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.TypeConverter.cs new file mode 100644 index 000000000000..730c30e3d35f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TagsObjectTagsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITagsObjectTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TagsObjectTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TagsObjectTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TagsObjectTags.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.cs new file mode 100644 index 000000000000..a0b24bebe818 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Resource tags. + public partial class TagsObjectTags : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTagsInternal + { + + /// Creates an new instance. + public TagsObjectTags() + { + + } + } + /// Resource tags. + public partial interface ITagsObjectTags : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITagsObjectTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.dictionary.cs new file mode 100644 index 000000000000..8aed60b9d340 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class TagsObjectTags : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.TagsObjectTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.json.cs new file mode 100644 index 000000000000..9d13d3387a5c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TagsObjectTags.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Resource tags. + public partial class TagsObjectTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TagsObjectTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TagsObjectTags(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.PowerShell.cs new file mode 100644 index 000000000000..6e11c00c5733 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Time in a week. + [System.ComponentModel.TypeConverter(typeof(TimeInWeekTypeConverter))] + public partial class TimeInWeek + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TimeInWeek(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TimeInWeek(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TimeInWeek(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeekInternal)this).Day = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeekInternal)this).Day, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("HourSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeekInternal)this).HourSlot = (int[]) content.GetValueForProperty("HourSlot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeekInternal)this).HourSlot, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TimeInWeek(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeekInternal)this).Day = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeekInternal)this).Day, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + if (content.Contains("HourSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeekInternal)this).HourSlot = (int[]) content.GetValueForProperty("HourSlot",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeekInternal)this).HourSlot, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Time in a week. + [System.ComponentModel.TypeConverter(typeof(TimeInWeekTypeConverter))] + public partial interface ITimeInWeek + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.TypeConverter.cs new file mode 100644 index 000000000000..1590d931e72c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TimeInWeekTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITimeInWeek ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TimeInWeek.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TimeInWeek.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TimeInWeek.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.cs new file mode 100644 index 000000000000..2c6e00bcffea --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Time in a week. + public partial class TimeInWeek : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeekInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? _day; + + /// The day of the week. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? Day { get => this._day; set => this._day = value; } + + /// Backing field for property. + private int[] _hourSlot; + + /// + /// Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds + /// to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int[] HourSlot { get => this._hourSlot; set => this._hourSlot = value; } + + /// Creates an new instance. + public TimeInWeek() + { + + } + } + /// Time in a week. + public partial interface ITimeInWeek : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The day of the week. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The day of the week.", + SerializedName = @"day", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? Day { get; set; } + /// + /// Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds + /// to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range.", + SerializedName = @"hourSlots", + PossibleTypes = new [] { typeof(int) })] + int[] HourSlot { get; set; } + + } + /// Time in a week. + internal partial interface ITimeInWeekInternal + + { + /// The day of the week. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay? Day { get; set; } + /// + /// Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds + /// to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + /// + int[] HourSlot { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.json.cs new file mode 100644 index 000000000000..665ee8a26116 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeInWeek.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Time in a week. + public partial class TimeInWeek + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TimeInWeek(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TimeInWeek(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_day = If( json?.PropertyT("day"), out var __jsonDay) ? (string)__jsonDay : (string)Day;} + {_hourSlot = If( json?.PropertyT("hourSlots"), out var __jsonHourSlots) ? If( __jsonHourSlots as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(int) (__u is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber __t ? (int)__t : default(int))) ))() : null : HourSlot;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._day)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._day.ToString()) : null, "day" ,container.Add ); + if (null != this._hourSlot) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._hourSlot ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber(__x) ,__w.Add); + } + container.Add("hourSlots",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.PowerShell.cs new file mode 100644 index 000000000000..3f6a6920c4cf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.PowerShell.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + [System.ComponentModel.TypeConverter(typeof(TimeSpanTypeConverter))] + public partial class TimeSpan + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TimeSpan(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TimeSpan(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TimeSpan(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpanInternal)this).Start = (global::System.DateTime?) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpanInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("End")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpanInternal)this).End = (global::System.DateTime?) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpanInternal)this).End, (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 TimeSpan(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Start")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpanInternal)this).Start = (global::System.DateTime?) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpanInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("End")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpanInternal)this).End = (global::System.DateTime?) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpanInternal)this).End, (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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + [System.ComponentModel.TypeConverter(typeof(TimeSpanTypeConverter))] + public partial interface ITimeSpan + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.TypeConverter.cs new file mode 100644 index 000000000000..c63e90870588 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TimeSpanTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITimeSpan ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TimeSpan.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TimeSpan.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TimeSpan.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.cs new file mode 100644 index 000000000000..f3f0f345f00e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + public partial class TimeSpan : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpanInternal + { + + /// Backing field for property. + private global::System.DateTime? _end; + + /// The end of a time span + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime? End { get => this._end; set => this._end = value; } + + /// Backing field for property. + private global::System.DateTime? _start; + + /// The start of a time span + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime? Start { get => this._start; set => this._start = value; } + + /// Creates an new instance. + public TimeSpan() + { + + } + } + /// For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + public partial interface ITimeSpan : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The end of a time span + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end of a time span", + SerializedName = @"end", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? End { get; set; } + /// The start of a time span + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start of a time span", + SerializedName = @"start", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Start { get; set; } + + } + /// For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + internal partial interface ITimeSpanInternal + + { + /// The end of a time span + global::System.DateTime? End { get; set; } + /// The start of a time span + global::System.DateTime? Start { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.json.cs new file mode 100644 index 000000000000..fd16b6e12929 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TimeSpan.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + public partial class TimeSpan + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TimeSpan(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TimeSpan(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_start = If( json?.PropertyT("start"), out var __jsonStart) ? global::System.DateTime.TryParse((string)__jsonStart, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartValue) ? __jsonStartValue : Start : Start;} + {_end = If( json?.PropertyT("end"), out var __jsonEnd) ? global::System.DateTime.TryParse((string)__jsonEnd, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndValue) ? __jsonEndValue : End : End;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._start ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._start?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "start" ,container.Add ); + AddIf( null != this._end ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._end?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "end" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.PowerShell.cs new file mode 100644 index 000000000000..ff3258443a6d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Trusted access role definition. + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleTypeConverter))] + public partial class TrustedAccessRole + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrustedAccessRole(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrustedAccessRole(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrustedAccessRole(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).SourceResourceType = (string) content.GetValueForProperty("SourceResourceType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).SourceResourceType, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrustedAccessRole(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SourceResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).SourceResourceType = (string) content.GetValueForProperty("SourceResourceType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).SourceResourceType, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// Trusted access role definition. + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleTypeConverter))] + public partial interface ITrustedAccessRole + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.TypeConverter.cs new file mode 100644 index 000000000000..eac473e3770b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrustedAccessRoleTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRole ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrustedAccessRole.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrustedAccessRole.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrustedAccessRole.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.cs new file mode 100644 index 000000000000..2bba3f82854e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Trusted access role definition. + public partial class TrustedAccessRole : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Rule + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal.Rule { get => this._rule; set { {_rule = value;} } } + + /// Internal Acessors for SourceResourceType + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleInternal.SourceResourceType { get => this._sourceResourceType; set { {_sourceResourceType = value;} } } + + /// Backing field for property. + private string _name; + + /// Name of role, name is unique under a source resource type + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule[] _rule; + + /// + /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule[] Rule { get => this._rule; } + + /// Backing field for property. + private string _sourceResourceType; + + /// Resource type of Azure resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string SourceResourceType { get => this._sourceResourceType; } + + /// Creates an new instance. + public TrustedAccessRole() + { + + } + } + /// Trusted access role definition. + public partial interface ITrustedAccessRole : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Name of role, name is unique under a source resource type + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of role, name is unique under a source resource type", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// + /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole). + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole).", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule[] Rule { get; } + /// Resource type of Azure resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource type of Azure resource", + SerializedName = @"sourceResourceType", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceType { get; } + + } + /// Trusted access role definition. + internal partial interface ITrustedAccessRoleInternal + + { + /// Name of role, name is unique under a source resource type + string Name { get; set; } + /// + /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole). + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule[] Rule { get; set; } + /// Resource type of Azure resource + string SourceResourceType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.json.cs new file mode 100644 index 000000000000..3818951ce65b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRole.json.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Trusted access role definition. + public partial class TrustedAccessRole + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TrustedAccessRole(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sourceResourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._sourceResourceType.ToString()) : null, "sourceResourceType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._rule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._rule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("rules",__w); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TrustedAccessRole(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sourceResourceType = If( json?.PropertyT("sourceResourceType"), out var __jsonSourceResourceType) ? (string)__jsonSourceResourceType : (string)SourceResourceType;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleRule.FromJson(__u) )) ))() : null : Rule;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.PowerShell.cs new file mode 100644 index 000000000000..075c0deb544d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.PowerShell.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Defines binding between a resource and role + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleBindingTypeConverter))] + public partial class TrustedAccessRoleBinding + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrustedAccessRoleBinding(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrustedAccessRoleBinding(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrustedAccessRoleBinding(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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("Role")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).Role, __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 TrustedAccessRoleBinding(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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("Role")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + } + /// Defines binding between a resource and role + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleBindingTypeConverter))] + public partial interface ITrustedAccessRoleBinding + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.TypeConverter.cs new file mode 100644 index 000000000000..61d6b6b3bf3a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrustedAccessRoleBindingTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrustedAccessRoleBinding.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrustedAccessRoleBinding.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrustedAccessRoleBinding.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.cs new file mode 100644 index 000000000000..1751a35905be --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Defines binding between a resource and role + public partial class TrustedAccessRoleBinding : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties _property; + + /// Properties for trusted access role binding + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingProperties()); set => this._property = value; } + + /// The current provisioning state of trusted access role binding. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)Property).ProvisioningState; } + + /// + /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string[] Role { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)Property).Role; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)Property).Role = value ; } + + /// The ARM resource ID of source resource that trusted access is configured for. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string SourceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)Property).SourceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)Property).SourceResourceId = value ; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public TrustedAccessRoleBinding() + { + + } + + /// 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.ContainerService.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Defines binding between a resource and role + public partial interface ITrustedAccessRoleBinding : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource + { + /// The current provisioning state of trusted access role binding. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state of trusted access role binding.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState? ProvisioningState { get; } + /// + /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'.", + SerializedName = @"roles", + PossibleTypes = new [] { typeof(string) })] + string[] Role { get; set; } + /// The ARM resource ID of source resource that trusted access is configured for. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ARM resource ID of source resource that trusted access is configured for.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + + } + /// Defines binding between a resource and role + internal partial interface ITrustedAccessRoleBindingInternal : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal + { + /// Properties for trusted access role binding + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties Property { get; set; } + /// The current provisioning state of trusted access role binding. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState? ProvisioningState { get; set; } + /// + /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + /// + string[] Role { get; set; } + /// The ARM resource ID of source resource that trusted access is configured for. + string SourceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.json.cs new file mode 100644 index 000000000000..029ab74c9f1a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBinding.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Defines binding between a resource and role + public partial class TrustedAccessRoleBinding + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TrustedAccessRoleBinding(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TrustedAccessRoleBinding(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.PowerShell.cs new file mode 100644 index 000000000000..4a82b6001783 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// List of trusted access role bindings + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleBindingListResultTypeConverter))] + public partial class TrustedAccessRoleBindingListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrustedAccessRoleBindingListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrustedAccessRoleBindingListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrustedAccessRoleBindingListResult(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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal)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 TrustedAccessRoleBindingListResult(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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBindingTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// List of trusted access role bindings + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleBindingListResultTypeConverter))] + public partial interface ITrustedAccessRoleBindingListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.TypeConverter.cs new file mode 100644 index 000000000000..9c33cb9a54bb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrustedAccessRoleBindingListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrustedAccessRoleBindingListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrustedAccessRoleBindingListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrustedAccessRoleBindingListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.cs new file mode 100644 index 000000000000..21e192d544c2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// List of trusted access role bindings + public partial class TrustedAccessRoleBindingListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to next page of resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding[] _value; + + /// Role binding list + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TrustedAccessRoleBindingListResult() + { + + } + } + /// List of trusted access role bindings + public partial interface ITrustedAccessRoleBindingListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Link to next page of resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to next page of resources.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Role binding list + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Role binding list", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding[] Value { get; set; } + + } + /// List of trusted access role bindings + internal partial interface ITrustedAccessRoleBindingListResultInternal + + { + /// Link to next page of resources. + string NextLink { get; set; } + /// Role binding list + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.json.cs new file mode 100644 index 000000000000..00e242dcc7e5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingListResult.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// List of trusted access role bindings + public partial class TrustedAccessRoleBindingListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TrustedAccessRoleBindingListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TrustedAccessRoleBindingListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBinding.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.PowerShell.cs new file mode 100644 index 000000000000..402fd16efeea --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Properties for trusted access role binding + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleBindingPropertiesTypeConverter))] + public partial class TrustedAccessRoleBindingProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrustedAccessRoleBindingProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrustedAccessRoleBindingProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrustedAccessRoleBindingProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("Role")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).Role, __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 TrustedAccessRoleBindingProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState.CreateFrom); + } + if (content.Contains("SourceResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).SourceResourceId = (string) content.GetValueForProperty("SourceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).SourceResourceId, global::System.Convert.ToString); + } + if (content.Contains("Role")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).Role = (string[]) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal)this).Role, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + } + /// Properties for trusted access role binding + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleBindingPropertiesTypeConverter))] + public partial interface ITrustedAccessRoleBindingProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.TypeConverter.cs new file mode 100644 index 000000000000..81771a669f63 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.TypeConverter.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrustedAccessRoleBindingPropertiesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrustedAccessRoleBindingProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrustedAccessRoleBindingProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrustedAccessRoleBindingProperties.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.cs new file mode 100644 index 000000000000..c973e523c94f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties for trusted access role binding + public partial class TrustedAccessRoleBindingProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal + { + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState? _provisioningState; + + /// The current provisioning state of trusted access role binding. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string[] _role; + + /// + /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Role { get => this._role; set => this._role = value; } + + /// Backing field for property. + private string _sourceResourceId; + + /// The ARM resource ID of source resource that trusted access is configured for. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string SourceResourceId { get => this._sourceResourceId; set => this._sourceResourceId = value; } + + /// Creates an new instance. + public TrustedAccessRoleBindingProperties() + { + + } + } + /// Properties for trusted access role binding + public partial interface ITrustedAccessRoleBindingProperties : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The current provisioning state of trusted access role binding. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The current provisioning state of trusted access role binding.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState? ProvisioningState { get; } + /// + /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'.", + SerializedName = @"roles", + PossibleTypes = new [] { typeof(string) })] + string[] Role { get; set; } + /// The ARM resource ID of source resource that trusted access is configured for. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ARM resource ID of source resource that trusted access is configured for.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + string SourceResourceId { get; set; } + + } + /// Properties for trusted access role binding + internal partial interface ITrustedAccessRoleBindingPropertiesInternal + + { + /// The current provisioning state of trusted access role binding. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState? ProvisioningState { get; set; } + /// + /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + /// + string[] Role { get; set; } + /// The ARM resource ID of source resource that trusted access is configured for. + string SourceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.json.cs new file mode 100644 index 000000000000..a640f205fd50 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleBindingProperties.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Properties for trusted access role binding + public partial class TrustedAccessRoleBindingProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TrustedAccessRoleBindingProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AddIf( null != (((object)this._sourceResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._sourceResourceId.ToString()) : null, "sourceResourceId" ,container.Add ); + if (null != this._role) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._role ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("roles",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TrustedAccessRoleBindingProperties(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_sourceResourceId = If( json?.PropertyT("sourceResourceId"), out var __jsonSourceResourceId) ? (string)__jsonSourceResourceId : (string)SourceResourceId;} + {_role = If( json?.PropertyT("roles"), out var __jsonRoles) ? If( __jsonRoles as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Role;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.PowerShell.cs new file mode 100644 index 000000000000..53f20652eac0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// List of trusted access roles + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleListResultTypeConverter))] + public partial class TrustedAccessRoleListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrustedAccessRoleListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrustedAccessRoleListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrustedAccessRoleListResult(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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal)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 TrustedAccessRoleListResult(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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// List of trusted access roles + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleListResultTypeConverter))] + public partial interface ITrustedAccessRoleListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.TypeConverter.cs new file mode 100644 index 000000000000..b728b6a7fdca --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrustedAccessRoleListResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrustedAccessRoleListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrustedAccessRoleListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrustedAccessRoleListResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.cs new file mode 100644 index 000000000000..daa7c510f6a0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// List of trusted access roles + public partial class TrustedAccessRoleListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Link to next page of resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole[] _value; + + /// Role list + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole[] Value { get => this._value; } + + /// Creates an new instance. + public TrustedAccessRoleListResult() + { + + } + } + /// List of trusted access roles + public partial interface ITrustedAccessRoleListResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Link to next page of resources. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Link to next page of resources.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Role list + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Role list", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole[] Value { get; } + + } + /// List of trusted access roles + internal partial interface ITrustedAccessRoleListResultInternal + + { + /// Link to next page of resources. + string NextLink { get; set; } + /// Role list + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.json.cs new file mode 100644 index 000000000000..6c2f72d3a67d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleListResult.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// List of trusted access roles + public partial class TrustedAccessRoleListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TrustedAccessRoleListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TrustedAccessRoleListResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRole) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRole.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.PowerShell.cs new file mode 100644 index 000000000000..04211e880bfc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Rule for trusted access role + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleRuleTypeConverter))] + public partial class TrustedAccessRoleRule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrustedAccessRoleRule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrustedAccessRoleRule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrustedAccessRoleRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Verb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).Verb = (string[]) content.GetValueForProperty("Verb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).Verb, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).ApiGroup = (string[]) content.GetValueForProperty("ApiGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).ApiGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).Resource = (string[]) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).Resource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).ResourceName = (string[]) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).ResourceName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NonResourceUrL")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).NonResourceUrL = (string[]) content.GetValueForProperty("NonResourceUrL",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).NonResourceUrL, __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 TrustedAccessRoleRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Verb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).Verb = (string[]) content.GetValueForProperty("Verb",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).Verb, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ApiGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).ApiGroup = (string[]) content.GetValueForProperty("ApiGroup",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).ApiGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).Resource = (string[]) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).Resource, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).ResourceName = (string[]) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).ResourceName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("NonResourceUrL")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).NonResourceUrL = (string[]) content.GetValueForProperty("NonResourceUrL",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal)this).NonResourceUrL, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + } + /// Rule for trusted access role + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleRuleTypeConverter))] + public partial interface ITrustedAccessRoleRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.TypeConverter.cs new file mode 100644 index 000000000000..fb61f23552d5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrustedAccessRoleRuleTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrustedAccessRoleRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrustedAccessRoleRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrustedAccessRoleRule.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.cs new file mode 100644 index 000000000000..b97d3f1fedae --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Rule for trusted access role + public partial class TrustedAccessRoleRule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal + { + + /// Backing field for property. + private string[] _apiGroup; + + /// List of allowed apiGroups + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] ApiGroup { get => this._apiGroup; } + + /// Internal Acessors for ApiGroup + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal.ApiGroup { get => this._apiGroup; set { {_apiGroup = value;} } } + + /// Internal Acessors for NonResourceUrL + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal.NonResourceUrL { get => this._nonResourceUrL; set { {_nonResourceUrL = value;} } } + + /// Internal Acessors for Resource + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal.Resource { get => this._resource; set { {_resource = value;} } } + + /// Internal Acessors for ResourceName + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal.ResourceName { get => this._resourceName; set { {_resourceName = value;} } } + + /// Internal Acessors for Verb + string[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRuleInternal.Verb { get => this._verb; set { {_verb = value;} } } + + /// Backing field for property. + private string[] _nonResourceUrL; + + /// List of allowed nonResourceURLs + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] NonResourceUrL { get => this._nonResourceUrL; } + + /// Backing field for property. + private string[] _resource; + + /// List of allowed resources + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Resource { get => this._resource; } + + /// Backing field for property. + private string[] _resourceName; + + /// List of allowed names + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] ResourceName { get => this._resourceName; } + + /// Backing field for property. + private string[] _verb; + + /// List of allowed verbs + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string[] Verb { get => this._verb; } + + /// Creates an new instance. + public TrustedAccessRoleRule() + { + + } + } + /// Rule for trusted access role + public partial interface ITrustedAccessRoleRule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// List of allowed apiGroups + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of allowed apiGroups", + SerializedName = @"apiGroups", + PossibleTypes = new [] { typeof(string) })] + string[] ApiGroup { get; } + /// List of allowed nonResourceURLs + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of allowed nonResourceURLs", + SerializedName = @"nonResourceURLs", + PossibleTypes = new [] { typeof(string) })] + string[] NonResourceUrL { get; } + /// List of allowed resources + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of allowed resources", + SerializedName = @"resources", + PossibleTypes = new [] { typeof(string) })] + string[] Resource { get; } + /// List of allowed names + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of allowed names", + SerializedName = @"resourceNames", + PossibleTypes = new [] { typeof(string) })] + string[] ResourceName { get; } + /// List of allowed verbs + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of allowed verbs", + SerializedName = @"verbs", + PossibleTypes = new [] { typeof(string) })] + string[] Verb { get; } + + } + /// Rule for trusted access role + internal partial interface ITrustedAccessRoleRuleInternal + + { + /// List of allowed apiGroups + string[] ApiGroup { get; set; } + /// List of allowed nonResourceURLs + string[] NonResourceUrL { get; set; } + /// List of allowed resources + string[] Resource { get; set; } + /// List of allowed names + string[] ResourceName { get; set; } + /// List of allowed verbs + string[] Verb { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.json.cs new file mode 100644 index 000000000000..7d2be018f17e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/TrustedAccessRoleRule.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Rule for trusted access role + public partial class TrustedAccessRoleRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TrustedAccessRoleRule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._verb) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._verb ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("verbs",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._apiGroup) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._apiGroup ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("apiGroups",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._resource) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __n in this._resource ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("resources",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._resourceName) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __i in this._resourceName ) + { + AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__i.ToString()) : null ,__h.Add); + } + container.Add("resourceNames",__h); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._nonResourceUrL) + { + var __c = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __d in this._nonResourceUrL ) + { + AddIf(null != (((object)__d)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(__d.ToString()) : null ,__c.Add); + } + container.Add("nonResourceURLs",__c); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TrustedAccessRoleRule(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_verb = If( json?.PropertyT("verbs"), out var __jsonVerbs) ? If( __jsonVerbs as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Verb;} + {_apiGroup = If( json?.PropertyT("apiGroups"), out var __jsonApiGroups) ? If( __jsonApiGroups as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ApiGroup;} + {_resource = If( json?.PropertyT("resources"), out var __jsonResources) ? If( __jsonResources as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : Resource;} + {_resourceName = If( json?.PropertyT("resourceNames"), out var __jsonResourceNames) ? If( __jsonResourceNames as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : ResourceName;} + {_nonResourceUrL = If( json?.PropertyT("nonResourceURLs"), out var __jsonNonResourceUrLs) ? If( __jsonNonResourceUrLs as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : NonResourceUrL;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.PowerShell.cs new file mode 100644 index 000000000000..5cbf51d8196f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Settings for overrides when upgrading a cluster. + [System.ComponentModel.TypeConverter(typeof(UpgradeOverrideSettingsTypeConverter))] + public partial class UpgradeOverrideSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpgradeOverrideSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpgradeOverrideSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpgradeOverrideSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ForceUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)this).ForceUpgrade = (bool?) content.GetValueForProperty("ForceUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)this).ForceUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Until")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)this).Until = (global::System.DateTime?) content.GetValueForProperty("Until",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)this).Until, (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 UpgradeOverrideSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ForceUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)this).ForceUpgrade = (bool?) content.GetValueForProperty("ForceUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)this).ForceUpgrade, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Until")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)this).Until = (global::System.DateTime?) content.GetValueForProperty("Until",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal)this).Until, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + } + /// Settings for overrides when upgrading a cluster. + [System.ComponentModel.TypeConverter(typeof(UpgradeOverrideSettingsTypeConverter))] + public partial interface IUpgradeOverrideSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.TypeConverter.cs new file mode 100644 index 000000000000..c93f1076d88c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpgradeOverrideSettingsTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UpgradeOverrideSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UpgradeOverrideSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UpgradeOverrideSettings.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.cs new file mode 100644 index 000000000000..804f26da1293 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Settings for overrides when upgrading a cluster. + public partial class UpgradeOverrideSettings : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettingsInternal + { + + /// Backing field for property. + private bool? _forceUpgrade; + + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? ForceUpgrade { get => this._forceUpgrade; set => this._forceUpgrade = value; } + + /// Backing field for property. + private global::System.DateTime? _until; + + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime? Until { get => this._until; set => this._until = value; } + + /// Creates an new instance. + public UpgradeOverrideSettings() + { + + } + } + /// Settings for overrides when upgrading a cluster. + public partial interface IUpgradeOverrideSettings : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution.", + SerializedName = @"forceUpgrade", + PossibleTypes = new [] { typeof(bool) })] + bool? ForceUpgrade { get; set; } + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect.", + SerializedName = @"until", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Until { get; set; } + + } + /// Settings for overrides when upgrading a cluster. + internal partial interface IUpgradeOverrideSettingsInternal + + { + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + bool? ForceUpgrade { get; set; } + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + global::System.DateTime? Until { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.json.cs new file mode 100644 index 000000000000..e6fdfaecbb40 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UpgradeOverrideSettings.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Settings for overrides when upgrading a cluster. + public partial class UpgradeOverrideSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUpgradeOverrideSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new UpgradeOverrideSettings(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._forceUpgrade ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._forceUpgrade) : null, "forceUpgrade" ,container.Add ); + AddIf( null != this._until ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._until?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "until" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal UpgradeOverrideSettings(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_forceUpgrade = If( json?.PropertyT("forceUpgrade"), out var __jsonForceUpgrade) ? (bool?)__jsonForceUpgrade : ForceUpgrade;} + {_until = If( json?.PropertyT("until"), out var __jsonUntil) ? global::System.DateTime.TryParse((string)__jsonUntil, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUntilValue) ? __jsonUntilValue : Until : Until;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.PowerShell.cs new file mode 100644 index 000000000000..e033b61c86bc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Details about a user assigned identity. + [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); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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.ContainerService.Models.Api20240402Preview.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.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// 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("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + } + if (content.Contains("ObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ObjectId, global::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("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + } + if (content.Contains("ObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal)this).ObjectId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Details about a user assigned identity. + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] + public partial interface IUserAssignedIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.TypeConverter.cs new file mode 100644 index 000000000000..3a925f942216 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.cs new file mode 100644 index 000000000000..226691fb2609 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Details about a user assigned identity. + public partial class UserAssignedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentityInternal + { + + /// Backing field for property. + private string _clientId; + + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; set => this._clientId = value; } + + /// Backing field for property. + private string _objectId; + + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ObjectId { get => this._objectId; set => this._objectId = value; } + + /// Backing field for property. + private string _resourceId; + + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Creates an new instance. + public UserAssignedIdentity() + { + + } + } + /// Details about a user assigned identity. + public partial interface IUserAssignedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The client ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The client ID of the user assigned identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; set; } + /// The object ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object ID of the user assigned identity.", + SerializedName = @"objectId", + PossibleTypes = new [] { typeof(string) })] + string ObjectId { get; set; } + /// The resource ID of the user assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the user assigned identity.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + + } + /// Details about a user assigned identity. + internal partial interface IUserAssignedIdentityInternal + + { + /// The client ID of the user assigned identity. + string ClientId { get; set; } + /// The object ID of the user assigned identity. + string ObjectId { get; set; } + /// The resource ID of the user assigned identity. + string ResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.json.cs new file mode 100644 index 000000000000..99170ae6422e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/UserAssignedIdentity.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Details about a user assigned identity. + 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.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IUserAssignedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + AddIf( null != (((object)this._objectId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._objectId.ToString()) : null, "objectId" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal UserAssignedIdentity(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + {_objectId = If( json?.PropertyT("objectId"), out var __jsonObjectId) ? (string)__jsonObjectId : (string)ObjectId;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.PowerShell.cs new file mode 100644 index 000000000000..3bbe8eb2999f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Current status on a group of nodes of the same vm size. + [System.ComponentModel.TypeConverter(typeof(VirtualMachineNodesTypeConverter))] + public partial class VirtualMachineNodes + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualMachineNodes(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualMachineNodes(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VirtualMachineNodes(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodesInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodesInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodesInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodesInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VirtualMachineNodes(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Size")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodesInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodesInternal)this).Size, global::System.Convert.ToString); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodesInternal)this).Count = (int?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodesInternal)this).Count, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + } + /// Current status on a group of nodes of the same vm size. + [System.ComponentModel.TypeConverter(typeof(VirtualMachineNodesTypeConverter))] + public partial interface IVirtualMachineNodes + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.TypeConverter.cs new file mode 100644 index 000000000000..5e9e3b6176a0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VirtualMachineNodesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VirtualMachineNodes.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VirtualMachineNodes.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VirtualMachineNodes.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.cs new file mode 100644 index 000000000000..5e142d637be0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Current status on a group of nodes of the same vm size. + public partial class VirtualMachineNodes : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodesInternal + { + + /// Backing field for property. + private int? _count; + + /// Number of nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int? Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _size; + + /// The VM size of the agents used to host this group of nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Size { get => this._size; set => this._size = value; } + + /// Creates an new instance. + public VirtualMachineNodes() + { + + } + } + /// Current status on a group of nodes of the same vm size. + public partial interface IVirtualMachineNodes : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Number of nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of nodes.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + int? Count { get; set; } + /// The VM size of the agents used to host this group of nodes. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The VM size of the agents used to host this group of nodes.", + SerializedName = @"size", + PossibleTypes = new [] { typeof(string) })] + string Size { get; set; } + + } + /// Current status on a group of nodes of the same vm size. + internal partial interface IVirtualMachineNodesInternal + + { + /// Number of nodes. + int? Count { get; set; } + /// The VM size of the agents used to host this group of nodes. + string Size { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.json.cs new file mode 100644 index 000000000000..12608beab89d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachineNodes.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Current status on a group of nodes of the same vm size. + public partial class VirtualMachineNodes + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new VirtualMachineNodes(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._size)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._size.ToString()) : null, "size" ,container.Add ); + AddIf( null != this._count ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((int)this._count) : null, "count" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal VirtualMachineNodes(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_size = If( json?.PropertyT("size"), out var __jsonSize) ? (string)__jsonSize : (string)Size;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (int?)__jsonCount : Count;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.PowerShell.cs new file mode 100644 index 000000000000..54454a3fea7d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Specifications on VirtualMachines agent pool. + [System.ComponentModel.TypeConverter(typeof(VirtualMachinesProfileTypeConverter))] + public partial class VirtualMachinesProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualMachinesProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualMachinesProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VirtualMachinesProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).Scale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile) content.GetValueForProperty("Scale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).Scale, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ScaleManual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).ScaleManual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("ScaleManual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).ScaleManual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleAutoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).ScaleAutoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("ScaleAutoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).ScaleAutoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VirtualMachinesProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).Scale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile) content.GetValueForProperty("Scale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).Scale, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfileTypeConverter.ConvertFrom); + } + if (content.Contains("ScaleManual")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).ScaleManual = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[]) content.GetValueForProperty("ScaleManual",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).ScaleManual, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManualScaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleAutoscale")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).ScaleAutoscale = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[]) content.GetValueForProperty("ScaleAutoscale",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal)this).ScaleAutoscale, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AutoScaleProfileTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// Specifications on VirtualMachines agent pool. + [System.ComponentModel.TypeConverter(typeof(VirtualMachinesProfileTypeConverter))] + public partial interface IVirtualMachinesProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.TypeConverter.cs new file mode 100644 index 000000000000..4e8605f08bd5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VirtualMachinesProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VirtualMachinesProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VirtualMachinesProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VirtualMachinesProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.cs new file mode 100644 index 000000000000..7abf784fdb6a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifications on VirtualMachines agent pool. + public partial class VirtualMachinesProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal + { + + /// Internal Acessors for Scale + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfileInternal.Scale { get => (this._scale = this._scale ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfile()); set { {_scale = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile _scale; + + /// Specifications on how to scale a VirtualMachines agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile Scale { get => (this._scale = this._scale ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfile()); set => this._scale = value; } + + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)Scale).Autoscale; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)Scale).Autoscale = value ?? null /* arrayOf */; } + + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)Scale).Manual; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfileInternal)Scale).Manual = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public VirtualMachinesProfile() + { + + } + } + /// Specifications on VirtualMachines agent pool. + public partial interface IVirtualMachinesProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed.", + SerializedName = @"autoscale", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get; set; } + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed.", + SerializedName = @"manual", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get; set; } + + } + /// Specifications on VirtualMachines agent pool. + internal partial interface IVirtualMachinesProfileInternal + + { + /// Specifications on how to scale a VirtualMachines agent pool. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IScaleProfile Scale { get; set; } + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get; set; } + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.json.cs new file mode 100644 index 000000000000..5928a6707b3f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/VirtualMachinesProfile.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Specifications on VirtualMachines agent pool. + public partial class VirtualMachinesProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachinesProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new VirtualMachinesProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._scale ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._scale.ToJson(null,serializationMode) : null, "scale" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal VirtualMachinesProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_scale = If( json?.PropertyT("scale"), out var __jsonScale) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ScaleProfile.FromJson(__jsonScale) : Scale;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.PowerShell.cs new file mode 100644 index 000000000000..9b913d67fe77 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + [System.ComponentModel.TypeConverter(typeof(WeeklyScheduleTypeConverter))] + public partial class WeeklySchedule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WeeklySchedule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WeeklySchedule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WeeklySchedule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)this).IntervalWeek = (int) content.GetValueForProperty("IntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)this).IntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)this).DayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("DayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)this).DayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WeeklySchedule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IntervalWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)this).IntervalWeek = (int) content.GetValueForProperty("IntervalWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)this).IntervalWeek, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DayOfWeek")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)this).DayOfWeek = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) content.GetValueForProperty("DayOfWeek",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal)this).DayOfWeek, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay.CreateFrom); + } + AfterDeserializePSObject(content); + } + } + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + [System.ComponentModel.TypeConverter(typeof(WeeklyScheduleTypeConverter))] + public partial interface IWeeklySchedule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.TypeConverter.cs new file mode 100644 index 000000000000..fc325d44d239 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WeeklyScheduleTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IWeeklySchedule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WeeklySchedule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WeeklySchedule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WeeklySchedule.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.cs new file mode 100644 index 000000000000..aad2f65849fe --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + public partial class WeeklySchedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklyScheduleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay _dayOfWeek; + + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay DayOfWeek { get => this._dayOfWeek; set => this._dayOfWeek = value; } + + /// Backing field for property. + private int _intervalWeek; + + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public int IntervalWeek { get => this._intervalWeek; set => this._intervalWeek = value; } + + /// Creates an new instance. + public WeeklySchedule() + { + + } + } + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + public partial interface IWeeklySchedule : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// Specifies on which day of the week the maintenance occurs. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay DayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the number of weeks between each set of occurrences.", + SerializedName = @"intervalWeeks", + PossibleTypes = new [] { typeof(int) })] + int IntervalWeek { get; set; } + + } + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + internal partial interface IWeeklyScheduleInternal + + { + /// Specifies on which day of the week the maintenance occurs. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay DayOfWeek { get; set; } + /// Specifies the number of weeks between each set of occurrences. + int IntervalWeek { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.json.cs new file mode 100644 index 000000000000..c9df99ea3e31 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WeeklySchedule.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + public partial class WeeklySchedule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWeeklySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new WeeklySchedule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber(this._intervalWeek), "intervalWeeks" ,container.Add ); + AddIf( null != (((object)this._dayOfWeek)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._dayOfWeek.ToString()) : null, "dayOfWeek" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal WeeklySchedule(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_intervalWeek = If( json?.PropertyT("intervalWeeks"), out var __jsonIntervalWeeks) ? (int)__jsonIntervalWeeks : IntervalWeek;} + {_dayOfWeek = If( json?.PropertyT("dayOfWeek"), out var __jsonDayOfWeek) ? (string)__jsonDayOfWeek : (string)DayOfWeek;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.PowerShell.cs new file mode 100644 index 000000000000..77f26b168118 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Windows gMSA Profile in the managed cluster. + [System.ComponentModel.TypeConverter(typeof(WindowsGmsaProfileTypeConverter))] + public partial class WindowsGmsaProfile + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WindowsGmsaProfile(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WindowsGmsaProfile(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal WindowsGmsaProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).DnsServer = (string) content.GetValueForProperty("DnsServer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).DnsServer, global::System.Convert.ToString); + } + if (content.Contains("RootDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).RootDomainName = (string) content.GetValueForProperty("RootDomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).RootDomainName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WindowsGmsaProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsServer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).DnsServer = (string) content.GetValueForProperty("DnsServer",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).DnsServer, global::System.Convert.ToString); + } + if (content.Contains("RootDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).RootDomainName = (string) content.GetValueForProperty("RootDomainName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal)this).RootDomainName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Windows gMSA Profile in the managed cluster. + [System.ComponentModel.TypeConverter(typeof(WindowsGmsaProfileTypeConverter))] + public partial interface IWindowsGmsaProfile + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.TypeConverter.cs new file mode 100644 index 000000000000..d774a698b2f5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.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.ContainerService.Models.Api20240402Preview +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WindowsGmsaProfileTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WindowsGmsaProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WindowsGmsaProfile.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WindowsGmsaProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.cs new file mode 100644 index 000000000000..c7a156ecc45d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Windows gMSA Profile in the managed cluster. + public partial class WindowsGmsaProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfileInternal + { + + /// Backing field for property. + private string _dnsServer; + + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string DnsServer { get => this._dnsServer; set => this._dnsServer = value; } + + /// Backing field for property. + private bool? _enabled; + + /// Specifies whether to enable Windows gMSA in the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private string _rootDomainName; + + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string RootDomainName { get => this._rootDomainName; set => this._rootDomainName = value; } + + /// Creates an new instance. + public WindowsGmsaProfile() + { + + } + } + /// Windows gMSA Profile in the managed cluster. + public partial interface IWindowsGmsaProfile : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"dnsServer", + PossibleTypes = new [] { typeof(string) })] + string DnsServer { get; set; } + /// Specifies whether to enable Windows gMSA in the managed cluster. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether to enable Windows gMSA in the managed cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"rootDomainName", + PossibleTypes = new [] { typeof(string) })] + string RootDomainName { get; set; } + + } + /// Windows gMSA Profile in the managed cluster. + internal partial interface IWindowsGmsaProfileInternal + + { + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ string DnsServer { get; set; } + /// Specifies whether to enable Windows gMSA in the managed cluster. + bool? Enabled { get; set; } + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ string RootDomainName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.json.cs new file mode 100644 index 000000000000..4981610d1fc4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api20240402Preview/WindowsGmsaProfile.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.ContainerService.Models.Api20240402Preview +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Windows gMSA Profile in the managed cluster. + public partial class WindowsGmsaProfile + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IWindowsGmsaProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new WindowsGmsaProfile(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != (((object)this._dnsServer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._dnsServer.ToString()) : null, "dnsServer" ,container.Add ); + AddIf( null != (((object)this._rootDomainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._rootDomainName.ToString()) : null, "rootDomainName" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal WindowsGmsaProfile(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_dnsServer = If( json?.PropertyT("dnsServer"), out var __jsonDnsServer) ? (string)__jsonDnsServer : (string)DnsServer;} + {_rootDomainName = If( json?.PropertyT("rootDomainName"), out var __jsonRootDomainName) ? (string)__jsonRootDomainName : (string)RootDomainName;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.PowerShell.cs new file mode 100644 index 000000000000..b44d5d645c3d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// Delegated resource properties - internal use only. + [System.ComponentModel.TypeConverter(typeof(DelegatedResourceTypeConverter))] + public partial class DelegatedResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DelegatedResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("ReferralResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).ReferralResource = (string) content.GetValueForProperty("ReferralResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).ReferralResource, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DelegatedResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("ReferralResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).ReferralResource = (string) content.GetValueForProperty("ReferralResource",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).ReferralResource, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal)this).Location, 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.ContainerService.Models.Api40.IDelegatedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DelegatedResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DelegatedResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Delegated resource properties - internal use only. + [System.ComponentModel.TypeConverter(typeof(DelegatedResourceTypeConverter))] + public partial interface IDelegatedResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.TypeConverter.cs new file mode 100644 index 000000000000..363c4d59aecd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DelegatedResourceTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IDelegatedResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DelegatedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DelegatedResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DelegatedResource.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.cs new file mode 100644 index 000000000000..1165cd89b114 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Delegated resource properties - internal use only. + public partial class DelegatedResource : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResource, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourceInternal + { + + /// Backing field for property. + private string _location; + + /// The source resource location - internal use only. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private string _referralResource; + + /// The delegation id of the referral delegation (optional) - internal use only. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ReferralResource { get => this._referralResource; set => this._referralResource = value; } + + /// Backing field for property. + private string _resourceId; + + /// The ARM resource id of the delegated resource - internal use only. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _tenantId; + + /// The tenant id of the delegated resource - internal use only. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; set => this._tenantId = value; } + + /// Creates an new instance. + public DelegatedResource() + { + + } + } + /// Delegated resource properties - internal use only. + public partial interface IDelegatedResource : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The source resource location - internal use only. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source resource location - internal use only.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// The delegation id of the referral delegation (optional) - internal use only. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The delegation id of the referral delegation (optional) - internal use only.", + SerializedName = @"referralResource", + PossibleTypes = new [] { typeof(string) })] + string ReferralResource { get; set; } + /// The ARM resource id of the delegated resource - internal use only. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ARM resource id of the delegated resource - internal use only.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// The tenant id of the delegated resource - internal use only. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant id of the delegated resource - internal use only.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// Delegated resource properties - internal use only. + internal partial interface IDelegatedResourceInternal + + { + /// The source resource location - internal use only. + string Location { get; set; } + /// The delegation id of the referral delegation (optional) - internal use only. + string ReferralResource { get; set; } + /// The ARM resource id of the delegated resource - internal use only. + string ResourceId { get; set; } + /// The tenant id of the delegated resource - internal use only. + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.json.cs new file mode 100644 index 000000000000..84de7bd5ff43 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResource.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Delegated resource properties - internal use only. + public partial class DelegatedResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal DelegatedResource(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_referralResource = If( json?.PropertyT("referralResource"), out var __jsonReferralResource) ? (string)__jsonReferralResource : (string)ReferralResource;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new DelegatedResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + AddIf( null != (((object)this._referralResource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._referralResource.ToString()) : null, "referralResource" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.PowerShell.cs new file mode 100644 index 000000000000..c887e8b9af8d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// The set of delegated resources. The delegated resources dictionary keys will be source resource internal ids - internal + /// use only. + /// + [System.ComponentModel.TypeConverter(typeof(DelegatedResourcesTypeConverter))] + public partial class DelegatedResources + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DelegatedResources(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 DelegatedResources(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DelegatedResources(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DelegatedResources(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The set of delegated resources. The delegated resources dictionary keys will be source resource internal ids - internal + /// use only. + [System.ComponentModel.TypeConverter(typeof(DelegatedResourcesTypeConverter))] + public partial interface IDelegatedResources + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.TypeConverter.cs new file mode 100644 index 000000000000..9c8b5a2f705f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DelegatedResourcesTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IDelegatedResources ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DelegatedResources.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DelegatedResources.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DelegatedResources.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.cs new file mode 100644 index 000000000000..b296fd10d3bc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// The set of delegated resources. The delegated resources dictionary keys will be source resource internal ids - internal + /// use only. + /// + public partial class DelegatedResources : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResourcesInternal + { + + /// Creates an new instance. + public DelegatedResources() + { + + } + } + /// The set of delegated resources. The delegated resources dictionary keys will be source resource internal ids - internal + /// use only. + public partial interface IDelegatedResources : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// The set of delegated resources. The delegated resources dictionary keys will be source resource internal ids - internal + /// use only. + internal partial interface IDelegatedResourcesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.dictionary.cs new file mode 100644 index 000000000000..94065c24ea08 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class DelegatedResources : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResource this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResource 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.ContainerService.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.ContainerService.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.ContainerService.Models.Api40.IDelegatedResource value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResources source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.json.cs new file mode 100644 index 000000000000..060cf0eb8a23 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/DelegatedResources.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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// The set of delegated resources. The delegated resources dictionary keys will be source resource internal ids - internal + /// use only. + /// + public partial class DelegatedResources + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal DelegatedResources(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.DelegatedResource.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new DelegatedResources(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.PowerShell.cs new file mode 100644 index 000000000000..1a6c3f33d9f8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.PowerShell.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// The resource management error additional info. + [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))] + public partial class ErrorAdditionalInfo + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorAdditionalInfo(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorAdditionalInfo(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.AnyTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Info")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.AnyTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The resource management error additional info. + [System.ComponentModel.TypeConverter(typeof(ErrorAdditionalInfoTypeConverter))] + public partial interface IErrorAdditionalInfo + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.TypeConverter.cs new file mode 100644 index 000000000000..81adb775a2c8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorAdditionalInfoTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorAdditionalInfo.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorAdditionalInfo.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorAdditionalInfo.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..d0ea23d2da63 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The resource management error additional info. + public partial class ErrorAdditionalInfo : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny _info; + + /// The additional info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Any()); } + + /// Internal Acessors for Info + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Any()); set { {_info = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _type; + + /// The additional info type. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ErrorAdditionalInfo() + { + + } + } + /// The resource management error additional info. + public partial interface IErrorAdditionalInfo : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The additional info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The additional info.", + SerializedName = @"info", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny Info { get; } + /// The additional info type. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The additional info type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The resource management error additional info. + internal partial interface IErrorAdditionalInfoInternal + + { + /// The additional info. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IAny Info { get; set; } + /// The additional info type. + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.json.cs new file mode 100644 index 000000000000..e088a48d0dff --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorAdditionalInfo.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The resource management error additional info. + public partial class ErrorAdditionalInfo + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Any.FromJson(__jsonInfo) : Info;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.PowerShell.cs new file mode 100644 index 000000000000..af46df66dcb5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The error detail. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] + public partial interface IErrorDetail + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.TypeConverter.cs new file mode 100644 index 000000000000..a6ca635d385c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorDetailTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorDetail ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorDetail.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorDetail.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.cs new file mode 100644 index 000000000000..3d2929bb92fa --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The error detail. + public partial class ErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] _additionalInfo; + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + + /// Backing field for property. + private string _code; + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] _detail; + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Detail { get => this._detail; } + + /// Backing field for property. + private string _message; + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } + + /// Backing field for property. + private string _target; + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api40.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Detail { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.json.cs new file mode 100644 index 000000000000..7b293b652923 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorDetail.json.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The error detail. + public partial class ErrorDetail + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetail.FromJson(__u) )) ))() : null : Detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ErrorDetail(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._additionalInfo) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __s in this._additionalInfo ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("additionalInfo",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..7597f74d0328 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..5cf2899b9d5b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.cs new file mode 100644 index 000000000000..63cb09fa7221 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal + { + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).AdditionalInfo; } + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Code; } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Detail; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail _error; + + /// The error object. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetail()); set => this._error = value; } + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).AdditionalInfo = value; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Code = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Detail = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetail()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Message = value; } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Target = value; } + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api40.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Detail { get; set; } + /// The error object. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail Error { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ErrorResponse.json.cs new file mode 100644 index 000000000000..06ac40720e9f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.ErrorDetail.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.PowerShell.cs new file mode 100644 index 000000000000..5af008c20a5c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.PowerShell.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IOperationStatusResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).PercentComplete = (float?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).PercentComplete, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Operation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[]) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Operation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResultTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + 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.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).PercentComplete = (float?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).PercentComplete, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Operation = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[]) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Operation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResultTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorAdditionalInfoTypeConverter.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.TypeConverter.cs new file mode 100644 index 000000000000..6c8e83890c05 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationStatusResultTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IOperationStatusResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationStatusResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationStatusResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationStatusResult.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.cs new file mode 100644 index 000000000000..24115dcbd9c8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The current status of an async operation. + public partial class OperationStatusResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal + { + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).AdditionalInfo; } + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Code; } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Detail; } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// The end time of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail _error; + + /// If present, details of the operation error. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetail()); set => this._error = value; } + + /// Backing field for property. + private string _id; + + /// Fully qualified ID for the async operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).AdditionalInfo = value; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Code = value; } + + /// Internal Acessors for Detail + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Detail = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ErrorDetail()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Message = value; } + + /// Internal Acessors for ResourceId + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal.ResourceId { get => this._resourceId; set { {_resourceId = value;} } } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResultInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Target = value; } + + /// Backing field for property. + private string _name; + + /// Name of the async operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[] _operation; + + /// The operations list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[] Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private float? _percentComplete; + + /// Percent of the operation that is complete. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public float? PercentComplete { get => this._percentComplete; set => this._percentComplete = 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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// The start time of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Backing field for property. + private string _status; + + /// Operation status. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetailInternal)Error).Target; } + + /// Creates an new instance. + public OperationStatusResult() + { + + } + } + /// The current status of an async operation. + public partial interface IOperationStatusResult : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorAdditionalInfo[] AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IErrorDetail[] Detail { get; } + /// The end time of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end time of the operation.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; set; } + /// Fully qualified ID for the async operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully qualified ID for the async operation.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the async operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The operations list. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operations list.", + SerializedName = @"operations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult[] Operation { get; set; } + /// Percent of the operation that is complete. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Percent of the operation that is complete.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(float) })] + float? PercentComplete { get; set; } + /// + /// Fully qualified ID of the resource against which the original async operation was started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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; } + /// The start time of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time of the operation.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + /// Operation status. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Models.Api40.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IErrorDetail Error { 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.ContainerService.Models.Api40.IOperationStatusResult[] Operation { get; set; } + /// Percent of the operation that is complete. + float? PercentComplete { get; set; } + /// + /// Fully qualified ID of the resource against which the original async operation was started. + /// + string ResourceId { 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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.json.cs new file mode 100644 index 000000000000..14c576ca1a6c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/OperationStatusResult.json.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// The current status of an async operation. + public partial class OperationStatusResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new OperationStatusResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal OperationStatusResult(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.ErrorDetail.FromJson(__jsonError) : Error;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (float?)__jsonPercentComplete : PercentComplete;} + {_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;} + {_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;} + {_operation = If( json?.PropertyT("operations"), out var __jsonOperations) ? If( __jsonOperations as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IOperationStatusResult) (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.OperationStatusResult.FromJson(__u) )) ))() : null : 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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != this._percentComplete ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNumber((float)this._percentComplete) : null, "percentComplete" ,container.Add ); + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); + if (null != this._operation) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.XNodeArray(); + foreach( var __x in this._operation ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("operations",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.PowerShell.cs new file mode 100644 index 000000000000..a3534c40eb28 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial class ProxyResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProxyResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProxyResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProxyResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProxyResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial interface IProxyResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.TypeConverter.cs new file mode 100644 index 000000000000..a947e91c534e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProxyResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IProxyResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IProxyResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProxyResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProxyResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProxyResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.cs new file mode 100644 index 000000000000..bf4df3ed3d21 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IProxyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.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.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.json.cs new file mode 100644 index 000000000000..1a039f703ede --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/ProxyResource.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + public partial class ProxyResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IProxyResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IProxyResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.PowerShell.cs new file mode 100644 index 000000000000..604509c472c5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.TypeConverter.cs new file mode 100644 index 000000000000..e407706a42c3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.cs new file mode 100644 index 000000000000..577f177be5d5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData _systemData; + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IJsonSerializable + { + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.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.ContainerService.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.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/Resource.json.cs new file mode 100644 index 000000000000..6b3ecbd04144 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.PowerShell.cs new file mode 100644 index 000000000000..1fbd04c0dec4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.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.ContainerService.Models.Api40.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// 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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.TypeConverter.cs new file mode 100644 index 000000000000..7519ce0e8130 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.ISystemData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.cs new file mode 100644 index 000000000000..3652fae09eed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemDataInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdAt; + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? _createdByType; + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? _lastModifiedByType; + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IJsonSerializable + { + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Support.CreatedByType? LastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/SystemData.json.cs new file mode 100644 index 000000000000..b57879ae32cf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new SystemData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); + AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); + AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); + AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); + AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.PowerShell.cs new file mode 100644 index 000000000000..ced3c407c84e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.PowerShell.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.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.ContainerService.Models.Api40.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// 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.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.TypeConverter.cs new file mode 100644 index 000000000000..8f765c4888da --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.ITrackedResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.cs new file mode 100644 index 000000000000..ef7164a199c5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).Name; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemData; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.TrackedResourceTags()); set => this._tag = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.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.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IResource + { + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.IResourceInternal + { + /// The geo-location where the resource lives + string Location { get; set; } + /// Resource tags. + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.json.cs new file mode 100644 index 000000000000..31f1e2232866 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResource.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.Resource(json); + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.PowerShell.cs new file mode 100644 index 000000000000..324480c4336a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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.ContainerService.Models.Api40.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.ContainerService.Models.Api40.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// 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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..4dabc1f4b53e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.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/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.cs new file mode 100644 index 000000000000..baca3859eee7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Resource tags. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.dictionary.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.dictionary.cs new file mode 100644 index 000000000000..eec5bbee96ad --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Models.Api40.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/TrackedResourceTags.json.cs new file mode 100644 index 000000000000..007532791d6c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/Api40/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.ContainerService.Models.Api40 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.PowerShell.cs new file mode 100644 index 000000000000..09171e855b58 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ContainerServiceIdentityTypeConverter))] + public partial class ContainerServiceIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ContainerServiceIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("RoleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).RoleName = (string) content.GetValueForProperty("RoleName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).RoleName, global::System.Convert.ToString); + } + if (content.Contains("CommandId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).CommandId = (string) content.GetValueForProperty("CommandId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).CommandId, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("ConfigName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ConfigName = (string) content.GetValueForProperty("ConfigName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ConfigName, global::System.Convert.ToString); + } + if (content.Contains("AgentPoolName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).AgentPoolName = (string) content.GetValueForProperty("AgentPoolName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).AgentPoolName, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); + } + if (content.Contains("OperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).OperationId, global::System.Convert.ToString); + } + if (content.Contains("TrustedAccessRoleBindingName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).TrustedAccessRoleBindingName = (string) content.GetValueForProperty("TrustedAccessRoleBindingName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).TrustedAccessRoleBindingName, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).LoadBalancerName = (string) content.GetValueForProperty("LoadBalancerName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).LoadBalancerName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ContainerServiceIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ResourceName, global::System.Convert.ToString); + } + if (content.Contains("RoleName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).RoleName = (string) content.GetValueForProperty("RoleName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).RoleName, global::System.Convert.ToString); + } + if (content.Contains("CommandId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).CommandId = (string) content.GetValueForProperty("CommandId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).CommandId, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("ConfigName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ConfigName = (string) content.GetValueForProperty("ConfigName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).ConfigName, global::System.Convert.ToString); + } + if (content.Contains("AgentPoolName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).AgentPoolName = (string) content.GetValueForProperty("AgentPoolName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).AgentPoolName, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); + } + if (content.Contains("OperationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).OperationId = (string) content.GetValueForProperty("OperationId",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).OperationId, global::System.Convert.ToString); + } + if (content.Contains("TrustedAccessRoleBindingName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).TrustedAccessRoleBindingName = (string) content.GetValueForProperty("TrustedAccessRoleBindingName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).TrustedAccessRoleBindingName, global::System.Convert.ToString); + } + if (content.Contains("LoadBalancerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).LoadBalancerName = (string) content.GetValueForProperty("LoadBalancerName",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).LoadBalancerName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal)this).Id, 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.ContainerService.Models.IContainerServiceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerServiceIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerServiceIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ContainerServiceIdentityTypeConverter))] + public partial interface IContainerServiceIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.TypeConverter.cs new file mode 100644 index 000000000000..46f72890ae90 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.TypeConverter.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerServiceIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + // we allow string conversion too. + if (type == typeof(global::System.String)) + { + return true; + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IContainerServiceIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + // support direct string to id type conversion. + if (type == typeof(global::System.String)) + { + return new ContainerServiceIdentity { Id = sourceValue }; + } + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerServiceIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerServiceIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerServiceIdentity.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.cs new file mode 100644 index 000000000000..44ba4a4efe1e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.cs @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ContainerServiceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentityInternal + { + + /// Backing field for property. + private string _agentPoolName; + + /// The name of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string AgentPoolName { get => this._agentPoolName; set => this._agentPoolName = value; } + + /// Backing field for property. + private string _commandId; + + /// Id of the command. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string CommandId { get => this._commandId; set => this._commandId = value; } + + /// Backing field for property. + private string _configName; + + /// The name of the maintenance configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ConfigName { get => this._configName; set => this._configName = value; } + + /// Backing field for property. + private string _id; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private string _loadBalancerName; + + /// The name of the load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string LoadBalancerName { get => this._loadBalancerName; set => this._loadBalancerName = value; } + + /// Backing field for property. + private string _location; + + /// The name of the Azure region. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private string _machineName; + + /// host name of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string MachineName { get => this._machineName; set => this._machineName = value; } + + /// Backing field for property. + private string _mode; + + /// The mode of the mesh. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Mode { get => this._mode; set => this._mode = value; } + + /// Backing field for property. + private string _operationId; + + /// The ID of an ongoing async operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _roleName; + + /// The name of the role for managed cluster accessProfile resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string RoleName { get => this._roleName; set => this._roleName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. The value must be an UUID. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _trustedAccessRoleBindingName; + + /// The name of trusted access role binding. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string TrustedAccessRoleBindingName { get => this._trustedAccessRoleBindingName; set => this._trustedAccessRoleBindingName = value; } + + /// Backing field for property. + private string _version; + + /// Safeguards version + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public ContainerServiceIdentity() + { + + } + } + public partial interface IContainerServiceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable + { + /// The name of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + string AgentPoolName { get; set; } + /// Id of the command. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Id of the command.", + SerializedName = @"commandId", + PossibleTypes = new [] { typeof(string) })] + string CommandId { get; set; } + /// The name of the maintenance configuration. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the maintenance configuration.", + SerializedName = @"configName", + PossibleTypes = new [] { typeof(string) })] + string ConfigName { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// The name of the load balancer. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the load balancer.", + SerializedName = @"loadBalancerName", + PossibleTypes = new [] { typeof(string) })] + string LoadBalancerName { get; set; } + /// The name of the Azure region. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// host name of the machine + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"host name of the machine", + SerializedName = @"machineName", + PossibleTypes = new [] { typeof(string) })] + string MachineName { get; set; } + /// The mode of the mesh. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The mode of the mesh.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(string) })] + string Mode { get; set; } + /// The ID of an ongoing async operation. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of an ongoing async operation.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + string OperationId { get; set; } + /// The name of the private endpoint connection. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the private endpoint connection.", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointConnectionName { get; set; } + /// The name of the resource group. The name is case insensitive. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// The name of the managed cluster resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; set; } + /// The name of the role for managed cluster accessProfile resource. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the role for managed cluster accessProfile resource.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + string RoleName { get; set; } + /// The ID of the target subscription. The value must be an UUID. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// The name of trusted access role binding. + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of trusted access role binding.", + SerializedName = @"trustedAccessRoleBindingName", + PossibleTypes = new [] { typeof(string) })] + string TrustedAccessRoleBindingName { get; set; } + /// Safeguards version + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Safeguards version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + internal partial interface IContainerServiceIdentityInternal + + { + /// The name of the agent pool. + string AgentPoolName { get; set; } + /// Id of the command. + string CommandId { get; set; } + /// The name of the maintenance configuration. + string ConfigName { get; set; } + /// Resource identity path + string Id { get; set; } + /// The name of the load balancer. + string LoadBalancerName { get; set; } + /// The name of the Azure region. + string Location { get; set; } + /// host name of the machine + string MachineName { get; set; } + /// The mode of the mesh. + string Mode { get; set; } + /// The ID of an ongoing async operation. + string OperationId { get; set; } + /// The name of the private endpoint connection. + string PrivateEndpointConnectionName { get; set; } + /// The name of the resource group. The name is case insensitive. + string ResourceGroupName { get; set; } + /// The name of the managed cluster resource. + string ResourceName { get; set; } + /// The name of the role for managed cluster accessProfile resource. + string RoleName { get; set; } + /// The ID of the target subscription. The value must be an UUID. + string SubscriptionId { get; set; } + /// The name of trusted access role binding. + string TrustedAccessRoleBindingName { get; set; } + /// Safeguards version + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.json.cs new file mode 100644 index 000000000000..5c03c084c453 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ContainerServiceIdentity.json.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ContainerServiceIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} + {_roleName = If( json?.PropertyT("roleName"), out var __jsonRoleName) ? (string)__jsonRoleName : (string)RoleName;} + {_commandId = If( json?.PropertyT("commandId"), out var __jsonCommandId) ? (string)__jsonCommandId : (string)CommandId;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} + {_configName = If( json?.PropertyT("configName"), out var __jsonConfigName) ? (string)__jsonConfigName : (string)ConfigName;} + {_agentPoolName = If( json?.PropertyT("agentPoolName"), out var __jsonAgentPoolName) ? (string)__jsonAgentPoolName : (string)AgentPoolName;} + {_machineName = If( json?.PropertyT("machineName"), out var __jsonMachineName) ? (string)__jsonMachineName : (string)MachineName;} + {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)PrivateEndpointConnectionName;} + {_operationId = If( json?.PropertyT("operationId"), out var __jsonOperationId) ? (string)__jsonOperationId : (string)OperationId;} + {_trustedAccessRoleBindingName = If( json?.PropertyT("trustedAccessRoleBindingName"), out var __jsonTrustedAccessRoleBindingName) ? (string)__jsonTrustedAccessRoleBindingName : (string)TrustedAccessRoleBindingName;} + {_loadBalancerName = If( json?.PropertyT("loadBalancerName"), out var __jsonLoadBalancerName) ? (string)__jsonLoadBalancerName : (string)LoadBalancerName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ContainerServiceIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName" ,container.Add ); + AddIf( null != (((object)this._roleName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._roleName.ToString()) : null, "roleName" ,container.Add ); + AddIf( null != (((object)this._commandId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._commandId.ToString()) : null, "commandId" ,container.Add ); + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + AddIf( null != (((object)this._configName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._configName.ToString()) : null, "configName" ,container.Add ); + AddIf( null != (((object)this._agentPoolName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._agentPoolName.ToString()) : null, "agentPoolName" ,container.Add ); + AddIf( null != (((object)this._machineName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._machineName.ToString()) : null, "machineName" ,container.Add ); + AddIf( null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName" ,container.Add ); + AddIf( null != (((object)this._operationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._operationId.ToString()) : null, "operationId" ,container.Add ); + AddIf( null != (((object)this._trustedAccessRoleBindingName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._trustedAccessRoleBindingName.ToString()) : null, "trustedAccessRoleBindingName" ,container.Add ); + AddIf( null != (((object)this._loadBalancerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._loadBalancerName.ToString()) : null, "loadBalancerName" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..ad6f3476e3d1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(LoadBalancersDeleteAcceptedResponseHeadersTypeConverter))] + public partial class LoadBalancersDeleteAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LoadBalancersDeleteAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LoadBalancersDeleteAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LoadBalancersDeleteAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LoadBalancersDeleteAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(LoadBalancersDeleteAcceptedResponseHeadersTypeConverter))] + public partial interface ILoadBalancersDeleteAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..e78eb346b1d8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LoadBalancersDeleteAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LoadBalancersDeleteAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LoadBalancersDeleteAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LoadBalancersDeleteAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..1c245307b1e4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class LoadBalancersDeleteAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public LoadBalancersDeleteAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface ILoadBalancersDeleteAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface ILoadBalancersDeleteAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..95bd604f99b2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/LoadBalancersDeleteAcceptedResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class LoadBalancersDeleteAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ILoadBalancersDeleteAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new LoadBalancersDeleteAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal LoadBalancersDeleteAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..6267a278ea0a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.PowerShell.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersAbortLatestOperationAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersAbortLatestOperationAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersAbortLatestOperationAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersAbortLatestOperationAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersAbortLatestOperationAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("AzureAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation = (string) content.GetValueForProperty("AzureAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersAbortLatestOperationAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("AzureAsyncOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation = (string) content.GetValueForProperty("AzureAsyncOperation",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersAbortLatestOperationAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersAbortLatestOperationAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..d7508dfb7269 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersAbortLatestOperationAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersAbortLatestOperationAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersAbortLatestOperationAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersAbortLatestOperationAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..5779d6fd95da --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersAbortLatestOperationAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _azureAsyncOperation; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string AzureAsyncOperation { get => this._azureAsyncOperation; set => this._azureAsyncOperation = value; } + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersAbortLatestOperationAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + if (headers.TryGetValues("Azure-AsyncOperation", out var __azureAsyncOperationHeader1)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal)this).AzureAsyncOperation = System.Linq.Enumerable.FirstOrDefault(__azureAsyncOperationHeader1) is string __headerAzureAsyncOperationHeader1 ? __headerAzureAsyncOperationHeader1 : (string)null; + } + } + } + public partial interface IManagedClustersAbortLatestOperationAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Azure-AsyncOperation", + PossibleTypes = new [] { typeof(string) })] + string AzureAsyncOperation { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersAbortLatestOperationAcceptedResponseHeadersInternal + + { + string AzureAsyncOperation { get; set; } + + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..a63209dded40 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersAbortLatestOperationAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersAbortLatestOperationAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersAbortLatestOperationAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersAbortLatestOperationAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersAbortLatestOperationAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..a2de32078439 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersDeleteAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersDeleteAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersDeleteAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersDeleteAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersDeleteAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersDeleteAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersDeleteAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersDeleteAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..9ebf8574344c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersDeleteAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersDeleteAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersDeleteAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersDeleteAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..7b66e857794c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersDeleteAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersDeleteAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersDeleteAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersDeleteAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..07c884cab189 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersDeleteAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersDeleteAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersDeleteAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersDeleteAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersDeleteAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..882d58678740 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersGetCommandResultAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersGetCommandResultAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersGetCommandResultAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersGetCommandResultAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersGetCommandResultAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersGetCommandResultAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersGetCommandResultAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersGetCommandResultAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..3aa271e7907e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersGetCommandResultAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersGetCommandResultAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersGetCommandResultAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersGetCommandResultAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..e52906f61301 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersGetCommandResultAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersGetCommandResultAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersGetCommandResultAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersGetCommandResultAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..0630535a56bf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersGetCommandResultAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersGetCommandResultAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersGetCommandResultAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersGetCommandResultAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersGetCommandResultAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..342d10202a59 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the + /// content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..6739bb6a9df4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..ac990f54529e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersRebalanceLoadBalancersAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..7ad28870ad4b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersRebalanceLoadBalancersAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..c9bcbcdd9a14 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersResetAadProfileAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersResetAadProfileAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersResetAadProfileAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersResetAadProfileAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersResetAadProfileAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersResetAadProfileAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersResetAadProfileAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersResetAadProfileAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..12234cfdac66 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersResetAadProfileAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersResetAadProfileAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersResetAadProfileAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersResetAadProfileAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..0b5571cd80e3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersResetAadProfileAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersResetAadProfileAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersResetAadProfileAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersResetAadProfileAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..dc815bdb8017 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetAadProfileAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersResetAadProfileAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetAadProfileAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersResetAadProfileAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersResetAadProfileAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..5526796be98e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..df3c53d847b4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..d6a53863ff1b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersResetServicePrincipalProfileAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..a9507f52d714 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersResetServicePrincipalProfileAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..fea9cfa35615 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersRotateClusterCertificatesAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersRotateClusterCertificatesAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..e7d66e9f7589 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersRotateClusterCertificatesAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..f29dfac8f1ec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersRotateClusterCertificatesAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..72b302d9357f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateClusterCertificatesAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersRotateClusterCertificatesAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..ddeeb1025d3d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing + /// the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..c7e6d91ab6e8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..71590ea25c9f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..5d110b89f6ec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersRotateServiceAccountSigningKeysAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into + /// a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..1541c6d76053 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersRunCommandAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersRunCommandAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersRunCommandAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersRunCommandAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersRunCommandAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersRunCommandAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersRunCommandAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersRunCommandAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..2824e6132d09 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersRunCommandAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersRunCommandAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersRunCommandAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersRunCommandAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..161606f8b7e4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersRunCommandAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersRunCommandAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersRunCommandAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersRunCommandAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..2cbf55d6ff02 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersRunCommandAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersRunCommandAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersRunCommandAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersRunCommandAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersRunCommandAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..9ef9c881c578 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersStartAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersStartAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersStartAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersStartAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersStartAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersStartAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersStartAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersStartAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..0e8b15987457 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersStartAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersStartAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersStartAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersStartAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersStartAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..88ec1276a395 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersStartAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersStartAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersStartAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersStartAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..a04e13785407 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStartAcceptedResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersStartAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStartAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersStartAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersStartAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..335334a0b74a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ManagedClustersStopAcceptedResponseHeadersTypeConverter))] + public partial class ManagedClustersStopAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedClustersStopAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedClustersStopAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedClustersStopAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedClustersStopAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeadersInternal)this).Location, 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.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ManagedClustersStopAcceptedResponseHeadersTypeConverter))] + public partial interface IManagedClustersStopAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..f594dde5373e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedClustersStopAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.IManagedClustersStopAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedClustersStopAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedClustersStopAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedClustersStopAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..db6c514745de --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersStopAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public ManagedClustersStopAcceptedResponseHeaders() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + } + public partial interface IManagedClustersStopAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface IManagedClustersStopAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..92ac9f0d098e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/ManagedClustersStopAcceptedResponseHeaders.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class ManagedClustersStopAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IManagedClustersStopAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new ManagedClustersStopAcceptedResponseHeaders(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedClustersStopAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.PowerShell.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.PowerShell.cs new file mode 100644 index 000000000000..a9f4604eb4f3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.PowerShell.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleBindingsDeleteAcceptedResponseHeadersTypeConverter))] + public partial class TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders(content); + } + + /// + /// Creates a new instance of , deserializing the content + /// from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeadersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeadersInternal)this).Location, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + [System.ComponentModel.TypeConverter(typeof(TrustedAccessRoleBindingsDeleteAcceptedResponseHeadersTypeConverter))] + public partial interface ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders + + { + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.TypeConverter.cs new file mode 100644 index 000000000000..87ee818c6880 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.TypeConverter.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.ContainerService.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrustedAccessRoleBindingsDeleteAcceptedResponseHeadersTypeConverter : 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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.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/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.cs new file mode 100644 index 000000000000..e647a56ca39f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.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.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders : + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeadersInternal, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _location; + + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("Location", out var __locationHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeadersInternal)this).Location = System.Linq.Enumerable.FirstOrDefault(__locationHeader0) is string __headerLocationHeader0 ? __headerLocationHeader0 : (string)null; + } + } + + /// + /// Creates an new instance. + /// + public TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders() + { + + } + } + public partial interface ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders + + { + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"Location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + internal partial interface ITrustedAccessRoleBindingsDeleteAcceptedResponseHeadersInternal + + { + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.json.cs b/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.json.cs new file mode 100644 index 000000000000..4bc7ef803f39 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Models/TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public partial class TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.ITrustedAccessRoleBindingsDeleteAcceptedResponseHeaders FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject instance to deserialize from. + internal TrustedAccessRoleBindingsDeleteAcceptedResponseHeaders(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/AddonAutoscaling.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AddonAutoscaling.Completer.cs new file mode 100644 index 000000000000..0f8de223f028 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AddonAutoscaling.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscalingTypeConverter))] + public partial struct AddonAutoscaling : + 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/swaggerci/containerservice.DefaultTag/generated/api/Support/AddonAutoscaling.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AddonAutoscaling.TypeConverter.cs new file mode 100644 index 000000000000..4ef7eab252cf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AddonAutoscaling.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + public partial class AddonAutoscalingTypeConverter : + 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) => AddonAutoscaling.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/swaggerci/containerservice.DefaultTag/generated/api/Support/AddonAutoscaling.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AddonAutoscaling.cs new file mode 100644 index 000000000000..c51834c89d97 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AddonAutoscaling.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + public partial struct AddonAutoscaling : + System.IEquatable + { + /// Feature to autoscale AKS-managed add-ons is disabled. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling Disabled = @"Disabled"; + + /// + /// Feature to autoscale AKS-managed add-ons is enabled. The default VPA update mode is Initial mode. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling Enabled = @"Enabled"; + + /// 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 AddonAutoscaling(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AddonAutoscaling + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AddonAutoscaling(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AddonAutoscaling + /// 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.ContainerService.Support.AddonAutoscaling e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AddonAutoscaling (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 AddonAutoscaling && Equals((AddonAutoscaling)obj); + } + + /// Returns hashCode for enum AddonAutoscaling + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AddonAutoscaling + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AddonAutoscaling + /// the value to convert to an instance of . + + public static implicit operator AddonAutoscaling(string value) + { + return new AddonAutoscaling(value); + } + + /// Implicit operator to convert AddonAutoscaling to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling e) + { + return e._value; + } + + /// Overriding != operator for enum AddonAutoscaling + /// 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.ContainerService.Support.AddonAutoscaling e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AddonAutoscaling + /// 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.ContainerService.Support.AddonAutoscaling e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolMode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolMode.Completer.cs new file mode 100644 index 000000000000..c8b73274032c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolMode.Completer.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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) || "Gateway".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Gateway'", "Gateway", global::System.Management.Automation.CompletionResultType.ParameterValue, "Gateway"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolMode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolMode.TypeConverter.cs new file mode 100644 index 000000000000..de034eebe3cb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolMode.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + 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/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolMode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolMode.cs new file mode 100644 index 000000000000..928304b4d093 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolMode.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.ContainerService.Support +{ + + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + public partial struct AgentPoolMode : + System.IEquatable + { + /// + /// Gateway agent pools are dedicated to providing static egress IPs to pods. For more details, see https://aka.ms/aks/static-egress-gateway. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode Gateway = @"Gateway"; + + /// + /// System agent pools are primarily for hosting critical system pods such as CoreDNS and metrics-server. System agent pools + /// osType must be Linux. System agent pools VM SKU must have at least 2vCPUs and 4GB of memory. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode System = @"System"; + + /// User agent pools are primarily for hosting your application pods. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Support.AgentPoolMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Support.AgentPoolMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolSshAccess.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolSshAccess.Completer.cs new file mode 100644 index 000000000000..70a2952f8358 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolSshAccess.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// SSH access method of an agent pool. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccessTypeConverter))] + public partial struct AgentPoolSshAccess : + 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) || "LocalUser".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LocalUser'", "LocalUser", global::System.Management.Automation.CompletionResultType.ParameterValue, "LocalUser"); + } + 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/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolSshAccess.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolSshAccess.TypeConverter.cs new file mode 100644 index 000000000000..d0a82c3dc4e3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolSshAccess.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// SSH access method of an agent pool. + public partial class AgentPoolSshAccessTypeConverter : + 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) => AgentPoolSshAccess.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/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolSshAccess.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolSshAccess.cs new file mode 100644 index 000000000000..7d4dd4df2a55 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolSshAccess.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.ContainerService.Support +{ + + /// SSH access method of an agent pool. + public partial struct AgentPoolSshAccess : + System.IEquatable + { + /// SSH service will be turned off on the node. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess Disabled = @"Disabled"; + + /// Can SSH onto the node as a local user using private key. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess LocalUser = @"LocalUser"; + + /// 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 AgentPoolSshAccess(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AgentPoolSshAccess + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AgentPoolSshAccess(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AgentPoolSshAccess + /// 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.ContainerService.Support.AgentPoolSshAccess e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AgentPoolSshAccess (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 AgentPoolSshAccess && Equals((AgentPoolSshAccess)obj); + } + + /// Returns hashCode for enum AgentPoolSshAccess + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AgentPoolSshAccess + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AgentPoolSshAccess + /// the value to convert to an instance of . + + public static implicit operator AgentPoolSshAccess(string value) + { + return new AgentPoolSshAccess(value); + } + + /// Implicit operator to convert AgentPoolSshAccess to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess e) + { + return e._value; + } + + /// Overriding != operator for enum AgentPoolSshAccess + /// 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.ContainerService.Support.AgentPoolSshAccess e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AgentPoolSshAccess + /// 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.ContainerService.Support.AgentPoolSshAccess e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolType.Completer.cs new file mode 100644 index 000000000000..50ecd98d822d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolType.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of Agent Pool. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolTypeTypeConverter))] + public partial struct AgentPoolType : + 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) || "VirtualMachineScaleSets".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VirtualMachineScaleSets'", "VirtualMachineScaleSets", global::System.Management.Automation.CompletionResultType.ParameterValue, "VirtualMachineScaleSets"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AvailabilitySet".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AvailabilitySet'", "AvailabilitySet", global::System.Management.Automation.CompletionResultType.ParameterValue, "AvailabilitySet"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "VirtualMachines".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'VirtualMachines'", "VirtualMachines", global::System.Management.Automation.CompletionResultType.ParameterValue, "VirtualMachines"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolType.TypeConverter.cs new file mode 100644 index 000000000000..c2514ffe07b1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of Agent Pool. + public partial class AgentPoolTypeTypeConverter : + 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) => AgentPoolType.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/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolType.cs new file mode 100644 index 000000000000..889fb69a9026 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/AgentPoolType.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of Agent Pool. + public partial struct AgentPoolType : + System.IEquatable + { + /// Use of this is strongly discouraged. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType AvailabilitySet = @"AvailabilitySet"; + + /// Create an Agent Pool backed by a Virtual Machine Scale Set. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType VirtualMachineScaleSets = @"VirtualMachineScaleSets"; + + /// Create an Agent Pool backed by a Single Instance VM orchestration mode. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType VirtualMachines = @"VirtualMachines"; + + /// 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 AgentPoolType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AgentPoolType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AgentPoolType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AgentPoolType + /// 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.ContainerService.Support.AgentPoolType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AgentPoolType (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 AgentPoolType && Equals((AgentPoolType)obj); + } + + /// Returns hashCode for enum AgentPoolType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AgentPoolType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AgentPoolType + /// the value to convert to an instance of . + + public static implicit operator AgentPoolType(string value) + { + return new AgentPoolType(value); + } + + /// Implicit operator to convert AgentPoolType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType e) + { + return e._value; + } + + /// Overriding != operator for enum AgentPoolType + /// 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.ContainerService.Support.AgentPoolType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AgentPoolType + /// 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.ContainerService.Support.AgentPoolType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ArtifactSource.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ArtifactSource.Completer.cs new file mode 100644 index 000000000000..ce6fe606b348 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ArtifactSource.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The source where the artifacts are downloaded from. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSourceTypeConverter))] + public partial struct ArtifactSource : + 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) || "Cache".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cache'", "Cache", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cache"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Direct".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Direct'", "Direct", global::System.Management.Automation.CompletionResultType.ParameterValue, "Direct"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ArtifactSource.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ArtifactSource.TypeConverter.cs new file mode 100644 index 000000000000..01087f5d1a0f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ArtifactSource.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The source where the artifacts are downloaded from. + public partial class ArtifactSourceTypeConverter : + 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) => ArtifactSource.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ArtifactSource.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ArtifactSource.cs new file mode 100644 index 000000000000..34a591bab76d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ArtifactSource.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.ContainerService.Support +{ + + /// The source where the artifacts are downloaded from. + public partial struct ArtifactSource : + System.IEquatable + { + /// pull images from Azure Container Registry with cache + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource Cache = @"Cache"; + + /// pull images from Microsoft Artifact Registry + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource Direct = @"Direct"; + + /// 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 ArtifactSource(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ArtifactSource + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ArtifactSource(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ArtifactSource + /// 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.ContainerService.Support.ArtifactSource e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ArtifactSource (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 ArtifactSource && Equals((ArtifactSource)obj); + } + + /// Returns hashCode for enum ArtifactSource + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ArtifactSource + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ArtifactSource + /// the value to convert to an instance of . + + public static implicit operator ArtifactSource(string value) + { + return new ArtifactSource(value); + } + + /// Implicit operator to convert ArtifactSource to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource e) + { + return e._value; + } + + /// Overriding != operator for enum ArtifactSource + /// 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.ContainerService.Support.ArtifactSource e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ArtifactSource + /// 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.ContainerService.Support.ArtifactSource e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/BackendPoolType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/BackendPoolType.Completer.cs new file mode 100644 index 000000000000..be8e1fdad69d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/BackendPoolType.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of the managed inbound Load Balancer BackendPool. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolTypeTypeConverter))] + public partial struct BackendPoolType : + 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) || "NodeIPConfiguration".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NodeIPConfiguration'", "NodeIPConfiguration", global::System.Management.Automation.CompletionResultType.ParameterValue, "NodeIPConfiguration"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NodeIP".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NodeIP'", "NodeIP", global::System.Management.Automation.CompletionResultType.ParameterValue, "NodeIP"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/BackendPoolType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/BackendPoolType.TypeConverter.cs new file mode 100644 index 000000000000..6d8da57746d6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/BackendPoolType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of the managed inbound Load Balancer BackendPool. + public partial class BackendPoolTypeTypeConverter : + 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) => BackendPoolType.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/swaggerci/containerservice.DefaultTag/generated/api/Support/BackendPoolType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/BackendPoolType.cs new file mode 100644 index 000000000000..4b66de1cc5a1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/BackendPoolType.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.ContainerService.Support +{ + + /// The type of the managed inbound Load Balancer BackendPool. + public partial struct BackendPoolType : + System.IEquatable + { + /// + /// The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType NodeIP = @"NodeIP"; + + /// + /// The type of the managed inbound Load Balancer BackendPool. https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType NodeIPConfiguration = @"NodeIPConfiguration"; + + /// 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 BackendPoolType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BackendPoolType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BackendPoolType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BackendPoolType + /// 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.ContainerService.Support.BackendPoolType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BackendPoolType (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 BackendPoolType && Equals((BackendPoolType)obj); + } + + /// Returns hashCode for enum BackendPoolType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BackendPoolType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BackendPoolType + /// the value to convert to an instance of . + + public static implicit operator BackendPoolType(string value) + { + return new BackendPoolType(value); + } + + /// Implicit operator to convert BackendPoolType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType e) + { + return e._value; + } + + /// Overriding != operator for enum BackendPoolType + /// 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.ContainerService.Support.BackendPoolType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BackendPoolType + /// 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.ContainerService.Support.BackendPoolType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.BackendPoolType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ClusterServiceLoadBalancerHealthProbeMode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ClusterServiceLoadBalancerHealthProbeMode.Completer.cs new file mode 100644 index 000000000000..905ba5e4d1d9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ClusterServiceLoadBalancerHealthProbeMode.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The health probing behavior for External Traffic Policy Cluster services. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeModeTypeConverter))] + public partial struct ClusterServiceLoadBalancerHealthProbeMode : + 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) || "ServiceNodePort".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ServiceNodePort'", "ServiceNodePort", global::System.Management.Automation.CompletionResultType.ParameterValue, "ServiceNodePort"); + } + 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/swaggerci/containerservice.DefaultTag/generated/api/Support/ClusterServiceLoadBalancerHealthProbeMode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ClusterServiceLoadBalancerHealthProbeMode.TypeConverter.cs new file mode 100644 index 000000000000..c58e01dea05f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ClusterServiceLoadBalancerHealthProbeMode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The health probing behavior for External Traffic Policy Cluster services. + public partial class ClusterServiceLoadBalancerHealthProbeModeTypeConverter : + 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) => ClusterServiceLoadBalancerHealthProbeMode.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ClusterServiceLoadBalancerHealthProbeMode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ClusterServiceLoadBalancerHealthProbeMode.cs new file mode 100644 index 000000000000..352cf74d19aa --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ClusterServiceLoadBalancerHealthProbeMode.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The health probing behavior for External Traffic Policy Cluster services. + public partial struct ClusterServiceLoadBalancerHealthProbeMode : + System.IEquatable + { + /// + /// Each External Traffic Policy Cluster service will have its own health probe targeting service nodePort. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode ServiceNodePort = @"ServiceNodePort"; + + /// + /// All External Traffic Policy Cluster services in a Standard Load Balancer will have a dedicated health probe targeting + /// the backend nodes' kube-proxy health check port 10256. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode Shared = @"Shared"; + + /// + /// 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 ClusterServiceLoadBalancerHealthProbeMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ClusterServiceLoadBalancerHealthProbeMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ClusterServiceLoadBalancerHealthProbeMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ClusterServiceLoadBalancerHealthProbeMode + /// 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.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type ClusterServiceLoadBalancerHealthProbeMode (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 ClusterServiceLoadBalancerHealthProbeMode && Equals((ClusterServiceLoadBalancerHealthProbeMode)obj); + } + + /// Returns hashCode for enum ClusterServiceLoadBalancerHealthProbeMode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ClusterServiceLoadBalancerHealthProbeMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// + /// Implicit operator to convert string to ClusterServiceLoadBalancerHealthProbeMode + /// + /// the value to convert to an instance of . + + public static implicit operator ClusterServiceLoadBalancerHealthProbeMode(string value) + { + return new ClusterServiceLoadBalancerHealthProbeMode(value); + } + + /// + /// Implicit operator to convert ClusterServiceLoadBalancerHealthProbeMode to string + /// + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode e) + { + return e._value; + } + + /// Overriding != operator for enum ClusterServiceLoadBalancerHealthProbeMode + /// 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.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ClusterServiceLoadBalancerHealthProbeMode + /// 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.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ClusterServiceLoadBalancerHealthProbeMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Code.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Code.Completer.cs new file mode 100644 index 000000000000..3205d6416376 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Code.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Tells whether the cluster is Running or Stopped + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CodeTypeConverter))] + public partial struct Code : + 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) || "Stopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Stopped'", "Stopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stopped"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Code.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Code.TypeConverter.cs new file mode 100644 index 000000000000..3399afe1c2b5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Code.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Tells whether the cluster is Running or Stopped + public partial class CodeTypeConverter : + 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) => Code.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/swaggerci/containerservice.DefaultTag/generated/api/Support/Code.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Code.cs new file mode 100644 index 000000000000..09495b6cc6b2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Code.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.ContainerService.Support +{ + + /// Tells whether the cluster is Running or Stopped + public partial struct Code : + System.IEquatable + { + /// The cluster is running. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code Running = @"Running"; + + /// The cluster is stopped. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code Stopped = @"Stopped"; + + /// 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 Code(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to Code + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Code(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Code + /// 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.ContainerService.Support.Code e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Code (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 Code && Equals((Code)obj); + } + + /// Returns hashCode for enum Code + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Code + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Code + /// the value to convert to an instance of . + + public static implicit operator Code(string value) + { + return new Code(value); + } + + /// Implicit operator to convert Code to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code e) + { + return e._value; + } + + /// Overriding != operator for enum Code + /// 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.ContainerService.Support.Code e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Code + /// 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.ContainerService.Support.Code e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ConnectionStatus.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ConnectionStatus.Completer.cs new file mode 100644 index 000000000000..0858393d2b88 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ConnectionStatus.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The private link service connection status. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatusTypeConverter))] + public partial struct ConnectionStatus : + 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) || "Approved".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Approved'", "Approved", global::System.Management.Automation.CompletionResultType.ParameterValue, "Approved"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Rejected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Rejected'", "Rejected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rejected"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ConnectionStatus.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ConnectionStatus.TypeConverter.cs new file mode 100644 index 000000000000..0605da79e888 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ConnectionStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The private link service connection status. + public partial class ConnectionStatusTypeConverter : + 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) => ConnectionStatus.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ConnectionStatus.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ConnectionStatus.cs new file mode 100644 index 000000000000..4b5a92d4b64e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ConnectionStatus.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The private link service connection status. + public partial struct ConnectionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus Approved = @"Approved"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus Disconnected = @"Disconnected"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus Pending = @"Pending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus Rejected = @"Rejected"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ConnectionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to ConnectionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ConnectionStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ConnectionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ConnectionStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ConnectionStatus && Equals((ConnectionStatus)obj); + } + + /// Returns hashCode for enum ConnectionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ConnectionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ConnectionStatus + /// the value to convert to an instance of . + + public static implicit operator ConnectionStatus(string value) + { + return new ConnectionStatus(value); + } + + /// Implicit operator to convert ConnectionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum ConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ConnectionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/CreatedByType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/CreatedByType.Completer.cs new file mode 100644 index 000000000000..06e8f0568b1d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/CreatedByType.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of identity that created the resource. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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/swaggerci/containerservice.DefaultTag/generated/api/Support/CreatedByType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/CreatedByType.TypeConverter.cs new file mode 100644 index 000000000000..566cac86970a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/CreatedByType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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/swaggerci/containerservice.DefaultTag/generated/api/Support/CreatedByType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/CreatedByType.cs new file mode 100644 index 000000000000..cea6db7f69b8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/CreatedByType.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of identity that created the resource. + public partial struct CreatedByType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType Application = @"Application"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType Key = @"Key"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.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.ContainerService.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.CreatedByType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Expander.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Expander.Completer.cs new file mode 100644 index 000000000000..f203fd88fdea --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Expander.Completer.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) + /// for more information. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExpanderTypeConverter))] + public partial struct Expander : + 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) || "least-waste".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'least-waste'", "least-waste", global::System.Management.Automation.CompletionResultType.ParameterValue, "least-waste"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "most-pods".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'most-pods'", "most-pods", global::System.Management.Automation.CompletionResultType.ParameterValue, "most-pods"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "priority".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'priority'", "priority", global::System.Management.Automation.CompletionResultType.ParameterValue, "priority"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "random".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'random'", "random", global::System.Management.Automation.CompletionResultType.ParameterValue, "random"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Expander.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Expander.TypeConverter.cs new file mode 100644 index 000000000000..a3aa3a055b70 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Expander.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) + /// for more information. + /// + public partial class ExpanderTypeConverter : + 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) => Expander.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/swaggerci/containerservice.DefaultTag/generated/api/Support/Expander.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Expander.cs new file mode 100644 index 000000000000..58eb4f4e316d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Expander.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.ContainerService.Support +{ + + /// + /// If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) + /// for more information. + /// + public partial struct Expander : + System.IEquatable + { + /// + /// Selects the node group that will have the least idle CPU (if tied, unused memory) after scale-up. This is useful when + /// you have different classes of nodes, for example, high CPU or high memory nodes, and only want to expand those when there + /// are pending pods that need a lot of those resources. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander LeastWaste = @"least-waste"; + + /// + /// Selects the node group that would be able to schedule the most pods when scaling up. This is useful when you are using + /// nodeSelector to make sure certain pods land on certain nodes. Note that this won't cause the autoscaler to select bigger + /// nodes vs. smaller, as it can add multiple smaller nodes at once. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander MostPods = @"most-pods"; + + /// + /// Selects the node group that has the highest priority assigned by the user. It's configuration is described in more details + /// [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md). + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander Priority = @"priority"; + + /// + /// Used when you don't have a particular need for the node groups to scale differently. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander Random = @"random"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Expander + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Expander(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Expander + /// 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.ContainerService.Support.Expander e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Expander (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 Expander && Equals((Expander)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Expander(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum Expander + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Expander + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Expander + /// the value to convert to an instance of . + + public static implicit operator Expander(string value) + { + return new Expander(value); + } + + /// Implicit operator to convert Expander to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander e) + { + return e._value; + } + + /// Overriding != operator for enum Expander + /// 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.ContainerService.Support.Expander e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Expander + /// 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.ContainerService.Support.Expander e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ExtendedLocationTypes.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ExtendedLocationTypes.Completer.cs new file mode 100644 index 000000000000..71bdd5ac1f39 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ExtendedLocationTypes.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of extendedLocation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypesTypeConverter))] + public partial struct ExtendedLocationTypes : + 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) || "EdgeZone".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EdgeZone'", "EdgeZone", global::System.Management.Automation.CompletionResultType.ParameterValue, "EdgeZone"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ExtendedLocationTypes.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ExtendedLocationTypes.TypeConverter.cs new file mode 100644 index 000000000000..4bc94634fd68 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ExtendedLocationTypes.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of extendedLocation. + public partial class ExtendedLocationTypesTypeConverter : + 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) => ExtendedLocationTypes.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ExtendedLocationTypes.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ExtendedLocationTypes.cs new file mode 100644 index 000000000000..12669f2fe7dc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ExtendedLocationTypes.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.ContainerService.Support +{ + + /// The type of extendedLocation. + public partial struct ExtendedLocationTypes : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes EdgeZone = @"EdgeZone"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ExtendedLocationTypes + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ExtendedLocationTypes(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ExtendedLocationTypes + /// 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.ContainerService.Support.ExtendedLocationTypes e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ExtendedLocationTypes (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 ExtendedLocationTypes && Equals((ExtendedLocationTypes)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ExtendedLocationTypes(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum ExtendedLocationTypes + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ExtendedLocationTypes + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ExtendedLocationTypes + /// the value to convert to an instance of . + + public static implicit operator ExtendedLocationTypes(string value) + { + return new ExtendedLocationTypes(value); + } + + /// Implicit operator to convert ExtendedLocationTypes to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes e) + { + return e._value; + } + + /// Overriding != operator for enum ExtendedLocationTypes + /// 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.ContainerService.Support.ExtendedLocationTypes e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ExtendedLocationTypes + /// 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.ContainerService.Support.ExtendedLocationTypes e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Format.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Format.Completer.cs new file mode 100644 index 000000000000..2a25b33c35da --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Format.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Argument completer implementation for Format. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.FormatTypeConverter))] + public partial struct Format : + 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) || "azure".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'azure'", "azure", global::System.Management.Automation.CompletionResultType.ParameterValue, "azure"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "exec".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'exec'", "exec", global::System.Management.Automation.CompletionResultType.ParameterValue, "exec"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Format.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Format.TypeConverter.cs new file mode 100644 index 000000000000..01dbe4b693e8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Format.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// TypeConverter implementation for Format. + public partial class FormatTypeConverter : + 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) => Format.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/swaggerci/containerservice.DefaultTag/generated/api/Support/Format.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Format.cs new file mode 100644 index 000000000000..55733f56ab08 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Format.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + public partial struct Format : + System.IEquatable + { + /// + /// Return azure auth-provider kubeconfig. This format is deprecated in v1.22 and will be fully removed in v1.26. See: https://aka.ms/k8s/changes-1-26. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format Azure = @"azure"; + + /// + /// Return exec format kubeconfig. This format requires kubelogin binary in the path. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format Exec = @"exec"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Format + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Format(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Format + /// 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.ContainerService.Support.Format e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Format (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 Format && Equals((Format)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Format(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum Format + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Format + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Format + /// the value to convert to an instance of . + + public static implicit operator Format(string value) + { + return new Format(value); + } + + /// Implicit operator to convert Format to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format e) + { + return e._value; + } + + /// Overriding != operator for enum Format + /// 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.ContainerService.Support.Format e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Format + /// 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.ContainerService.Support.Format e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/GpuInstanceProfile.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/GpuInstanceProfile.Completer.cs new file mode 100644 index 000000000000..47d3fd24eb53 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/GpuInstanceProfile.Completer.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfileTypeConverter))] + public partial struct GpuInstanceProfile : + 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) || "MIG1g".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MIG1g'", "MIG1g", global::System.Management.Automation.CompletionResultType.ParameterValue, "MIG1g"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MIG2g".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MIG2g'", "MIG2g", global::System.Management.Automation.CompletionResultType.ParameterValue, "MIG2g"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MIG3g".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MIG3g'", "MIG3g", global::System.Management.Automation.CompletionResultType.ParameterValue, "MIG3g"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MIG4g".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MIG4g'", "MIG4g", global::System.Management.Automation.CompletionResultType.ParameterValue, "MIG4g"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MIG7g".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MIG7g'", "MIG7g", global::System.Management.Automation.CompletionResultType.ParameterValue, "MIG7g"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/GpuInstanceProfile.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/GpuInstanceProfile.TypeConverter.cs new file mode 100644 index 000000000000..82e71746988a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/GpuInstanceProfile.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + public partial class GpuInstanceProfileTypeConverter : + 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) => GpuInstanceProfile.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/swaggerci/containerservice.DefaultTag/generated/api/Support/GpuInstanceProfile.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/GpuInstanceProfile.cs new file mode 100644 index 000000000000..6e2bf361f86a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/GpuInstanceProfile.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.ContainerService.Support +{ + + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + public partial struct GpuInstanceProfile : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile Mig1G = @"MIG1g"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile Mig2G = @"MIG2g"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile Mig3G = @"MIG3g"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile Mig4G = @"MIG4g"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile Mig7G = @"MIG7g"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to GpuInstanceProfile + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new GpuInstanceProfile(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type GpuInstanceProfile + /// 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.ContainerService.Support.GpuInstanceProfile e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type GpuInstanceProfile (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 GpuInstanceProfile && Equals((GpuInstanceProfile)obj); + } + + /// Returns hashCode for enum GpuInstanceProfile + /// 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 GpuInstanceProfile(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for GpuInstanceProfile + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to GpuInstanceProfile + /// the value to convert to an instance of . + + public static implicit operator GpuInstanceProfile(string value) + { + return new GpuInstanceProfile(value); + } + + /// Implicit operator to convert GpuInstanceProfile to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile e) + { + return e._value; + } + + /// Overriding != operator for enum GpuInstanceProfile + /// 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.ContainerService.Support.GpuInstanceProfile e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum GpuInstanceProfile + /// 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.ContainerService.Support.GpuInstanceProfile e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/GuardrailsSupport.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/GuardrailsSupport.Completer.cs new file mode 100644 index 000000000000..5705235cee49 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/GuardrailsSupport.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Whether the version is preview or stable. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupportTypeConverter))] + public partial struct GuardrailsSupport : + 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) || "Stable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Stable'", "Stable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stable"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/GuardrailsSupport.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/GuardrailsSupport.TypeConverter.cs new file mode 100644 index 000000000000..33933693ad9f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/GuardrailsSupport.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Whether the version is preview or stable. + public partial class GuardrailsSupportTypeConverter : + 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) => GuardrailsSupport.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/swaggerci/containerservice.DefaultTag/generated/api/Support/GuardrailsSupport.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/GuardrailsSupport.cs new file mode 100644 index 000000000000..af050d3bc98f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/GuardrailsSupport.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Whether the version is preview or stable. + public partial struct GuardrailsSupport : + System.IEquatable + { + /// + /// The version is preview. It is not recommended to use preview versions on critical production clusters. The preview version + /// may not support all use-cases. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport Preview = @"Preview"; + + /// The version is stable and can be used on critical production clusters. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport Stable = @"Stable"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to GuardrailsSupport + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new GuardrailsSupport(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type GuardrailsSupport + /// 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.ContainerService.Support.GuardrailsSupport e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type GuardrailsSupport (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 GuardrailsSupport && Equals((GuardrailsSupport)obj); + } + + /// Returns hashCode for enum GuardrailsSupport + /// 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 GuardrailsSupport(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for GuardrailsSupport + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to GuardrailsSupport + /// the value to convert to an instance of . + + public static implicit operator GuardrailsSupport(string value) + { + return new GuardrailsSupport(value); + } + + /// Implicit operator to convert GuardrailsSupport to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport e) + { + return e._value; + } + + /// Overriding != operator for enum GuardrailsSupport + /// 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.ContainerService.Support.GuardrailsSupport e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum GuardrailsSupport + /// 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.ContainerService.Support.GuardrailsSupport e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GuardrailsSupport e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/IPFamily.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/IPFamily.Completer.cs new file mode 100644 index 000000000000..0eec6d53c193 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/IPFamily.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// To determine if address belongs IPv4 or IPv6 family. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamilyTypeConverter))] + public partial struct IPFamily : + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/IPFamily.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/IPFamily.TypeConverter.cs new file mode 100644 index 000000000000..27d36bca5a63 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/IPFamily.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// To determine if address belongs IPv4 or IPv6 family. + public partial class IPFamilyTypeConverter : + 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) => IPFamily.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/swaggerci/containerservice.DefaultTag/generated/api/Support/IPFamily.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/IPFamily.cs new file mode 100644 index 000000000000..fb42fda5cbf5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/IPFamily.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.ContainerService.Support +{ + + /// To determine if address belongs IPv4 or IPv6 family. + public partial struct IPFamily : + System.IEquatable + { + /// IPv4 family + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily IPv4 = @"IPv4"; + + /// IPv6 family + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily IPv6 = @"IPv6"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IPFamily + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IPFamily(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IPFamily + /// 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.ContainerService.Support.IPFamily e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IPFamily (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 IPFamily && Equals((IPFamily)obj); + } + + /// Returns hashCode for enum IPFamily + /// 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 IPFamily(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IPFamily + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IPFamily + /// the value to convert to an instance of . + + public static implicit operator IPFamily(string value) + { + return new IPFamily(value); + } + + /// Implicit operator to convert IPFamily to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily e) + { + return e._value; + } + + /// Overriding != operator for enum IPFamily + /// 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.ContainerService.Support.IPFamily e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IPFamily + /// 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.ContainerService.Support.IPFamily e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IPFamily e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/IpvsScheduler.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/IpvsScheduler.Completer.cs new file mode 100644 index 000000000000..54eddb020527 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/IpvsScheduler.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsSchedulerTypeConverter))] + public partial struct IpvsScheduler : + 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) || "RoundRobin".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RoundRobin'", "RoundRobin", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoundRobin"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "LeastConnection".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'LeastConnection'", "LeastConnection", global::System.Management.Automation.CompletionResultType.ParameterValue, "LeastConnection"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/IpvsScheduler.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/IpvsScheduler.TypeConverter.cs new file mode 100644 index 000000000000..7737eb99cac8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/IpvsScheduler.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + public partial class IpvsSchedulerTypeConverter : + 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) => IpvsScheduler.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/swaggerci/containerservice.DefaultTag/generated/api/Support/IpvsScheduler.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/IpvsScheduler.cs new file mode 100644 index 000000000000..472c07a72583 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/IpvsScheduler.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + /// + public partial struct IpvsScheduler : + System.IEquatable + { + /// Least Connection + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler LeastConnection = @"LeastConnection"; + + /// Round Robin + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler RoundRobin = @"RoundRobin"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IpvsScheduler + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IpvsScheduler(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IpvsScheduler + /// 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.ContainerService.Support.IpvsScheduler e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IpvsScheduler (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 IpvsScheduler && Equals((IpvsScheduler)obj); + } + + /// Returns hashCode for enum IpvsScheduler + /// 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 IpvsScheduler(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IpvsScheduler + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IpvsScheduler + /// the value to convert to an instance of . + + public static implicit operator IpvsScheduler(string value) + { + return new IpvsScheduler(value); + } + + /// Implicit operator to convert IpvsScheduler to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler e) + { + return e._value; + } + + /// Overriding != operator for enum IpvsScheduler + /// 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.ContainerService.Support.IpvsScheduler e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IpvsScheduler + /// 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.ContainerService.Support.IpvsScheduler e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IpvsScheduler e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/IstioIngressGatewayMode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/IstioIngressGatewayMode.Completer.cs new file mode 100644 index 000000000000..677552549a23 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/IstioIngressGatewayMode.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Mode of an ingress gateway. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayModeTypeConverter))] + public partial struct IstioIngressGatewayMode : + 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) || "External".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'External'", "External", global::System.Management.Automation.CompletionResultType.ParameterValue, "External"); + } + 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/swaggerci/containerservice.DefaultTag/generated/api/Support/IstioIngressGatewayMode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/IstioIngressGatewayMode.TypeConverter.cs new file mode 100644 index 000000000000..1f6820718ceb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/IstioIngressGatewayMode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Mode of an ingress gateway. + public partial class IstioIngressGatewayModeTypeConverter : + 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) => IstioIngressGatewayMode.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/swaggerci/containerservice.DefaultTag/generated/api/Support/IstioIngressGatewayMode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/IstioIngressGatewayMode.cs new file mode 100644 index 000000000000..214694e8e1e5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/IstioIngressGatewayMode.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Mode of an ingress gateway. + public partial struct IstioIngressGatewayMode : + System.IEquatable + { + /// The ingress gateway is assigned a public IP address and is publicly accessible. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode External = @"External"; + + /// + /// The ingress gateway is assigned an internal IP address and cannot is accessed publicly. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode Internal = @"Internal"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IstioIngressGatewayMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IstioIngressGatewayMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IstioIngressGatewayMode + /// 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.ContainerService.Support.IstioIngressGatewayMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IstioIngressGatewayMode (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 IstioIngressGatewayMode && Equals((IstioIngressGatewayMode)obj); + } + + /// Returns hashCode for enum IstioIngressGatewayMode + /// 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 IstioIngressGatewayMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IstioIngressGatewayMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IstioIngressGatewayMode + /// the value to convert to an instance of . + + public static implicit operator IstioIngressGatewayMode(string value) + { + return new IstioIngressGatewayMode(value); + } + + /// Implicit operator to convert IstioIngressGatewayMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode e) + { + return e._value; + } + + /// Overriding != operator for enum IstioIngressGatewayMode + /// 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.ContainerService.Support.IstioIngressGatewayMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IstioIngressGatewayMode + /// 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.ContainerService.Support.IstioIngressGatewayMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.IstioIngressGatewayMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/KeyVaultNetworkAccessTypes.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/KeyVaultNetworkAccessTypes.Completer.cs new file mode 100644 index 000000000000..8aa1adaa3eda --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/KeyVaultNetworkAccessTypes.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypesTypeConverter))] + public partial struct KeyVaultNetworkAccessTypes : + 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) || "Public".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Public'", "Public", global::System.Management.Automation.CompletionResultType.ParameterValue, "Public"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Private".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Private'", "Private", global::System.Management.Automation.CompletionResultType.ParameterValue, "Private"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/KeyVaultNetworkAccessTypes.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/KeyVaultNetworkAccessTypes.TypeConverter.cs new file mode 100644 index 000000000000..616957cd3628 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/KeyVaultNetworkAccessTypes.TypeConverter.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.ContainerService.Support +{ + + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + public partial class KeyVaultNetworkAccessTypesTypeConverter : + 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) => KeyVaultNetworkAccessTypes.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/swaggerci/containerservice.DefaultTag/generated/api/Support/KeyVaultNetworkAccessTypes.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/KeyVaultNetworkAccessTypes.cs new file mode 100644 index 000000000000..b0248851a99e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/KeyVaultNetworkAccessTypes.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.ContainerService.Support +{ + + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + public partial struct KeyVaultNetworkAccessTypes : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes Private = @"Private"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes Public = @"Public"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to KeyVaultNetworkAccessTypes + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KeyVaultNetworkAccessTypes(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KeyVaultNetworkAccessTypes + /// 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.ContainerService.Support.KeyVaultNetworkAccessTypes e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KeyVaultNetworkAccessTypes (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 KeyVaultNetworkAccessTypes && Equals((KeyVaultNetworkAccessTypes)obj); + } + + /// Returns hashCode for enum KeyVaultNetworkAccessTypes + /// 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 KeyVaultNetworkAccessTypes(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KeyVaultNetworkAccessTypes + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KeyVaultNetworkAccessTypes + /// the value to convert to an instance of . + + public static implicit operator KeyVaultNetworkAccessTypes(string value) + { + return new KeyVaultNetworkAccessTypes(value); + } + + /// Implicit operator to convert KeyVaultNetworkAccessTypes to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes e) + { + return e._value; + } + + /// Overriding != operator for enum KeyVaultNetworkAccessTypes + /// 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.ContainerService.Support.KeyVaultNetworkAccessTypes e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KeyVaultNetworkAccessTypes + /// 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.ContainerService.Support.KeyVaultNetworkAccessTypes e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/KubeletDiskType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubeletDiskType.Completer.cs new file mode 100644 index 000000000000..a9bef09e8a1c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubeletDiskType.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskTypeTypeConverter))] + public partial struct KubeletDiskType : + 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) || "OS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OS'", "OS", global::System.Management.Automation.CompletionResultType.ParameterValue, "OS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Temporary".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Temporary'", "Temporary", global::System.Management.Automation.CompletionResultType.ParameterValue, "Temporary"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/KubeletDiskType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubeletDiskType.TypeConverter.cs new file mode 100644 index 000000000000..38fda8215ca7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubeletDiskType.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + public partial class KubeletDiskTypeTypeConverter : + 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) => KubeletDiskType.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/swaggerci/containerservice.DefaultTag/generated/api/Support/KubeletDiskType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubeletDiskType.cs new file mode 100644 index 000000000000..61ad8c180454 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubeletDiskType.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + public partial struct KubeletDiskType : + System.IEquatable + { + /// Kubelet will use the OS disk for its data. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType OS = @"OS"; + + /// Kubelet will use the temporary disk for its data. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType Temporary = @"Temporary"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KubeletDiskType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KubeletDiskType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KubeletDiskType + /// 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.ContainerService.Support.KubeletDiskType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KubeletDiskType (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 KubeletDiskType && Equals((KubeletDiskType)obj); + } + + /// Returns hashCode for enum KubeletDiskType + /// 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 KubeletDiskType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KubeletDiskType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KubeletDiskType + /// the value to convert to an instance of . + + public static implicit operator KubeletDiskType(string value) + { + return new KubeletDiskType(value); + } + + /// Implicit operator to convert KubeletDiskType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType e) + { + return e._value; + } + + /// Overriding != operator for enum KubeletDiskType + /// 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.ContainerService.Support.KubeletDiskType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KubeletDiskType + /// 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.ContainerService.Support.KubeletDiskType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/KubernetesSupportPlan.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubernetesSupportPlan.Completer.cs new file mode 100644 index 000000000000..5887e61159ee --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubernetesSupportPlan.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Different support tiers for AKS managed clusters + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlanTypeConverter))] + public partial struct KubernetesSupportPlan : + 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) || "KubernetesOfficial".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KubernetesOfficial'", "KubernetesOfficial", global::System.Management.Automation.CompletionResultType.ParameterValue, "KubernetesOfficial"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AKSLongTermSupport".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AKSLongTermSupport'", "AKSLongTermSupport", global::System.Management.Automation.CompletionResultType.ParameterValue, "AKSLongTermSupport"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/KubernetesSupportPlan.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubernetesSupportPlan.TypeConverter.cs new file mode 100644 index 000000000000..9b3f83243301 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubernetesSupportPlan.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Different support tiers for AKS managed clusters + public partial class KubernetesSupportPlanTypeConverter : + 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) => KubernetesSupportPlan.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/swaggerci/containerservice.DefaultTag/generated/api/Support/KubernetesSupportPlan.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubernetesSupportPlan.cs new file mode 100644 index 000000000000..a0947c115bac --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/KubernetesSupportPlan.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.ContainerService.Support +{ + + /// Different support tiers for AKS managed clusters + public partial struct KubernetesSupportPlan : + System.IEquatable + { + /// + /// Support for the version extended past the KubernetesOfficial support of 1 year. AKS continues to patch CVEs for another + /// 1 year, for a total of 2 years of support. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan AksLongTermSupport = @"AKSLongTermSupport"; + + /// + /// Support for the version is the same as for the open source Kubernetes offering. Official Kubernetes open source community + /// support versions for 1 year after release. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan KubernetesOfficial = @"KubernetesOfficial"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KubernetesSupportPlan + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KubernetesSupportPlan(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KubernetesSupportPlan + /// 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.ContainerService.Support.KubernetesSupportPlan e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KubernetesSupportPlan (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 KubernetesSupportPlan && Equals((KubernetesSupportPlan)obj); + } + + /// Returns hashCode for enum KubernetesSupportPlan + /// 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 KubernetesSupportPlan(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KubernetesSupportPlan + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KubernetesSupportPlan + /// the value to convert to an instance of . + + public static implicit operator KubernetesSupportPlan(string value) + { + return new KubernetesSupportPlan(value); + } + + /// Implicit operator to convert KubernetesSupportPlan to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan e) + { + return e._value; + } + + /// Overriding != operator for enum KubernetesSupportPlan + /// 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.ContainerService.Support.KubernetesSupportPlan e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KubernetesSupportPlan + /// 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.ContainerService.Support.KubernetesSupportPlan e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Level.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Level.Completer.cs new file mode 100644 index 000000000000..c991a3570f83 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Level.Completer.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LevelTypeConverter))] + public partial struct Level : + 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) || "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) || "Warning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Warning'", "Warning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enforcement".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enforcement'", "Enforcement", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enforcement"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Level.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Level.TypeConverter.cs new file mode 100644 index 000000000000..01df5073dec8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Level.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + public partial class LevelTypeConverter : + 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) => Level.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/swaggerci/containerservice.DefaultTag/generated/api/Support/Level.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Level.cs new file mode 100644 index 000000000000..2ba94270bf23 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Level.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + public partial struct Level : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level Enforcement = @"Enforcement"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level Off = @"Off"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level Warning = @"Warning"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Level + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Level(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Level + /// 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.ContainerService.Support.Level e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Level (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 Level && Equals((Level)obj); + } + + /// Returns hashCode for enum Level + /// 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 Level(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Level + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Level + /// the value to convert to an instance of . + + public static implicit operator Level(string value) + { + return new Level(value); + } + + /// Implicit operator to convert Level to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level e) + { + return e._value; + } + + /// Overriding != operator for enum Level + /// 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.ContainerService.Support.Level e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Level + /// 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.ContainerService.Support.Level e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/LicenseType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/LicenseType.Completer.cs new file mode 100644 index 000000000000..9cc6fbce9386 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/LicenseType.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseTypeTypeConverter))] + public partial struct LicenseType : + 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) || "Windows_Server".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Windows_Server'", "Windows_Server", global::System.Management.Automation.CompletionResultType.ParameterValue, "Windows_Server"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/LicenseType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/LicenseType.TypeConverter.cs new file mode 100644 index 000000000000..6725a1fb3c29 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/LicenseType.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + public partial class LicenseTypeTypeConverter : + 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) => LicenseType.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/swaggerci/containerservice.DefaultTag/generated/api/Support/LicenseType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/LicenseType.cs new file mode 100644 index 000000000000..914acb4af721 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/LicenseType.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + public partial struct LicenseType : + System.IEquatable + { + /// No additional licensing is applied. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType None = @"None"; + + /// Enables Azure Hybrid User Benefits for Windows VMs. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType WindowsServer = @"Windows_Server"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LicenseType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LicenseType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LicenseType + /// 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.ContainerService.Support.LicenseType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LicenseType (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 LicenseType && Equals((LicenseType)obj); + } + + /// Returns hashCode for enum LicenseType + /// 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 LicenseType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LicenseType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LicenseType + /// the value to convert to an instance of . + + public static implicit operator LicenseType(string value) + { + return new LicenseType(value); + } + + /// Implicit operator to convert LicenseType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType e) + { + return e._value; + } + + /// Overriding != operator for enum LicenseType + /// 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.ContainerService.Support.LicenseType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LicenseType + /// 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.ContainerService.Support.LicenseType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/LoadBalancerSku.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/LoadBalancerSku.Completer.cs new file mode 100644 index 000000000000..5909477e01ef --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/LoadBalancerSku.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more + /// information about the differences between load balancer SKUs. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSkuTypeConverter))] + public partial struct LoadBalancerSku : + 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) || "basic".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'basic'", "basic", global::System.Management.Automation.CompletionResultType.ParameterValue, "basic"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/LoadBalancerSku.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/LoadBalancerSku.TypeConverter.cs new file mode 100644 index 000000000000..b48b15e0ba9d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/LoadBalancerSku.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more + /// information about the differences between load balancer SKUs. + /// + public partial class LoadBalancerSkuTypeConverter : + 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) => LoadBalancerSku.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/swaggerci/containerservice.DefaultTag/generated/api/Support/LoadBalancerSku.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/LoadBalancerSku.cs new file mode 100644 index 000000000000..0acc282db674 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/LoadBalancerSku.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.ContainerService.Support +{ + + /// + /// The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more + /// information about the differences between load balancer SKUs. + /// + public partial struct LoadBalancerSku : + System.IEquatable + { + /// Use a basic Load Balancer with limited functionality. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku Basic = @"basic"; + + /// + /// Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For more information about on working with + /// the load balancer in the managed cluster, see the [standard Load Balancer](https://docs.microsoft.com/azure/aks/load-balancer-standard) + /// article. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku Standard = @"standard"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LoadBalancerSku + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LoadBalancerSku(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LoadBalancerSku + /// 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.ContainerService.Support.LoadBalancerSku e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LoadBalancerSku (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 LoadBalancerSku && Equals((LoadBalancerSku)obj); + } + + /// Returns hashCode for enum LoadBalancerSku + /// 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 LoadBalancerSku(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LoadBalancerSku + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LoadBalancerSku + /// the value to convert to an instance of . + + public static implicit operator LoadBalancerSku(string value) + { + return new LoadBalancerSku(value); + } + + /// Implicit operator to convert LoadBalancerSku to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku e) + { + return e._value; + } + + /// Overriding != operator for enum LoadBalancerSku + /// 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.ContainerService.Support.LoadBalancerSku e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LoadBalancerSku + /// 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.ContainerService.Support.LoadBalancerSku e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LoadBalancerSku e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterPodIdentityProvisioningState.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterPodIdentityProvisioningState.Completer.cs new file mode 100644 index 000000000000..08d2a5728b83 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterPodIdentityProvisioningState.Completer.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.ContainerService.Support +{ + + /// The current provisioning state of the pod identity. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningStateTypeConverter))] + public partial struct ManagedClusterPodIdentityProvisioningState : + 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) || "Assigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Assigned'", "Assigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Assigned"); + } + 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/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterPodIdentityProvisioningState.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterPodIdentityProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..ed3cf78a2da5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterPodIdentityProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The current provisioning state of the pod identity. + public partial class ManagedClusterPodIdentityProvisioningStateTypeConverter : + 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) => ManagedClusterPodIdentityProvisioningState.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterPodIdentityProvisioningState.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterPodIdentityProvisioningState.cs new file mode 100644 index 000000000000..ea04e739eaa4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterPodIdentityProvisioningState.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.ContainerService.Support +{ + + /// The current provisioning state of the pod identity. + public partial struct ManagedClusterPodIdentityProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState Assigned = @"Assigned"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ManagedClusterPodIdentityProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ManagedClusterPodIdentityProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ManagedClusterPodIdentityProvisioningState + /// 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.ContainerService.Support.ManagedClusterPodIdentityProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type ManagedClusterPodIdentityProvisioningState (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 ManagedClusterPodIdentityProvisioningState && Equals((ManagedClusterPodIdentityProvisioningState)obj); + } + + /// Returns hashCode for enum ManagedClusterPodIdentityProvisioningState + /// 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 ManagedClusterPodIdentityProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ManagedClusterPodIdentityProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// + /// Implicit operator to convert string to ManagedClusterPodIdentityProvisioningState + /// + /// the value to convert to an instance of . + + public static implicit operator ManagedClusterPodIdentityProvisioningState(string value) + { + return new ManagedClusterPodIdentityProvisioningState(value); + } + + /// + /// Implicit operator to convert ManagedClusterPodIdentityProvisioningState to string + /// + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum ManagedClusterPodIdentityProvisioningState + /// 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.ContainerService.Support.ManagedClusterPodIdentityProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ManagedClusterPodIdentityProvisioningState + /// 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.ContainerService.Support.ManagedClusterPodIdentityProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterPodIdentityProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuName.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuName.Completer.cs new file mode 100644 index 000000000000..af787328dda9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuName.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The name of a managed cluster SKU. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuNameTypeConverter))] + public partial struct ManagedClusterSkuName : + 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) || "Base".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Base'", "Base", global::System.Management.Automation.CompletionResultType.ParameterValue, "Base"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Automatic".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Automatic'", "Automatic", global::System.Management.Automation.CompletionResultType.ParameterValue, "Automatic"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuName.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuName.TypeConverter.cs new file mode 100644 index 000000000000..b52d94ffdc57 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuName.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The name of a managed cluster SKU. + public partial class ManagedClusterSkuNameTypeConverter : + 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) => ManagedClusterSkuName.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuName.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuName.cs new file mode 100644 index 000000000000..f60640ec86bb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuName.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.ContainerService.Support +{ + + /// The name of a managed cluster SKU. + public partial struct ManagedClusterSkuName : + System.IEquatable + { + /// + /// Automatic clusters are optimized to run most production workloads with configuration that follows AKS best practices and + /// recommendations for cluster and workload setup, scalability, and security. For more details about Automatic clusters see + /// aka.ms/aks/automatic. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName Automatic = @"Automatic"; + + /// Base option for the AKS control plane. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName Base = @"Base"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ManagedClusterSkuName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ManagedClusterSkuName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ManagedClusterSkuName + /// 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.ContainerService.Support.ManagedClusterSkuName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ManagedClusterSkuName (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 ManagedClusterSkuName && Equals((ManagedClusterSkuName)obj); + } + + /// Returns hashCode for enum ManagedClusterSkuName + /// 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 ManagedClusterSkuName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ManagedClusterSkuName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ManagedClusterSkuName + /// the value to convert to an instance of . + + public static implicit operator ManagedClusterSkuName(string value) + { + return new ManagedClusterSkuName(value); + } + + /// Implicit operator to convert ManagedClusterSkuName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName e) + { + return e._value; + } + + /// Overriding != operator for enum ManagedClusterSkuName + /// 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.ContainerService.Support.ManagedClusterSkuName e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ManagedClusterSkuName + /// 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.ContainerService.Support.ManagedClusterSkuName e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuTier.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuTier.Completer.cs new file mode 100644 index 000000000000..29efb278a541 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuTier.Completer.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTierTypeConverter))] + public partial struct ManagedClusterSkuTier : + 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) || "Premium".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Premium'", "Premium", global::System.Management.Automation.CompletionResultType.ParameterValue, "Premium"); + } + 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) || "Free".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Free'", "Free", global::System.Management.Automation.CompletionResultType.ParameterValue, "Free"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuTier.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuTier.TypeConverter.cs new file mode 100644 index 000000000000..9bf69558044c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuTier.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + public partial class ManagedClusterSkuTierTypeConverter : + 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) => ManagedClusterSkuTier.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuTier.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuTier.cs new file mode 100644 index 000000000000..a8c8c4c73746 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ManagedClusterSkuTier.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.ContainerService.Support +{ + + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + public partial struct ManagedClusterSkuTier : + System.IEquatable + { + /// + /// The cluster management is free, but charged for VM, storage, and networking usage. Best for experimenting, learning, simple + /// testing, or workloads with fewer than 10 nodes. Not recommended for production use cases. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier Free = @"Free"; + + /// + /// Cluster has premium capabilities in addition to all of the capabilities included in 'Standard'. Premium enables selection + /// of LongTermSupport (aka.ms/aks/lts) for certain Kubernetes versions. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier Premium = @"Premium"; + + /// + /// Recommended for mission-critical and production workloads. Includes Kubernetes control plane autoscaling, workload-intensive + /// testing, and up to 5,000 nodes per cluster. Guarantees 99.95% availability of the Kubernetes API server endpoint for clusters + /// that use Availability Zones and 99.9% of availability for clusters that don't use Availability Zones. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier Standard = @"Standard"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ManagedClusterSkuTier + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ManagedClusterSkuTier(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ManagedClusterSkuTier + /// 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.ContainerService.Support.ManagedClusterSkuTier e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ManagedClusterSkuTier (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 ManagedClusterSkuTier && Equals((ManagedClusterSkuTier)obj); + } + + /// Returns hashCode for enum ManagedClusterSkuTier + /// 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 ManagedClusterSkuTier(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ManagedClusterSkuTier + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ManagedClusterSkuTier + /// the value to convert to an instance of . + + public static implicit operator ManagedClusterSkuTier(string value) + { + return new ManagedClusterSkuTier(value); + } + + /// Implicit operator to convert ManagedClusterSkuTier to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier e) + { + return e._value; + } + + /// Overriding != operator for enum ManagedClusterSkuTier + /// 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.ContainerService.Support.ManagedClusterSkuTier e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ManagedClusterSkuTier + /// 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.ContainerService.Support.ManagedClusterSkuTier e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Mode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Mode.Completer.cs new file mode 100644 index 000000000000..c7bfb9fcbb86 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Mode.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Specify which proxy mode to use ('IPTABLES' or 'IPVS') + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ModeTypeConverter))] + public partial struct Mode : + 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) || "IPTABLES".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IPTABLES'", "IPTABLES", global::System.Management.Automation.CompletionResultType.ParameterValue, "IPTABLES"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "IPVS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'IPVS'", "IPVS", global::System.Management.Automation.CompletionResultType.ParameterValue, "IPVS"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Mode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Mode.TypeConverter.cs new file mode 100644 index 000000000000..36e03a7ed3f3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Mode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Specify which proxy mode to use ('IPTABLES' or 'IPVS') + public partial class ModeTypeConverter : + 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) => Mode.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/swaggerci/containerservice.DefaultTag/generated/api/Support/Mode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Mode.cs new file mode 100644 index 000000000000..5d6db3928b2b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Mode.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.ContainerService.Support +{ + + /// Specify which proxy mode to use ('IPTABLES' or 'IPVS') + public partial struct Mode : + System.IEquatable + { + /// IPTables proxy mode + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode Iptables = @"IPTABLES"; + + /// IPVS proxy mode. Must be using Kubernetes version >= 1.22. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode Ipvs = @"IPVS"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Mode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Mode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Mode + /// 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.ContainerService.Support.Mode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Mode (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 Mode && Equals((Mode)obj); + } + + /// Returns hashCode for enum Mode + /// 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 Mode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Mode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Mode + /// the value to convert to an instance of . + + public static implicit operator Mode(string value) + { + return new Mode(value); + } + + /// Implicit operator to convert Mode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode e) + { + return e._value; + } + + /// Overriding != operator for enum Mode + /// 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.ContainerService.Support.Mode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Mode + /// 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.ContainerService.Support.Mode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Mode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkDataplane.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkDataplane.Completer.cs new file mode 100644 index 000000000000..756d750523a1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkDataplane.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Network dataplane used in the Kubernetes cluster. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplaneTypeConverter))] + public partial struct NetworkDataplane : + 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) || "azure".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'azure'", "azure", global::System.Management.Automation.CompletionResultType.ParameterValue, "azure"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "cilium".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'cilium'", "cilium", global::System.Management.Automation.CompletionResultType.ParameterValue, "cilium"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkDataplane.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkDataplane.TypeConverter.cs new file mode 100644 index 000000000000..d508b77d6941 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkDataplane.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Network dataplane used in the Kubernetes cluster. + public partial class NetworkDataplaneTypeConverter : + 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) => NetworkDataplane.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/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkDataplane.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkDataplane.cs new file mode 100644 index 000000000000..4dac4859b612 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkDataplane.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Network dataplane used in the Kubernetes cluster. + public partial struct NetworkDataplane : + System.IEquatable + { + /// Use Azure network dataplane. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane Azure = @"azure"; + + /// + /// Use Cilium network dataplane. See [Azure CNI Powered by Cilium](https://learn.microsoft.com/azure/aks/azure-cni-powered-by-cilium) + /// for more information. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane Cilium = @"cilium"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NetworkDataplane + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkDataplane(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NetworkDataplane + /// 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.ContainerService.Support.NetworkDataplane e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NetworkDataplane (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 NetworkDataplane && Equals((NetworkDataplane)obj); + } + + /// Returns hashCode for enum NetworkDataplane + /// 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 NetworkDataplane(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NetworkDataplane + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NetworkDataplane + /// the value to convert to an instance of . + + public static implicit operator NetworkDataplane(string value) + { + return new NetworkDataplane(value); + } + + /// Implicit operator to convert NetworkDataplane to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane e) + { + return e._value; + } + + /// Overriding != operator for enum NetworkDataplane + /// 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.ContainerService.Support.NetworkDataplane e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NetworkDataplane + /// 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.ContainerService.Support.NetworkDataplane e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkDataplane e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkMode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkMode.Completer.cs new file mode 100644 index 000000000000..399464f8c5d0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkMode.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// This cannot be specified if networkPlugin is anything other than 'azure'. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkModeTypeConverter))] + public partial struct NetworkMode : + 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) || "transparent".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'transparent'", "transparent", global::System.Management.Automation.CompletionResultType.ParameterValue, "transparent"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "bridge".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'bridge'", "bridge", global::System.Management.Automation.CompletionResultType.ParameterValue, "bridge"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkMode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkMode.TypeConverter.cs new file mode 100644 index 000000000000..9ebf06cc3324 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkMode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// This cannot be specified if networkPlugin is anything other than 'azure'. + public partial class NetworkModeTypeConverter : + 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) => NetworkMode.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/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkMode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkMode.cs new file mode 100644 index 000000000000..d39bdb7327bf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkMode.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// This cannot be specified if networkPlugin is anything other than 'azure'. + public partial struct NetworkMode : + System.IEquatable + { + /// This is no longer supported + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode Bridge = @"bridge"; + + /// + /// No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure CNI. See [Transparent Mode](https://docs.microsoft.com/azure/aks/faq#transparent-mode) + /// for more information. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode Transparent = @"transparent"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NetworkMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NetworkMode + /// 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.ContainerService.Support.NetworkMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NetworkMode (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 NetworkMode && Equals((NetworkMode)obj); + } + + /// Returns hashCode for enum NetworkMode + /// 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 NetworkMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NetworkMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NetworkMode + /// the value to convert to an instance of . + + public static implicit operator NetworkMode(string value) + { + return new NetworkMode(value); + } + + /// Implicit operator to convert NetworkMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode e) + { + return e._value; + } + + /// Overriding != operator for enum NetworkMode + /// 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.ContainerService.Support.NetworkMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NetworkMode + /// 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.ContainerService.Support.NetworkMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPlugin.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPlugin.Completer.cs new file mode 100644 index 000000000000..18032441dd47 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPlugin.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Network plugin used for building the Kubernetes network. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginTypeConverter))] + public partial struct NetworkPlugin : + 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) || "azure".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'azure'", "azure", global::System.Management.Automation.CompletionResultType.ParameterValue, "azure"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "kubenet".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'kubenet'", "kubenet", global::System.Management.Automation.CompletionResultType.ParameterValue, "kubenet"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPlugin.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPlugin.TypeConverter.cs new file mode 100644 index 000000000000..d15f82384ccd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPlugin.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Network plugin used for building the Kubernetes network. + public partial class NetworkPluginTypeConverter : + 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) => NetworkPlugin.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/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPlugin.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPlugin.cs new file mode 100644 index 000000000000..4f9ae0b3ca52 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPlugin.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.ContainerService.Support +{ + + /// Network plugin used for building the Kubernetes network. + public partial struct NetworkPlugin : + System.IEquatable + { + /// + /// Use the Azure CNI network plugin. See [Azure CNI (advanced) networking](https://docs.microsoft.com/azure/aks/concepts-network#azure-cni-advanced-networking) + /// for more information. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin Azure = @"azure"; + + /// + /// Use the Kubenet network plugin. See [Kubenet (basic) networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) + /// for more information. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin Kubenet = @"kubenet"; + + /// + /// Do not use a network plugin. A custom CNI will need to be installed after cluster creation for networking functionality. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin None = @"none"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NetworkPlugin + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkPlugin(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NetworkPlugin + /// 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.ContainerService.Support.NetworkPlugin e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NetworkPlugin (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 NetworkPlugin && Equals((NetworkPlugin)obj); + } + + /// Returns hashCode for enum NetworkPlugin + /// 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 NetworkPlugin(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NetworkPlugin + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NetworkPlugin + /// the value to convert to an instance of . + + public static implicit operator NetworkPlugin(string value) + { + return new NetworkPlugin(value); + } + + /// Implicit operator to convert NetworkPlugin to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin e) + { + return e._value; + } + + /// Overriding != operator for enum NetworkPlugin + /// 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.ContainerService.Support.NetworkPlugin e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NetworkPlugin + /// 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.ContainerService.Support.NetworkPlugin e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPlugin e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPluginMode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPluginMode.Completer.cs new file mode 100644 index 000000000000..accc72486b3c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPluginMode.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The mode the network plugin should use. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginModeTypeConverter))] + public partial struct NetworkPluginMode : + 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) || "overlay".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'overlay'", "overlay", global::System.Management.Automation.CompletionResultType.ParameterValue, "overlay"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPluginMode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPluginMode.TypeConverter.cs new file mode 100644 index 000000000000..3b60deaca3c0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPluginMode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The mode the network plugin should use. + public partial class NetworkPluginModeTypeConverter : + 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) => NetworkPluginMode.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/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPluginMode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPluginMode.cs new file mode 100644 index 000000000000..c9bbabb2665c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPluginMode.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.ContainerService.Support +{ + + /// The mode the network plugin should use. + public partial struct NetworkPluginMode : + System.IEquatable + { + /// + /// Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than Kubenet reference plugins + /// host-local and bridge. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode Overlay = @"overlay"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NetworkPluginMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkPluginMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NetworkPluginMode + /// 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.ContainerService.Support.NetworkPluginMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NetworkPluginMode (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 NetworkPluginMode && Equals((NetworkPluginMode)obj); + } + + /// Returns hashCode for enum NetworkPluginMode + /// 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 NetworkPluginMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NetworkPluginMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NetworkPluginMode + /// the value to convert to an instance of . + + public static implicit operator NetworkPluginMode(string value) + { + return new NetworkPluginMode(value); + } + + /// Implicit operator to convert NetworkPluginMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode e) + { + return e._value; + } + + /// Overriding != operator for enum NetworkPluginMode + /// 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.ContainerService.Support.NetworkPluginMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NetworkPluginMode + /// 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.ContainerService.Support.NetworkPluginMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPluginMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPolicy.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPolicy.Completer.cs new file mode 100644 index 000000000000..e174726b2a7f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPolicy.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Network policy used for building the Kubernetes network. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicyTypeConverter))] + public partial struct NetworkPolicy : + 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) || "calico".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'calico'", "calico", global::System.Management.Automation.CompletionResultType.ParameterValue, "calico"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "azure".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'azure'", "azure", global::System.Management.Automation.CompletionResultType.ParameterValue, "azure"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "cilium".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'cilium'", "cilium", global::System.Management.Automation.CompletionResultType.ParameterValue, "cilium"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPolicy.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPolicy.TypeConverter.cs new file mode 100644 index 000000000000..327b918ad73a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPolicy.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Network policy used for building the Kubernetes network. + public partial class NetworkPolicyTypeConverter : + 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) => NetworkPolicy.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/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPolicy.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPolicy.cs new file mode 100644 index 000000000000..a4ebba95275e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NetworkPolicy.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.ContainerService.Support +{ + + /// Network policy used for building the Kubernetes network. + public partial struct NetworkPolicy : + System.IEquatable + { + /// + /// Use Azure network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) + /// for more information. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy Azure = @"azure"; + + /// + /// Use Calico network policies. See [differences between Azure and Calico policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) + /// for more information. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy Calico = @"calico"; + + /// + /// Use Cilium to enforce network policies. This requires networkDataplane to be 'cilium'. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy Cilium = @"cilium"; + + /// + /// Network policies will not be enforced. This is the default value when NetworkPolicy is not specified. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy None = @"none"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NetworkPolicy + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NetworkPolicy(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NetworkPolicy + /// 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.ContainerService.Support.NetworkPolicy e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NetworkPolicy (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 NetworkPolicy && Equals((NetworkPolicy)obj); + } + + /// Returns hashCode for enum NetworkPolicy + /// 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 NetworkPolicy(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NetworkPolicy + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NetworkPolicy + /// the value to convert to an instance of . + + public static implicit operator NetworkPolicy(string value) + { + return new NetworkPolicy(value); + } + + /// Implicit operator to convert NetworkPolicy to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy e) + { + return e._value; + } + + /// Overriding != operator for enum NetworkPolicy + /// 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.ContainerService.Support.NetworkPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NetworkPolicy + /// 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.ContainerService.Support.NetworkPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NetworkPolicy e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeOSUpgradeChannel.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeOSUpgradeChannel.Completer.cs new file mode 100644 index 000000000000..8ae13439a285 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeOSUpgradeChannel.Completer.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannelTypeConverter))] + public partial struct NodeOSUpgradeChannel : + 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) || "Unmanaged".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unmanaged'", "Unmanaged", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unmanaged"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SecurityPatch".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SecurityPatch'", "SecurityPatch", global::System.Management.Automation.CompletionResultType.ParameterValue, "SecurityPatch"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NodeImage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NodeImage'", "NodeImage", global::System.Management.Automation.CompletionResultType.ParameterValue, "NodeImage"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeOSUpgradeChannel.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeOSUpgradeChannel.TypeConverter.cs new file mode 100644 index 000000000000..ab1b38437955 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeOSUpgradeChannel.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + public partial class NodeOSUpgradeChannelTypeConverter : + 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) => NodeOSUpgradeChannel.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/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeOSUpgradeChannel.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeOSUpgradeChannel.cs new file mode 100644 index 000000000000..d0c41082cdf0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeOSUpgradeChannel.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.ContainerService.Support +{ + + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + public partial struct NodeOSUpgradeChannel : + System.IEquatable + { + /// + /// AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a weekly cadence. With the + /// VHD update machines will be rolling reimaged to that VHD following maintenance windows and surge settings. No extra VHD + /// cost is incurred when choosing this option as AKS hosts the images. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel NodeImage = @"NodeImage"; + + /// + /// No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means you are responsible for + /// your security updates + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel None = @"None"; + + /// + /// AKS will update the nodes VHD with patches from the image maintainer labelled "security only" on a regular basis. Where + /// possible, patches will also be applied without reimaging to existing nodes. Some patches, such as kernel patches, cannot + /// be applied to existing nodes without disruption. For such patches, the VHD will be updated, and machines will be rolling + /// reimaged to that VHD following maintenance windows and surge settings. This option incurs the extra cost of hosting the + /// VHDs in your node resource group. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel SecurityPatch = @"SecurityPatch"; + + /// + /// OS updates will be applied automatically through the OS built-in patching infrastructure. Newly scaled in machines will + /// be unpatched initially, and will be patched at some later time by the OS's infrastructure. Behavior of this option depends + /// on the OS in question. Ubuntu and Mariner apply security patches through unattended upgrade roughly once a day around + /// 06:00 UTC. Windows does not apply security patches automatically and so for them this option is equivalent to None till + /// further notice + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel Unmanaged = @"Unmanaged"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NodeOSUpgradeChannel + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NodeOSUpgradeChannel(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NodeOSUpgradeChannel + /// 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.ContainerService.Support.NodeOSUpgradeChannel e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NodeOSUpgradeChannel (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 NodeOSUpgradeChannel && Equals((NodeOSUpgradeChannel)obj); + } + + /// Returns hashCode for enum NodeOSUpgradeChannel + /// 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 NodeOSUpgradeChannel(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NodeOSUpgradeChannel + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NodeOSUpgradeChannel + /// the value to convert to an instance of . + + public static implicit operator NodeOSUpgradeChannel(string value) + { + return new NodeOSUpgradeChannel(value); + } + + /// Implicit operator to convert NodeOSUpgradeChannel to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel e) + { + return e._value; + } + + /// Overriding != operator for enum NodeOSUpgradeChannel + /// 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.ContainerService.Support.NodeOSUpgradeChannel e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NodeOSUpgradeChannel + /// 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.ContainerService.Support.NodeOSUpgradeChannel e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeProvisioningMode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeProvisioningMode.Completer.cs new file mode 100644 index 000000000000..5c594bdc27a6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeProvisioningMode.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Once the mode it set to Auto, it cannot be changed back to Manual. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningModeTypeConverter))] + public partial struct NodeProvisioningMode : + 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) || "Manual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Manual'", "Manual", global::System.Management.Automation.CompletionResultType.ParameterValue, "Manual"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Auto".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Auto'", "Auto", global::System.Management.Automation.CompletionResultType.ParameterValue, "Auto"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeProvisioningMode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeProvisioningMode.TypeConverter.cs new file mode 100644 index 000000000000..a95cd3ffb8d1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeProvisioningMode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Once the mode it set to Auto, it cannot be changed back to Manual. + public partial class NodeProvisioningModeTypeConverter : + 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) => NodeProvisioningMode.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/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeProvisioningMode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeProvisioningMode.cs new file mode 100644 index 000000000000..b641e17f5e1c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/NodeProvisioningMode.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Once the mode it set to Auto, it cannot be changed back to Manual. + public partial struct NodeProvisioningMode : + System.IEquatable + { + /// + /// Nodes are provisioned automatically by AKS using Karpenter. Fixed size Node Pools can still be created, but autoscaling + /// Node Pools cannot be. (See aka.ms/aks/nap for more details). + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode Auto = @"Auto"; + + /// Nodes are provisioned manually by the user + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode Manual = @"Manual"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to NodeProvisioningMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new NodeProvisioningMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type NodeProvisioningMode + /// 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.ContainerService.Support.NodeProvisioningMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type NodeProvisioningMode (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 NodeProvisioningMode && Equals((NodeProvisioningMode)obj); + } + + /// Returns hashCode for enum NodeProvisioningMode + /// 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 NodeProvisioningMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for NodeProvisioningMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to NodeProvisioningMode + /// the value to convert to an instance of . + + public static implicit operator NodeProvisioningMode(string value) + { + return new NodeProvisioningMode(value); + } + + /// Implicit operator to convert NodeProvisioningMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode e) + { + return e._value; + } + + /// Overriding != operator for enum NodeProvisioningMode + /// 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.ContainerService.Support.NodeProvisioningMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum NodeProvisioningMode + /// 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.ContainerService.Support.NodeProvisioningMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/OSDiskType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSDiskType.Completer.cs new file mode 100644 index 000000000000..4db5771020df --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSDiskType.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskTypeTypeConverter))] + public partial struct OSDiskType : + 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) || "Managed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Managed'", "Managed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Managed"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/OSDiskType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSDiskType.TypeConverter.cs new file mode 100644 index 000000000000..d41bcbd1e5f2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSDiskType.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + public partial class OSDiskTypeTypeConverter : + 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) => OSDiskType.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/swaggerci/containerservice.DefaultTag/generated/api/Support/OSDiskType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSDiskType.cs new file mode 100644 index 000000000000..1257a0a8ba9d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSDiskType.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.ContainerService.Support +{ + + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + public partial struct OSDiskType : + System.IEquatable + { + /// + /// Ephemeral OS disks are stored only on the host machine, just like a temporary disk. This provides lower read/write latency, + /// along with faster node scaling and cluster upgrades. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType Ephemeral = @"Ephemeral"; + + /// + /// Azure replicates the operating system disk for a virtual machine to Azure storage to avoid data loss should the VM need + /// to be relocated to another host. Since containers aren't designed to have local state persisted, this behavior offers + /// limited value while providing some drawbacks, including slower node provisioning and higher read/write latency. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType Managed = @"Managed"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OSDiskType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OSDiskType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OSDiskType + /// 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.ContainerService.Support.OSDiskType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OSDiskType (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 OSDiskType && Equals((OSDiskType)obj); + } + + /// Returns hashCode for enum OSDiskType + /// 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 OSDiskType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OSDiskType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OSDiskType + /// the value to convert to an instance of . + + public static implicit operator OSDiskType(string value) + { + return new OSDiskType(value); + } + + /// Implicit operator to convert OSDiskType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType e) + { + return e._value; + } + + /// Overriding != operator for enum OSDiskType + /// 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.ContainerService.Support.OSDiskType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OSDiskType + /// 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.ContainerService.Support.OSDiskType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/OSType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSType.Completer.cs new file mode 100644 index 000000000000..4969eadba2ff --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSType.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The operating system type. The default is Linux. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSTypeTypeConverter))] + public partial struct OSType : + 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) || "Linux".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Linux'", "Linux", global::System.Management.Automation.CompletionResultType.ParameterValue, "Linux"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Windows".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Windows'", "Windows", global::System.Management.Automation.CompletionResultType.ParameterValue, "Windows"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/OSType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSType.TypeConverter.cs new file mode 100644 index 000000000000..63338fa9873a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The operating system type. The default is Linux. + public partial class OSTypeTypeConverter : + 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) => OSType.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/swaggerci/containerservice.DefaultTag/generated/api/Support/OSType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSType.cs new file mode 100644 index 000000000000..634883484a2a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/OSType.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.ContainerService.Support +{ + + /// The operating system type. The default is Linux. + public partial struct OSType : + System.IEquatable + { + /// Use Linux. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType Linux = @"Linux"; + + /// Use Windows. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType Windows = @"Windows"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OSType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OSType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OSType + /// 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.ContainerService.Support.OSType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OSType (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 OSType && Equals((OSType)obj); + } + + /// Returns hashCode for enum OSType + /// 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 OSType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OSType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OSType + /// the value to convert to an instance of . + + public static implicit operator OSType(string value) + { + return new OSType(value); + } + + /// Implicit operator to convert OSType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType e) + { + return e._value; + } + + /// Overriding != operator for enum OSType + /// 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.ContainerService.Support.OSType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OSType + /// 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.ContainerService.Support.OSType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Operator.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Operator.Completer.cs new file mode 100644 index 000000000000..edca09be4d46 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Operator.Completer.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// operator represents a key's relationship to a set of values. Valid operators are In and NotIn + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OperatorTypeConverter))] + public partial struct Operator : + 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) || "In".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'In'", "In", global::System.Management.Automation.CompletionResultType.ParameterValue, "In"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotIn".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotIn'", "NotIn", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotIn"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Exists".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Exists'", "Exists", global::System.Management.Automation.CompletionResultType.ParameterValue, "Exists"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DoesNotExist".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DoesNotExist'", "DoesNotExist", global::System.Management.Automation.CompletionResultType.ParameterValue, "DoesNotExist"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Operator.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Operator.TypeConverter.cs new file mode 100644 index 000000000000..e5d5d4c444b0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Operator.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// operator represents a key's relationship to a set of values. Valid operators are In and NotIn + /// + public partial class OperatorTypeConverter : + 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) => Operator.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/swaggerci/containerservice.DefaultTag/generated/api/Support/Operator.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Operator.cs new file mode 100644 index 000000000000..0fe2bb7b0df6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Operator.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.ContainerService.Support +{ + + /// + /// operator represents a key's relationship to a set of values. Valid operators are In and NotIn + /// + public partial struct Operator : + System.IEquatable + { + /// The value of the key should not exist. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator DoesNotExist = @"DoesNotExist"; + + /// The value of the key should exist. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator Exists = @"Exists"; + + /// The value of the key should be in the given list. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator In = @"In"; + + /// The value of the key should not be in the given list. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator NotIn = @"NotIn"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Operator + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Operator(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Operator + /// 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.ContainerService.Support.Operator e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Operator (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 Operator && Equals((Operator)obj); + } + + /// Returns hashCode for enum Operator + /// 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 Operator(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Operator + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Operator + /// the value to convert to an instance of . + + public static implicit operator Operator(string value) + { + return new Operator(value); + } + + /// Implicit operator to convert Operator to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator e) + { + return e._value; + } + + /// Overriding != operator for enum Operator + /// 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.ContainerService.Support.Operator e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Operator + /// 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.ContainerService.Support.Operator e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Operator e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Ossku.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Ossku.Completer.cs new file mode 100644 index 000000000000..9aa8c6e688a6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Ossku.Completer.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.ContainerService.Support +{ + + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OsskuTypeConverter))] + public partial struct Ossku : + 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) || "Ubuntu".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Ubuntu'", "Ubuntu", global::System.Management.Automation.CompletionResultType.ParameterValue, "Ubuntu"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Mariner".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Mariner'", "Mariner", global::System.Management.Automation.CompletionResultType.ParameterValue, "Mariner"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureLinux".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureLinux'", "AzureLinux", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureLinux"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CBLMariner".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CBLMariner'", "CBLMariner", global::System.Management.Automation.CompletionResultType.ParameterValue, "CBLMariner"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Windows2019".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Windows2019'", "Windows2019", global::System.Management.Automation.CompletionResultType.ParameterValue, "Windows2019"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Windows2022".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Windows2022'", "Windows2022", global::System.Management.Automation.CompletionResultType.ParameterValue, "Windows2022"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WindowsAnnual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WindowsAnnual'", "WindowsAnnual", global::System.Management.Automation.CompletionResultType.ParameterValue, "WindowsAnnual"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Ossku.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Ossku.TypeConverter.cs new file mode 100644 index 000000000000..6204b7a06481 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Ossku.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + public partial class OsskuTypeConverter : + 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) => Ossku.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/swaggerci/containerservice.DefaultTag/generated/api/Support/Ossku.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Ossku.cs new file mode 100644 index 000000000000..8706d96e59e9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Ossku.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + public partial struct Ossku : + System.IEquatable + { + /// + /// Use AzureLinux as the OS for node images. Azure Linux is a container-optimized Linux distro built by Microsoft, visit + /// https://aka.ms/azurelinux for more information. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku AzureLinux = @"AzureLinux"; + + /// + /// Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku CblMariner = @"CBLMariner"; + + /// + /// Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku Mariner = @"Mariner"; + + /// Use Ubuntu as the OS for node images. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku Ubuntu = @"Ubuntu"; + + /// + /// Use Windows2019 as the OS for node images. Unsupported for system node pools. Windows2019 only supports Windows2019 containers; + /// it cannot run Windows2022 containers and vice versa. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku Windows2019 = @"Windows2019"; + + /// + /// Use Windows2022 as the OS for node images. Unsupported for system node pools. Windows2022 only supports Windows2022 containers; + /// it cannot run Windows2019 containers and vice versa. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku Windows2022 = @"Windows2022"; + + /// + /// Use Windows Annual Channel version as the OS for node images. Unsupported for system node pools. Details about supported + /// container images and kubernetes versions under different AKS Annual Channel versions could be seen in https://aka.ms/aks/windows-annual-channel-details. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku WindowsAnnual = @"WindowsAnnual"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Ossku + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Ossku(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Ossku + /// 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.ContainerService.Support.Ossku e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Ossku (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 Ossku && Equals((Ossku)obj); + } + + /// Returns hashCode for enum Ossku + /// 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 Ossku(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Ossku + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Ossku + /// the value to convert to an instance of . + + public static implicit operator Ossku(string value) + { + return new Ossku(value); + } + + /// Implicit operator to convert Ossku to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku e) + { + return e._value; + } + + /// Overriding != operator for enum Ossku + /// 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.ContainerService.Support.Ossku e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Ossku + /// 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.ContainerService.Support.Ossku e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/OutboundType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/OutboundType.Completer.cs new file mode 100644 index 000000000000..36197114155f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/OutboundType.Completer.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundTypeTypeConverter))] + public partial struct OutboundType : + 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) || "loadBalancer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'loadBalancer'", "loadBalancer", global::System.Management.Automation.CompletionResultType.ParameterValue, "loadBalancer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "userDefinedRouting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'userDefinedRouting'", "userDefinedRouting", global::System.Management.Automation.CompletionResultType.ParameterValue, "userDefinedRouting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "managedNATGateway".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'managedNATGateway'", "managedNATGateway", global::System.Management.Automation.CompletionResultType.ParameterValue, "managedNATGateway"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "userAssignedNATGateway".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'userAssignedNATGateway'", "userAssignedNATGateway", global::System.Management.Automation.CompletionResultType.ParameterValue, "userAssignedNATGateway"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/OutboundType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/OutboundType.TypeConverter.cs new file mode 100644 index 000000000000..1a1a03e5214c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/OutboundType.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + /// + public partial class OutboundTypeTypeConverter : + 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) => OutboundType.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/swaggerci/containerservice.DefaultTag/generated/api/Support/OutboundType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/OutboundType.cs new file mode 100644 index 000000000000..d69cfe1c29f2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/OutboundType.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.ContainerService.Support +{ + + /// + /// This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + /// + public partial struct OutboundType : + System.IEquatable + { + /// + /// The load balancer is used for egress through an AKS assigned public IP. This supports Kubernetes services of type 'loadBalancer'. + /// For more information see [outbound type loadbalancer](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-loadbalancer). + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType LoadBalancer = @"loadBalancer"; + + /// The AKS-managed NAT gateway is used for egress. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType ManagedNatGateway = @"managedNATGateway"; + + /// + /// The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an advanced scenario and requires + /// proper network configuration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType UserAssignedNatGateway = @"userAssignedNATGateway"; + + /// + /// Egress paths must be defined by the user. This is an advanced scenario and requires proper network configuration. For + /// more information see [outbound type userDefinedRouting](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-userdefinedrouting). + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType UserDefinedRouting = @"userDefinedRouting"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to OutboundType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new OutboundType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type OutboundType + /// 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.ContainerService.Support.OutboundType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type OutboundType (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 OutboundType && Equals((OutboundType)obj); + } + + /// Returns hashCode for enum OutboundType + /// 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 OutboundType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for OutboundType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to OutboundType + /// the value to convert to an instance of . + + public static implicit operator OutboundType(string value) + { + return new OutboundType(value); + } + + /// Implicit operator to convert OutboundType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType e) + { + return e._value; + } + + /// Overriding != operator for enum OutboundType + /// 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.ContainerService.Support.OutboundType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum OutboundType + /// 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.ContainerService.Support.OutboundType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OutboundType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/PodIPAllocationMode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/PodIPAllocationMode.Completer.cs new file mode 100644 index 000000000000..0d65961fd1f6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/PodIPAllocationMode.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationModeTypeConverter))] + public partial struct PodIPAllocationMode : + 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) || "DynamicIndividual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DynamicIndividual'", "DynamicIndividual", global::System.Management.Automation.CompletionResultType.ParameterValue, "DynamicIndividual"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StaticBlock".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StaticBlock'", "StaticBlock", global::System.Management.Automation.CompletionResultType.ParameterValue, "StaticBlock"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/PodIPAllocationMode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/PodIPAllocationMode.TypeConverter.cs new file mode 100644 index 000000000000..8642088ed342 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/PodIPAllocationMode.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + public partial class PodIPAllocationModeTypeConverter : + 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) => PodIPAllocationMode.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/swaggerci/containerservice.DefaultTag/generated/api/Support/PodIPAllocationMode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/PodIPAllocationMode.cs new file mode 100644 index 000000000000..ab6339a600ec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/PodIPAllocationMode.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.ContainerService.Support +{ + + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + public partial struct PodIPAllocationMode : + System.IEquatable + { + /// + /// Each pod gets a single IP address assigned. This is better for maximizing a small to medium subnet of size /16 or smaller. + /// The Azure CNI cluster with dynamic IP allocation defaults to this mode if the customer does not explicitly specify a podIPAllocationMode + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode DynamicIndividual = @"DynamicIndividual"; + + /// + /// Each node is statically allocated CIDR block(s) of size /28 = 16 IPs per block to satisfy the maxPods per node. Number + /// of CIDR blocks >= (maxPods / 16). The block, rather than a single IP, counts against the Azure Vnet Private IP limit of + /// 65K. Therefore block mode is suitable for running larger workloads with more than the current limit of 65K pods in a cluster. + /// This mode is better suited to scale with larger subnets of /15 or bigger + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode StaticBlock = @"StaticBlock"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PodIPAllocationMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PodIPAllocationMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PodIPAllocationMode + /// 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.ContainerService.Support.PodIPAllocationMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PodIPAllocationMode (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 PodIPAllocationMode && Equals((PodIPAllocationMode)obj); + } + + /// Returns hashCode for enum PodIPAllocationMode + /// 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 PodIPAllocationMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PodIPAllocationMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PodIPAllocationMode + /// the value to convert to an instance of . + + public static implicit operator PodIPAllocationMode(string value) + { + return new PodIPAllocationMode(value); + } + + /// Implicit operator to convert PodIPAllocationMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode e) + { + return e._value; + } + + /// Overriding != operator for enum PodIPAllocationMode + /// 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.ContainerService.Support.PodIPAllocationMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PodIPAllocationMode + /// 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.ContainerService.Support.PodIPAllocationMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs new file mode 100644 index 000000000000..63c56fb578e2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The current provisioning state. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningStateTypeConverter))] + public partial struct PrivateEndpointConnectionProvisioningState : + 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) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..509500a4bb62 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The current provisioning state. + public partial class PrivateEndpointConnectionProvisioningStateTypeConverter : + 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) => PrivateEndpointConnectionProvisioningState.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/swaggerci/containerservice.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 000000000000..6a53f0b2bfda --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The current provisioning state. + public partial struct PrivateEndpointConnectionProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState Succeeded = @"Succeeded"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PrivateEndpointConnectionProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PrivateEndpointConnectionProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PrivateEndpointConnectionProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PrivateEndpointConnectionProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PrivateEndpointConnectionProvisioningState && Equals((PrivateEndpointConnectionProvisioningState)obj); + } + + /// Returns hashCode for enum PrivateEndpointConnectionProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private PrivateEndpointConnectionProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PrivateEndpointConnectionProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// + /// Implicit operator to convert string to PrivateEndpointConnectionProvisioningState + /// + /// the value to convert to an instance of . + + public static implicit operator PrivateEndpointConnectionProvisioningState(string value) + { + return new PrivateEndpointConnectionProvisioningState(value); + } + + /// + /// Implicit operator to convert PrivateEndpointConnectionProvisioningState to string + /// + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum PrivateEndpointConnectionProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PrivateEndpointConnectionProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PrivateEndpointConnectionProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Protocol.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Protocol.Completer.cs new file mode 100644 index 000000000000..c31e0ed06201 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Protocol.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The network protocol of the port. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ProtocolTypeConverter))] + public partial struct Protocol : + 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) || "TCP".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TCP'", "TCP", global::System.Management.Automation.CompletionResultType.ParameterValue, "TCP"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UDP".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UDP'", "UDP", global::System.Management.Automation.CompletionResultType.ParameterValue, "UDP"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Protocol.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Protocol.TypeConverter.cs new file mode 100644 index 000000000000..17925d36c1d1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Protocol.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The network protocol of the port. + public partial class ProtocolTypeConverter : + 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) => Protocol.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/swaggerci/containerservice.DefaultTag/generated/api/Support/Protocol.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Protocol.cs new file mode 100644 index 000000000000..bd08f84d0834 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Protocol.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.ContainerService.Support +{ + + /// The network protocol of the port. + public partial struct Protocol : + System.IEquatable + { + /// TCP protocol. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol Tcp = @"TCP"; + + /// UDP protocol. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol Udp = @"UDP"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Protocol + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Protocol(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Protocol + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Protocol (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Protocol && Equals((Protocol)obj); + } + + /// Returns hashCode for enum Protocol + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Protocol(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Protocol + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Protocol + /// the value to convert to an instance of . + + public static implicit operator Protocol(string value) + { + return new Protocol(value); + } + + /// Implicit operator to convert Protocol to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol e) + { + return e._value; + } + + /// Overriding != operator for enum Protocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Protocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Protocol e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/PublicNetworkAccess.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/PublicNetworkAccess.Completer.cs new file mode 100644 index 000000000000..f4e9f9f3abb6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/PublicNetworkAccess.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Allow or deny public network access for AKS + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccessTypeConverter))] + public partial struct PublicNetworkAccess : + 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) || "SecuredByPerimeter".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SecuredByPerimeter'", "SecuredByPerimeter", global::System.Management.Automation.CompletionResultType.ParameterValue, "SecuredByPerimeter"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/PublicNetworkAccess.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/PublicNetworkAccess.TypeConverter.cs new file mode 100644 index 000000000000..0dc228a12e52 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/PublicNetworkAccess.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Allow or deny public network access for AKS + public partial class PublicNetworkAccessTypeConverter : + 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) => PublicNetworkAccess.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/swaggerci/containerservice.DefaultTag/generated/api/Support/PublicNetworkAccess.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/PublicNetworkAccess.cs new file mode 100644 index 000000000000..4fa5b55ca8b0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/PublicNetworkAccess.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.ContainerService.Support +{ + + /// Allow or deny public network access for AKS + public partial struct PublicNetworkAccess : + System.IEquatable + { + /// + /// Inbound traffic to managedCluster is disabled, traffic from managedCluster is allowed. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess Disabled = @"Disabled"; + + /// Inbound/Outbound to the managedCluster is allowed. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess Enabled = @"Enabled"; + + /// + /// Inbound/Outbound traffic is managed by Microsoft.Network/NetworkSecurityPerimeters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess SecuredByPerimeter = @"SecuredByPerimeter"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PublicNetworkAccess + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PublicNetworkAccess(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PublicNetworkAccess + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PublicNetworkAccess (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PublicNetworkAccess && Equals((PublicNetworkAccess)obj); + } + + /// Returns hashCode for enum PublicNetworkAccess + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PublicNetworkAccess(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PublicNetworkAccess + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PublicNetworkAccess + /// the value to convert to an instance of . + + public static implicit operator PublicNetworkAccess(string value) + { + return new PublicNetworkAccess(value); + } + + /// Implicit operator to convert PublicNetworkAccess to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess e) + { + return e._value; + } + + /// Overriding != operator for enum PublicNetworkAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PublicNetworkAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ResourceIdentityType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ResourceIdentityType.Completer.cs new file mode 100644 index 000000000000..a1357795d421 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ResourceIdentityType.Completer.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityTypeTypeConverter))] + public partial struct ResourceIdentityType : + 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) || "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) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ResourceIdentityType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ResourceIdentityType.TypeConverter.cs new file mode 100644 index 000000000000..4efce7fd8ee7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ResourceIdentityType.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + public partial class ResourceIdentityTypeTypeConverter : + 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) => ResourceIdentityType.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ResourceIdentityType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ResourceIdentityType.cs new file mode 100644 index 000000000000..7e9e0878dce8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ResourceIdentityType.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.ContainerService.Support +{ + + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + public partial struct ResourceIdentityType : + System.IEquatable + { + /// + /// Do not use a managed identity for the Managed Cluster, service principal will be used instead. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType None = @"None"; + + /// + /// Use an implicitly created system assigned managed identity to manage cluster resources. Master components in the control + /// plane such as kube-controller-manager will use the system assigned managed identity to manipulate Azure resources. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType SystemAssigned = @"SystemAssigned"; + + /// + /// Use a user-specified identity to manage cluster resources. Master components in the control plane such as kube-controller-manager + /// will use the specified user assigned managed identity to manipulate Azure resources. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType UserAssigned = @"UserAssigned"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ResourceIdentityType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ResourceIdentityType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ResourceIdentityType + /// 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.ContainerService.Support.ResourceIdentityType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ResourceIdentityType (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 ResourceIdentityType && Equals((ResourceIdentityType)obj); + } + + /// Returns hashCode for enum ResourceIdentityType + /// 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 ResourceIdentityType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ResourceIdentityType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ResourceIdentityType + /// the value to convert to an instance of . + + public static implicit operator ResourceIdentityType(string value) + { + return new ResourceIdentityType(value); + } + + /// Implicit operator to convert ResourceIdentityType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType e) + { + return e._value; + } + + /// Overriding != operator for enum ResourceIdentityType + /// 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.ContainerService.Support.ResourceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ResourceIdentityType + /// 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.ContainerService.Support.ResourceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/RestrictionLevel.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/RestrictionLevel.Completer.cs new file mode 100644 index 000000000000..36623541f7ed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/RestrictionLevel.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The restriction level applied to the cluster's node resource group + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevelTypeConverter))] + public partial struct RestrictionLevel : + 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) || "Unrestricted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unrestricted'", "Unrestricted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unrestricted"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/RestrictionLevel.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/RestrictionLevel.TypeConverter.cs new file mode 100644 index 000000000000..f5e910929cbb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/RestrictionLevel.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The restriction level applied to the cluster's node resource group + public partial class RestrictionLevelTypeConverter : + 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) => RestrictionLevel.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/swaggerci/containerservice.DefaultTag/generated/api/Support/RestrictionLevel.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/RestrictionLevel.cs new file mode 100644 index 000000000000..403c6a99ed78 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/RestrictionLevel.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.ContainerService.Support +{ + + /// The restriction level applied to the cluster's node resource group + public partial struct RestrictionLevel : + System.IEquatable + { + /// Only */read RBAC permissions allowed on the managed node resource group + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel ReadOnly = @"ReadOnly"; + + /// All RBAC permissions are allowed on the managed node resource group + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel Unrestricted = @"Unrestricted"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RestrictionLevel + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RestrictionLevel(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RestrictionLevel + /// 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.ContainerService.Support.RestrictionLevel e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RestrictionLevel (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 RestrictionLevel && Equals((RestrictionLevel)obj); + } + + /// Returns hashCode for enum RestrictionLevel + /// 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 RestrictionLevel(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RestrictionLevel + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RestrictionLevel + /// the value to convert to an instance of . + + public static implicit operator RestrictionLevel(string value) + { + return new RestrictionLevel(value); + } + + /// Implicit operator to convert RestrictionLevel to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel e) + { + return e._value; + } + + /// Overriding != operator for enum RestrictionLevel + /// 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.ContainerService.Support.RestrictionLevel e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RestrictionLevel + /// 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.ContainerService.Support.RestrictionLevel e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/SafeguardsSupport.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/SafeguardsSupport.Completer.cs new file mode 100644 index 000000000000..5ee3acd45d32 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/SafeguardsSupport.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Whether the version is preview or stable. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupportTypeConverter))] + public partial struct SafeguardsSupport : + 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) || "Stable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Stable'", "Stable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stable"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/SafeguardsSupport.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/SafeguardsSupport.TypeConverter.cs new file mode 100644 index 000000000000..7cf8b26a5108 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/SafeguardsSupport.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Whether the version is preview or stable. + public partial class SafeguardsSupportTypeConverter : + 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) => SafeguardsSupport.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/swaggerci/containerservice.DefaultTag/generated/api/Support/SafeguardsSupport.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/SafeguardsSupport.cs new file mode 100644 index 000000000000..38e230beabe2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/SafeguardsSupport.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Whether the version is preview or stable. + public partial struct SafeguardsSupport : + System.IEquatable + { + /// + /// The version is preview. It is not recommended to use preview versions on critical production clusters. The preview version + /// may not support all use-cases. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport Preview = @"Preview"; + + /// The version is stable and can be used on critical production clusters. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport Stable = @"Stable"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SafeguardsSupport + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SafeguardsSupport(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SafeguardsSupport + /// 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.ContainerService.Support.SafeguardsSupport e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SafeguardsSupport (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 SafeguardsSupport && Equals((SafeguardsSupport)obj); + } + + /// Returns hashCode for enum SafeguardsSupport + /// 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 SafeguardsSupport(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SafeguardsSupport + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SafeguardsSupport + /// the value to convert to an instance of . + + public static implicit operator SafeguardsSupport(string value) + { + return new SafeguardsSupport(value); + } + + /// Implicit operator to convert SafeguardsSupport to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport e) + { + return e._value; + } + + /// Overriding != operator for enum SafeguardsSupport + /// 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.ContainerService.Support.SafeguardsSupport e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SafeguardsSupport + /// 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.ContainerService.Support.SafeguardsSupport e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SafeguardsSupport e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleDownMode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleDownMode.Completer.cs new file mode 100644 index 000000000000..dc9479ea1489 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleDownMode.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Describes how VMs are added to or removed from Agent Pools. See [billing states](https://docs.microsoft.com/azure/virtual-machines/states-billing). + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownModeTypeConverter))] + public partial struct ScaleDownMode : + 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"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deallocate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deallocate'", "Deallocate", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deallocate"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleDownMode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleDownMode.TypeConverter.cs new file mode 100644 index 000000000000..d9b8de083de4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleDownMode.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Describes how VMs are added to or removed from Agent Pools. See [billing states](https://docs.microsoft.com/azure/virtual-machines/states-billing). + /// + public partial class ScaleDownModeTypeConverter : + 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) => ScaleDownMode.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleDownMode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleDownMode.cs new file mode 100644 index 000000000000..b36fb3a20b07 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleDownMode.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.ContainerService.Support +{ + + /// + /// Describes how VMs are added to or removed from Agent Pools. See [billing states](https://docs.microsoft.com/azure/virtual-machines/states-billing). + /// + public partial struct ScaleDownMode : + System.IEquatable + { + /// + /// Attempt to start deallocated instances (if they exist) during scale up and deallocate instances during scale down. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode Deallocate = @"Deallocate"; + + /// Create new instances during scale up and remove instances during scale down. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode Delete = @"Delete"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ScaleDownMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ScaleDownMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ScaleDownMode + /// 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.ContainerService.Support.ScaleDownMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ScaleDownMode (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 ScaleDownMode && Equals((ScaleDownMode)obj); + } + + /// Returns hashCode for enum ScaleDownMode + /// 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 ScaleDownMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ScaleDownMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ScaleDownMode + /// the value to convert to an instance of . + + public static implicit operator ScaleDownMode(string value) + { + return new ScaleDownMode(value); + } + + /// Implicit operator to convert ScaleDownMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode e) + { + return e._value; + } + + /// Overriding != operator for enum ScaleDownMode + /// 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.ContainerService.Support.ScaleDownMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ScaleDownMode + /// 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.ContainerService.Support.ScaleDownMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetEvictionPolicy.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetEvictionPolicy.Completer.cs new file mode 100644 index 000000000000..31d7b9875d10 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetEvictionPolicy.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about + /// eviction see [spot VMs](https://docs.microsoft.com/azure/virtual-machines/spot-vms) + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicyTypeConverter))] + public partial struct ScaleSetEvictionPolicy : + 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"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deallocate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deallocate'", "Deallocate", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deallocate"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetEvictionPolicy.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetEvictionPolicy.TypeConverter.cs new file mode 100644 index 000000000000..75abbc9c6c21 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetEvictionPolicy.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about + /// eviction see [spot VMs](https://docs.microsoft.com/azure/virtual-machines/spot-vms) + /// + public partial class ScaleSetEvictionPolicyTypeConverter : + 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) => ScaleSetEvictionPolicy.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetEvictionPolicy.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetEvictionPolicy.cs new file mode 100644 index 000000000000..3066a77117a4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetEvictionPolicy.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.ContainerService.Support +{ + + /// + /// The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about + /// eviction see [spot VMs](https://docs.microsoft.com/azure/virtual-machines/spot-vms) + /// + public partial struct ScaleSetEvictionPolicy : + System.IEquatable + { + /// + /// Nodes in the underlying Scale Set of the node pool are set to the stopped-deallocated state upon eviction. Nodes in the + /// stopped-deallocated state count against your compute quota and can cause issues with cluster scaling or upgrading. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy Deallocate = @"Deallocate"; + + /// + /// Nodes in the underlying Scale Set of the node pool are deleted when they're evicted. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy Delete = @"Delete"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ScaleSetEvictionPolicy + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ScaleSetEvictionPolicy(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ScaleSetEvictionPolicy + /// 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.ContainerService.Support.ScaleSetEvictionPolicy e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ScaleSetEvictionPolicy (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 ScaleSetEvictionPolicy && Equals((ScaleSetEvictionPolicy)obj); + } + + /// Returns hashCode for enum ScaleSetEvictionPolicy + /// 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 ScaleSetEvictionPolicy(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ScaleSetEvictionPolicy + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ScaleSetEvictionPolicy + /// the value to convert to an instance of . + + public static implicit operator ScaleSetEvictionPolicy(string value) + { + return new ScaleSetEvictionPolicy(value); + } + + /// Implicit operator to convert ScaleSetEvictionPolicy to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy e) + { + return e._value; + } + + /// Overriding != operator for enum ScaleSetEvictionPolicy + /// 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.ContainerService.Support.ScaleSetEvictionPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ScaleSetEvictionPolicy + /// 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.ContainerService.Support.ScaleSetEvictionPolicy e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetPriority.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetPriority.Completer.cs new file mode 100644 index 000000000000..c20f9d37ca17 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetPriority.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The Virtual Machine Scale Set priority. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriorityTypeConverter))] + public partial struct ScaleSetPriority : + 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) || "Spot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Spot'", "Spot", global::System.Management.Automation.CompletionResultType.ParameterValue, "Spot"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Regular".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Regular'", "Regular", global::System.Management.Automation.CompletionResultType.ParameterValue, "Regular"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetPriority.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetPriority.TypeConverter.cs new file mode 100644 index 000000000000..8bd2f7c0e02c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetPriority.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The Virtual Machine Scale Set priority. + public partial class ScaleSetPriorityTypeConverter : + 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) => ScaleSetPriority.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetPriority.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetPriority.cs new file mode 100644 index 000000000000..83004a527c60 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ScaleSetPriority.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The Virtual Machine Scale Set priority. + public partial struct ScaleSetPriority : + System.IEquatable + { + /// Regular VMs will be used. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority Regular = @"Regular"; + + /// + /// Spot priority VMs will be used. There is no SLA for spot nodes. See [spot on AKS](https://docs.microsoft.com/azure/aks/spot-node-pool) + /// for more information. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority Spot = @"Spot"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ScaleSetPriority + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ScaleSetPriority(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ScaleSetPriority + /// 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.ContainerService.Support.ScaleSetPriority e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ScaleSetPriority (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 ScaleSetPriority && Equals((ScaleSetPriority)obj); + } + + /// Returns hashCode for enum ScaleSetPriority + /// 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 ScaleSetPriority(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ScaleSetPriority + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ScaleSetPriority + /// the value to convert to an instance of . + + public static implicit operator ScaleSetPriority(string value) + { + return new ScaleSetPriority(value); + } + + /// Implicit operator to convert ScaleSetPriority to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority e) + { + return e._value; + } + + /// Overriding != operator for enum ScaleSetPriority + /// 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.ContainerService.Support.ScaleSetPriority e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ScaleSetPriority + /// 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.ContainerService.Support.ScaleSetPriority e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/ServiceMeshMode.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ServiceMeshMode.Completer.cs new file mode 100644 index 000000000000..1fd5bb8ae38e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ServiceMeshMode.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Mode of the service mesh. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshModeTypeConverter))] + public partial struct ServiceMeshMode : + 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) || "Istio".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Istio'", "Istio", global::System.Management.Automation.CompletionResultType.ParameterValue, "Istio"); + } + 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/swaggerci/containerservice.DefaultTag/generated/api/Support/ServiceMeshMode.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ServiceMeshMode.TypeConverter.cs new file mode 100644 index 000000000000..b55b4dbcffd4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ServiceMeshMode.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Mode of the service mesh. + public partial class ServiceMeshModeTypeConverter : + 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) => ServiceMeshMode.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/swaggerci/containerservice.DefaultTag/generated/api/Support/ServiceMeshMode.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/ServiceMeshMode.cs new file mode 100644 index 000000000000..75d2f03c3aec --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/ServiceMeshMode.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.ContainerService.Support +{ + + /// Mode of the service mesh. + public partial struct ServiceMeshMode : + System.IEquatable + { + /// Mesh is disabled. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode Disabled = @"Disabled"; + + /// Istio deployed as an AKS addon. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode Istio = @"Istio"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ServiceMeshMode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ServiceMeshMode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ServiceMeshMode + /// 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.ContainerService.Support.ServiceMeshMode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ServiceMeshMode (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 ServiceMeshMode && Equals((ServiceMeshMode)obj); + } + + /// Returns hashCode for enum ServiceMeshMode + /// 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 ServiceMeshMode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ServiceMeshMode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ServiceMeshMode + /// the value to convert to an instance of . + + public static implicit operator ServiceMeshMode(string value) + { + return new ServiceMeshMode(value); + } + + /// Implicit operator to convert ServiceMeshMode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode e) + { + return e._value; + } + + /// Overriding != operator for enum ServiceMeshMode + /// 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.ContainerService.Support.ServiceMeshMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ServiceMeshMode + /// 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.ContainerService.Support.ServiceMeshMode e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/SnapshotType.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/SnapshotType.Completer.cs new file mode 100644 index 000000000000..4e1df951b126 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/SnapshotType.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of a snapshot. The default is NodePool. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotTypeTypeConverter))] + public partial struct SnapshotType : + 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) || "NodePool".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NodePool'", "NodePool", global::System.Management.Automation.CompletionResultType.ParameterValue, "NodePool"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedCluster".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ManagedCluster'", "ManagedCluster", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedCluster"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/SnapshotType.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/SnapshotType.TypeConverter.cs new file mode 100644 index 000000000000..87c4e2a7a65a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/SnapshotType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The type of a snapshot. The default is NodePool. + public partial class SnapshotTypeTypeConverter : + 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) => SnapshotType.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/swaggerci/containerservice.DefaultTag/generated/api/Support/SnapshotType.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/SnapshotType.cs new file mode 100644 index 000000000000..6958aade4b4e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/SnapshotType.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.ContainerService.Support +{ + + /// The type of a snapshot. The default is NodePool. + public partial struct SnapshotType : + System.IEquatable + { + /// The snapshot is a snapshot of a managed cluster. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType ManagedCluster = @"ManagedCluster"; + + /// The snapshot is a snapshot of a node pool. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType NodePool = @"NodePool"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SnapshotType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SnapshotType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SnapshotType + /// 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.ContainerService.Support.SnapshotType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SnapshotType (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 SnapshotType && Equals((SnapshotType)obj); + } + + /// Returns hashCode for enum SnapshotType + /// 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 SnapshotType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SnapshotType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SnapshotType + /// the value to convert to an instance of . + + public static implicit operator SnapshotType(string value) + { + return new SnapshotType(value); + } + + /// Implicit operator to convert SnapshotType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType e) + { + return e._value; + } + + /// Overriding != operator for enum SnapshotType + /// 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.ContainerService.Support.SnapshotType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SnapshotType + /// 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.ContainerService.Support.SnapshotType e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/TrustedAccessRoleBindingProvisioningState.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/TrustedAccessRoleBindingProvisioningState.Completer.cs new file mode 100644 index 000000000000..cdf72aca4d83 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/TrustedAccessRoleBindingProvisioningState.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The current provisioning state of trusted access role binding. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningStateTypeConverter))] + public partial struct TrustedAccessRoleBindingProvisioningState : + 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) || "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/swaggerci/containerservice.DefaultTag/generated/api/Support/TrustedAccessRoleBindingProvisioningState.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/TrustedAccessRoleBindingProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..b6f55b3fc4f5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/TrustedAccessRoleBindingProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The current provisioning state of trusted access role binding. + public partial class TrustedAccessRoleBindingProvisioningStateTypeConverter : + 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) => TrustedAccessRoleBindingProvisioningState.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/swaggerci/containerservice.DefaultTag/generated/api/Support/TrustedAccessRoleBindingProvisioningState.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/TrustedAccessRoleBindingProvisioningState.cs new file mode 100644 index 000000000000..d955ce1f3e16 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/TrustedAccessRoleBindingProvisioningState.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The current provisioning state of trusted access role binding. + public partial struct TrustedAccessRoleBindingProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState Canceled = @"Canceled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState Succeeded = @"Succeeded"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState Updating = @"Updating"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to TrustedAccessRoleBindingProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TrustedAccessRoleBindingProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TrustedAccessRoleBindingProvisioningState + /// 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.ContainerService.Support.TrustedAccessRoleBindingProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type TrustedAccessRoleBindingProvisioningState (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 TrustedAccessRoleBindingProvisioningState && Equals((TrustedAccessRoleBindingProvisioningState)obj); + } + + /// Returns hashCode for enum TrustedAccessRoleBindingProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for TrustedAccessRoleBindingProvisioningState + /// 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 TrustedAccessRoleBindingProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// + /// Implicit operator to convert string to TrustedAccessRoleBindingProvisioningState + /// + /// the value to convert to an instance of . + + public static implicit operator TrustedAccessRoleBindingProvisioningState(string value) + { + return new TrustedAccessRoleBindingProvisioningState(value); + } + + /// + /// Implicit operator to convert TrustedAccessRoleBindingProvisioningState to string + /// + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum TrustedAccessRoleBindingProvisioningState + /// 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.ContainerService.Support.TrustedAccessRoleBindingProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TrustedAccessRoleBindingProvisioningState + /// 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.ContainerService.Support.TrustedAccessRoleBindingProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TrustedAccessRoleBindingProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Type.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Type.Completer.cs new file mode 100644 index 000000000000..9c8e10741667 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Type.Completer.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.TypeTypeConverter))] + public partial struct Type : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "First".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'First'", "First", global::System.Management.Automation.CompletionResultType.ParameterValue, "First"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Second".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Second'", "Second", global::System.Management.Automation.CompletionResultType.ParameterValue, "Second"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Third".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Third'", "Third", global::System.Management.Automation.CompletionResultType.ParameterValue, "Third"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Fourth".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Fourth'", "Fourth", global::System.Management.Automation.CompletionResultType.ParameterValue, "Fourth"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Last".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Last'", "Last", global::System.Management.Automation.CompletionResultType.ParameterValue, "Last"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Type.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Type.TypeConverter.cs new file mode 100644 index 000000000000..ebe5a4328fa1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Type.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + public partial class TypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Type.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/Type.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/Type.cs new file mode 100644 index 000000000000..59312467aabc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/Type.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.ContainerService.Support +{ + + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + public partial struct Type : + System.IEquatable + { + /// First. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type First = @"First"; + + /// Fourth. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type Fourth = @"Fourth"; + + /// Last. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type Last = @"Last"; + + /// Second. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type Second = @"Second"; + + /// Third. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type Third = @"Third"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Type + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Type(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Type + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Type (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Type && Equals((Type)obj); + } + + /// Returns hashCode for enum Type + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Type + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Type(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to Type + /// the value to convert to an instance of . + + public static implicit operator Type(string value) + { + return new Type(value); + } + + /// Implicit operator to convert Type to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type e) + { + return e._value; + } + + /// Overriding != operator for enum Type + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Type + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/UndrainableNodeBehavior.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/UndrainableNodeBehavior.Completer.cs new file mode 100644 index 000000000000..4f32c4aabd36 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/UndrainableNodeBehavior.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehaviorTypeConverter))] + public partial struct UndrainableNodeBehavior : + 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) || "Cordon".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cordon'", "Cordon", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cordon"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Schedule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Schedule'", "Schedule", global::System.Management.Automation.CompletionResultType.ParameterValue, "Schedule"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/UndrainableNodeBehavior.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/UndrainableNodeBehavior.TypeConverter.cs new file mode 100644 index 000000000000..3d4d282078c7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/UndrainableNodeBehavior.TypeConverter.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.ContainerService.Support +{ + + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + public partial class UndrainableNodeBehaviorTypeConverter : + 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) => UndrainableNodeBehavior.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/swaggerci/containerservice.DefaultTag/generated/api/Support/UndrainableNodeBehavior.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/UndrainableNodeBehavior.cs new file mode 100644 index 000000000000..a8dfc275eb36 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/UndrainableNodeBehavior.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + public partial struct UndrainableNodeBehavior : + System.IEquatable + { + /// + /// AKS will cordon the blocked nodes and replace them with surge nodes during upgrade. The blocked nodes will be cordoned + /// and replaced by surge nodes. The blocked nodes will have label 'kubernetes.azure.com/upgrade-status:Quarantined'. A surge + /// node will be retained for each blocked node. A best-effort attempt will be made to delete all other surge nodes. If there + /// are enough surge nodes to replace blocked nodes, then the upgrade operation and the managed cluster will be in failed + /// state. Otherwise, the upgrade operation and the managed cluster will be in canceled state. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior Cordon = @"Cordon"; + + /// + /// AKS will mark the blocked nodes schedulable, but the blocked nodes are not upgraded. A best-effort attempt will be made + /// to delete all surge nodes. The upgrade operation and the managed cluster will be in failed state if there are any blocked + /// nodes. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior Schedule = @"Schedule"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UndrainableNodeBehavior + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UndrainableNodeBehavior(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UndrainableNodeBehavior + /// 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.ContainerService.Support.UndrainableNodeBehavior e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UndrainableNodeBehavior (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 UndrainableNodeBehavior && Equals((UndrainableNodeBehavior)obj); + } + + /// Returns hashCode for enum UndrainableNodeBehavior + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UndrainableNodeBehavior + /// 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 UndrainableNodeBehavior(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UndrainableNodeBehavior + /// the value to convert to an instance of . + + public static implicit operator UndrainableNodeBehavior(string value) + { + return new UndrainableNodeBehavior(value); + } + + /// Implicit operator to convert UndrainableNodeBehavior to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior e) + { + return e._value; + } + + /// Overriding != operator for enum UndrainableNodeBehavior + /// 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.ContainerService.Support.UndrainableNodeBehavior e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UndrainableNodeBehavior + /// 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.ContainerService.Support.UndrainableNodeBehavior e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/UpgradeChannel.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/UpgradeChannel.Completer.cs new file mode 100644 index 000000000000..f0bff5c661e3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/UpgradeChannel.Completer.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannelTypeConverter))] + public partial struct UpgradeChannel : + 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) || "rapid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'rapid'", "rapid", global::System.Management.Automation.CompletionResultType.ParameterValue, "rapid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "stable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'stable'", "stable", global::System.Management.Automation.CompletionResultType.ParameterValue, "stable"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "patch".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'patch'", "patch", global::System.Management.Automation.CompletionResultType.ParameterValue, "patch"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "node-image".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'node-image'", "node-image", global::System.Management.Automation.CompletionResultType.ParameterValue, "node-image"); + } + 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"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/UpgradeChannel.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/UpgradeChannel.TypeConverter.cs new file mode 100644 index 000000000000..16c944705f8b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/UpgradeChannel.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + public partial class UpgradeChannelTypeConverter : + 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) => UpgradeChannel.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/swaggerci/containerservice.DefaultTag/generated/api/Support/UpgradeChannel.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/UpgradeChannel.cs new file mode 100644 index 000000000000..d756d32da9b7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/UpgradeChannel.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.ContainerService.Support +{ + + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + public partial struct UpgradeChannel : + System.IEquatable + { + /// + /// Automatically upgrade the node image to the latest version available. Consider using nodeOSUpgradeChannel instead as that + /// allows you to configure node OS patching separate from Kubernetes version patching + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel NodeImage = @"node-image"; + + /// + /// Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel None = @"none"; + + /// + /// Automatically upgrade the cluster to the latest supported patch version when it becomes available while keeping the minor + /// version the same. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 + /// are available, your cluster is upgraded to 1.17.9. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel Patch = @"patch"; + + /// + /// Automatically upgrade the cluster to the latest supported patch release on the latest supported minor version. In cases + /// where the cluster is at a version of Kubernetes that is at an N-2 minor version where N is the latest supported minor + /// version, the cluster first upgrades to the latest supported patch version on N-1 minor version. For example, if a cluster + /// is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is upgraded + /// to 1.18.6, then is upgraded to 1.19.1. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel Rapid = @"rapid"; + + /// + /// Automatically upgrade the cluster to the latest supported patch release on minor version N-1, where N is the latest supported + /// minor version. For example, if a cluster is running version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are + /// available, your cluster is upgraded to 1.18.6. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel Stable = @"stable"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UpgradeChannel + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UpgradeChannel(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UpgradeChannel + /// 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.ContainerService.Support.UpgradeChannel e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UpgradeChannel (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 UpgradeChannel && Equals((UpgradeChannel)obj); + } + + /// Returns hashCode for enum UpgradeChannel + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UpgradeChannel + /// 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 UpgradeChannel(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UpgradeChannel + /// the value to convert to an instance of . + + public static implicit operator UpgradeChannel(string value) + { + return new UpgradeChannel(value); + } + + /// Implicit operator to convert UpgradeChannel to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel e) + { + return e._value; + } + + /// Overriding != operator for enum UpgradeChannel + /// 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.ContainerService.Support.UpgradeChannel e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UpgradeChannel + /// 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.ContainerService.Support.UpgradeChannel e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/WeekDay.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/WeekDay.Completer.cs new file mode 100644 index 000000000000..826d4edf6fe5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/WeekDay.Completer.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.ContainerService.Support +{ + + /// The weekday enum. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDayTypeConverter))] + public partial struct WeekDay : + 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) || "Sunday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Sunday'", "Sunday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Sunday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Monday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Monday'", "Monday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Monday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Tuesday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Tuesday'", "Tuesday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Tuesday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Wednesday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Wednesday'", "Wednesday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Wednesday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Thursday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Thursday'", "Thursday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Thursday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Friday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Friday'", "Friday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Friday"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Saturday".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Saturday'", "Saturday", global::System.Management.Automation.CompletionResultType.ParameterValue, "Saturday"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/WeekDay.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/WeekDay.TypeConverter.cs new file mode 100644 index 000000000000..22a2ae85c8c2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/WeekDay.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// The weekday enum. + public partial class WeekDayTypeConverter : + 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) => WeekDay.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/swaggerci/containerservice.DefaultTag/generated/api/Support/WeekDay.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/WeekDay.cs new file mode 100644 index 000000000000..fcde45bc1830 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/WeekDay.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.ContainerService.Support +{ + + /// The weekday enum. + public partial struct WeekDay : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay Friday = @"Friday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay Monday = @"Monday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay Saturday = @"Saturday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay Sunday = @"Sunday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay Thursday = @"Thursday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay Tuesday = @"Tuesday"; + + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay Wednesday = @"Wednesday"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to WeekDay + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new WeekDay(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type WeekDay + /// 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.ContainerService.Support.WeekDay e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type WeekDay (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 WeekDay && Equals((WeekDay)obj); + } + + /// Returns hashCode for enum WeekDay + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for WeekDay + /// 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 WeekDay(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to WeekDay + /// the value to convert to an instance of . + + public static implicit operator WeekDay(string value) + { + return new WeekDay(value); + } + + /// Implicit operator to convert WeekDay to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay e) + { + return e._value; + } + + /// Overriding != operator for enum WeekDay + /// 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.ContainerService.Support.WeekDay e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum WeekDay + /// 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.ContainerService.Support.WeekDay e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/WorkloadRuntime.Completer.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/WorkloadRuntime.Completer.cs new file mode 100644 index 000000000000..3e57cf192972 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/WorkloadRuntime.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Determines the type of workload a node can run. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntimeTypeConverter))] + public partial struct WorkloadRuntime : + 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) || "OCIContainer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OCIContainer'", "OCIContainer", global::System.Management.Automation.CompletionResultType.ParameterValue, "OCIContainer"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "WasmWasi".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'WasmWasi'", "WasmWasi", global::System.Management.Automation.CompletionResultType.ParameterValue, "WasmWasi"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "KataMshvVmIsolation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'KataMshvVmIsolation'", "KataMshvVmIsolation", global::System.Management.Automation.CompletionResultType.ParameterValue, "KataMshvVmIsolation"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/api/Support/WorkloadRuntime.TypeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/WorkloadRuntime.TypeConverter.cs new file mode 100644 index 000000000000..f674a52d0ae8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/WorkloadRuntime.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support +{ + + /// Determines the type of workload a node can run. + public partial class WorkloadRuntimeTypeConverter : + 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) => WorkloadRuntime.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/swaggerci/containerservice.DefaultTag/generated/api/Support/WorkloadRuntime.cs b/swaggerci/containerservice.DefaultTag/generated/api/Support/WorkloadRuntime.cs new file mode 100644 index 000000000000..9bfac2cc8afe --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/api/Support/WorkloadRuntime.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.ContainerService.Support +{ + + /// Determines the type of workload a node can run. + public partial struct WorkloadRuntime : + System.IEquatable + { + /// + /// Nodes can use (Kata + Cloud Hypervisor + Hyper-V) to enable Nested VM-based pods (Preview). Due to the use Hyper-V, AKS + /// node OS itself is a nested VM (the root OS) of Hyper-V. Thus it can only be used with VM series that support Nested Virtualization + /// such as Dv3 series. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime KataMshvVMIsolation = @"KataMshvVmIsolation"; + + /// Nodes will use Kubelet to run standard OCI container workloads. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime OciContainer = @"OCIContainer"; + + /// + /// Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime WasmWasi = @"WasmWasi"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to WorkloadRuntime + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new WorkloadRuntime(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type WorkloadRuntime + /// 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.ContainerService.Support.WorkloadRuntime e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type WorkloadRuntime (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 WorkloadRuntime && Equals((WorkloadRuntime)obj); + } + + /// Returns hashCode for enum WorkloadRuntime + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for WorkloadRuntime + /// 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 WorkloadRuntime(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to WorkloadRuntime + /// the value to convert to an instance of . + + public static implicit operator WorkloadRuntime(string value) + { + return new WorkloadRuntime(value); + } + + /// Implicit operator to convert WorkloadRuntime to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime e) + { + return e._value; + } + + /// Overriding != operator for enum WorkloadRuntime + /// 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.ContainerService.Support.WorkloadRuntime e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum WorkloadRuntime + /// 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.ContainerService.Support.WorkloadRuntime e1, Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_Get.cs new file mode 100644 index 000000000000..6efb051d5a6a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_Get.cs @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details + /// about the version lifecycle. + /// + /// + /// [OpenAPI] GetAvailableAgentPoolVersions=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceAgentPoolAvailableAgentPoolVersion_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsGetAvailableAgentPoolVersions(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_GetViaIdentity.cs new file mode 100644 index 000000000000..47f0c2338c73 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details + /// about the version lifecycle. + /// + /// + /// [OpenAPI] GetAvailableAgentPoolVersions=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceAgentPoolAvailableAgentPoolVersion_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public GetAzContainerServiceAgentPoolAvailableAgentPoolVersion_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AgentPoolsGetAvailableAgentPoolVersionsViaIdentity(InputObject.Id, 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.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.AgentPoolsGetAvailableAgentPoolVersions(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IAgentPoolAvailableVersions + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolUpgradeProfile_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolUpgradeProfile_Get.cs new file mode 100644 index 000000000000..7c3c7c663dbb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolUpgradeProfile_Get.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the upgrade profile for an agent pool. + /// + /// [OpenAPI] GetUpgradeProfile=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceAgentPoolUpgradeProfile_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the upgrade profile for an agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceAgentPoolUpgradeProfile_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _agentPoolName; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string AgentPoolName { get => this._agentPoolName; set => this._agentPoolName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceAgentPoolUpgradeProfile_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsGetUpgradeProfile(SubscriptionId, ResourceGroupName, ResourceName, AgentPoolName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,AgentPoolName=AgentPoolName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName }) + { + 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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolUpgradeProfile_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolUpgradeProfile_GetViaIdentity.cs new file mode 100644 index 000000000000..1310615c9cd1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPoolUpgradeProfile_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the upgrade profile for an agent pool. + /// + /// [OpenAPI] GetUpgradeProfile=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceAgentPoolUpgradeProfile_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the upgrade profile for an agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceAgentPoolUpgradeProfile_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceAgentPoolUpgradeProfile_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AgentPoolsGetUpgradeProfileViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AgentPoolName) + { + 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.AgentPoolsGetUpgradeProfile(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.AgentPoolName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IAgentPoolUpgradeProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPool_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPool_Get.cs new file mode 100644 index 000000000000..446019f8dfb8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPool_Get.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the specified managed cluster agent pool. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceAgentPool_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the specified managed cluster agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceAgentPool_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceAgentPool_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsGet(SubscriptionId, ResourceGroupName, ResourceName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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.ContainerService.Models.Api20240402Preview.IAgentPool + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPool_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPool_GetViaIdentity.cs new file mode 100644 index 000000000000..b6d603e56d4b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPool_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the specified managed cluster agent pool. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceAgentPool_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the specified managed cluster agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceAgentPool_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceAgentPool_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AgentPoolsGetViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AgentPoolName) + { + 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.AgentPoolsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.AgentPoolName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.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.ContainerService.Models.Api20240402Preview.IAgentPool + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPool_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPool_List.cs new file mode 100644 index 000000000000..cf8df4ea3df6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceAgentPool_List.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a list of agent pools in the specified managed cluster. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceAgentPool_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of agent pools in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceAgentPool_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceAgentPool_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsList(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IAgentPoolListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceLoadBalancer_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceLoadBalancer_Get.cs new file mode 100644 index 000000000000..24e3dec1b537 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceLoadBalancer_Get.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the specified load balancer. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceLoadBalancer_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the specified load balancer.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceLoadBalancer_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the load balancer. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the load balancer.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the load balancer.", + SerializedName = @"loadBalancerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("LoadBalancerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceLoadBalancer_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LoadBalancersGet(SubscriptionId, ResourceGroupName, ResourceName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ILoadBalancer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceLoadBalancer_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceLoadBalancer_GetViaIdentity.cs new file mode 100644 index 000000000000..6fb12735cd02 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceLoadBalancer_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the specified load balancer. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceLoadBalancer_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the specified load balancer.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceLoadBalancer_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceLoadBalancer_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.LoadBalancersGetViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.LoadBalancerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.LoadBalancerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.LoadBalancersGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.LoadBalancerName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.ILoadBalancer + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ILoadBalancer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceLoadBalancer_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceLoadBalancer_List.cs new file mode 100644 index 000000000000..24e42a3b8f4a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceLoadBalancer_List.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a list of load balancers in the specified managed cluster. + /// + /// [OpenAPI] ListByManagedCluster=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceLoadBalancer_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of load balancers in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceLoadBalancer_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceLoadBalancer_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LoadBalancersListByManagedCluster(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.ILoadBalancerListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LoadBalancersListByManagedCluster_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMachine_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMachine_Get.cs new file mode 100644 index 000000000000..9db9570d1dc4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMachine_Get.cs @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Get a specific machine in the specified agent pool. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceMachine_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Get a specific machine in the specified agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceMachine_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _agentPoolName; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string AgentPoolName { get => this._agentPoolName; set => this._agentPoolName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// host name of the machine + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "host name of the machine")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"host name of the machine", + SerializedName = @"machineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceMachine_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MachinesGet(SubscriptionId, ResourceGroupName, ResourceName, AgentPoolName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,AgentPoolName=AgentPoolName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, AgentPoolName=AgentPoolName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IMachine + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMachine_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMachine_GetViaIdentity.cs new file mode 100644 index 000000000000..6d9dd37f1e9a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMachine_GetViaIdentity.cs @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Get a specific machine in the specified agent pool. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceMachine_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Get a specific machine in the specified agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceMachine_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceMachine_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.MachinesGetViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AgentPoolName) + { + 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) ); + } + if (null == InputObject.MachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.MachinesGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.AgentPoolName ?? null, InputObject.MachineName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IMachine + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IMachine + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMachine_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMachine_List.cs new file mode 100644 index 000000000000..c6618529f764 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMachine_List.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a list of machines in the specified agent pool. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceMachine_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of machines in the specified agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceMachine_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Backing field for property. + private string _agentPoolName; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string AgentPoolName { get => this._agentPoolName; set => this._agentPoolName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMachineListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceMachine_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MachinesList(SubscriptionId, ResourceGroupName, ResourceName, AgentPoolName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,AgentPoolName=AgentPoolName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName }) + { + 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.ContainerService.Models.Api20240402Preview.IMachineListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MachinesList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMaintenanceConfiguration_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMaintenanceConfiguration_Get.cs new file mode 100644 index 000000000000..49819d24db3e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMaintenanceConfiguration_Get.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the specified maintenance configuration of a managed cluster. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceMaintenanceConfiguration_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the specified maintenance configuration of a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceMaintenanceConfiguration_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _configName; + + /// The name of the maintenance configuration. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the maintenance configuration.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the maintenance configuration.", + SerializedName = @"configName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ConfigName { get => this._configName; set => this._configName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceMaintenanceConfiguration_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MaintenanceConfigurationsGet(SubscriptionId, ResourceGroupName, ResourceName, ConfigName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,ConfigName=ConfigName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, ConfigName=ConfigName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, ConfigName=ConfigName }) + { + 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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMaintenanceConfiguration_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMaintenanceConfiguration_GetViaIdentity.cs new file mode 100644 index 000000000000..b896b42f187a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMaintenanceConfiguration_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the specified maintenance configuration of a managed cluster. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceMaintenanceConfiguration_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the specified maintenance configuration of a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceMaintenanceConfiguration_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceMaintenanceConfiguration_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.MaintenanceConfigurationsGetViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ConfigName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ConfigName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.MaintenanceConfigurationsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.ConfigName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMaintenanceConfiguration_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMaintenanceConfiguration_List.cs new file mode 100644 index 000000000000..a25f0d0aee6d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceMaintenanceConfiguration_List.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a list of maintenance configurations in the specified managed cluster. + /// + /// [OpenAPI] ListByManagedCluster=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceMaintenanceConfiguration_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of maintenance configurations in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceMaintenanceConfiguration_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceMaintenanceConfiguration_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MaintenanceConfigurationsListByManagedCluster(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IMaintenanceConfigurationListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MaintenanceConfigurationsListByManagedCluster_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterAccessProfile_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterAccessProfile_Get.cs new file mode 100644 index 000000000000..58891846ed07 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterAccessProfile_Get.cs @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + /// or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + /// . + /// + /// + /// [OpenAPI] GetAccessProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterAccessProfile_Get", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"**WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) .")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterAccessProfile_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _roleName; + + /// The name of the role for managed cluster accessProfile resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role for managed cluster accessProfile resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role for managed cluster accessProfile resource.", + SerializedName = @"roleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string RoleName { get => this._roleName; set => this._roleName = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterAccessProfile_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersGetAccessProfile' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersGetAccessProfile(SubscriptionId, ResourceGroupName, ResourceName, RoleName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,RoleName=RoleName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, RoleName=RoleName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, RoleName=RoleName }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterAccessProfile_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterAccessProfile_GetViaIdentity.cs new file mode 100644 index 000000000000..44a5b73bfef5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterAccessProfile_GetViaIdentity.cs @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + /// or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + /// . + /// + /// + /// [OpenAPI] GetAccessProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterAccessProfile_GetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"**WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) .")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterAccessProfile_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzContainerServiceManagedClusterAccessProfile_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersGetAccessProfile' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersGetAccessProfileViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RoleName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagedClustersGetAccessProfile(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.RoleName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedClusterAccessProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterAdminCredentials_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterAdminCredentials_List.cs new file mode 100644 index 000000000000..2ad5e75f36da --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterAdminCredentials_List.cs @@ -0,0 +1,455 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Lists the admin credentials of a managed cluster. + /// + /// [OpenAPI] ListClusterAdminCredentials=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterAdminCredentials_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Lists the admin credentials of a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterAdminCredentials_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _serverFqdn; + + /// server fqdn type for credentials to be returned + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "server fqdn type for credentials to be returned")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server fqdn type for credentials to be returned", + SerializedName = @"server-fqdn", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + public string ServerFqdn { get => this._serverFqdn; set => this._serverFqdn = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterAdminCredentials_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersListClusterAdminCredentials' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListClusterAdminCredentials(SubscriptionId, ResourceGroupName, ResourceName, this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,ServerFqdn=this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, ServerFqdn=this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, ServerFqdn=this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null }) + { + 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.ContainerService.Models.Api20240402Preview.ICredentialResults + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / kubeconfigs / + WriteObject((await response).Kubeconfig, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterCommandResult_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterCommandResult_Get.cs new file mode 100644 index 000000000000..d0ef8c1125bd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterCommandResult_Get.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the results of a command which has been run on the Managed Cluster. + /// + /// [OpenAPI] GetCommandResult=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterCommandResult_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the results of a command which has been run on the Managed Cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterCommandResult_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _commandId; + + /// Id of the command. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the command.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the command.", + SerializedName = @"commandId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string CommandId { get => this._commandId; set => this._commandId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 header result as a from the remote call + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task headers, 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterCommandResult_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersGetCommandResult(SubscriptionId, ResourceGroupName, ResourceName, CommandId, onOk, onAccepted, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,CommandId=CommandId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 header result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task headers) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, headers, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, CommandId=CommandId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, CommandId=CommandId }) + { + 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterCommandResult_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterCommandResult_GetViaIdentity.cs new file mode 100644 index 000000000000..1f848c26a2d3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterCommandResult_GetViaIdentity.cs @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the results of a command which has been run on the Managed Cluster. + /// + /// [OpenAPI] GetCommandResult=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterCommandResult_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the results of a command which has been run on the Managed Cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterCommandResult_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnAccepted will be called before the regular onAccepted has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the header result as a from the remote call + /// /// Determines if the rest of the onAccepted method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task headers, 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzContainerServiceManagedClusterCommandResult_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersGetCommandResultViaIdentity(InputObject.Id, onOk, onAccepted, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.CommandId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.CommandId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagedClustersGetCommandResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.CommandId ?? null, onOk, onAccepted, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 header result as a from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onAccepted(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task headers) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnAccepted(responseMessage, headers, ref _returnNow); + // if overrideOnAccepted has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onAccepted - response for 202 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterGuardrailVersion_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterGuardrailVersion_Get.cs new file mode 100644 index 000000000000..1c907d1acbba --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterGuardrailVersion_Get.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains Guardrails version along with its support info and whether it is a default version. + /// + /// + /// [OpenAPI] GetGuardrailsVersions=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions/{version}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterGuardrailVersion_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains Guardrails version along with its support info and whether it is a default version.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions/{version}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterGuardrailVersion_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 _location; + + /// The name of the Azure region. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure region.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _version; + + /// Safeguards version + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Safeguards version")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Safeguards version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Version { get => this._version; set => this._version = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterGuardrailVersion_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersGetGuardrailsVersions(SubscriptionId, Location, Version, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location,Version=Version}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, Version=Version }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, Location=Location, Version=Version }) + { + 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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterGuardrailVersion_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterGuardrailVersion_GetViaIdentity.cs new file mode 100644 index 000000000000..8bbfe92ceede --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterGuardrailVersion_GetViaIdentity.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains Guardrails version along with its support info and whether it is a default version. + /// + /// + /// [OpenAPI] GetGuardrailsVersions=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions/{version}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterGuardrailVersion_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains Guardrails version along with its support info and whether it is a default version.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions/{version}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterGuardrailVersion_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzContainerServiceManagedClusterGuardrailVersion_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersGetGuardrailsVersionsViaIdentity(InputObject.Id, 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.Location) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Location"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Version) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Version"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagedClustersGetGuardrailsVersions(InputObject.SubscriptionId ?? null, InputObject.Location ?? null, InputObject.Version ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterGuardrailVersion_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterGuardrailVersion_List.cs new file mode 100644 index 000000000000..0576018555d9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterGuardrailVersion_List.cs @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains list of Guardrails version along with its support info and whether it is a default version. + /// + /// + /// [OpenAPI] ListGuardrailsVersions=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterGuardrailVersion_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersion))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains list of Guardrails version along with its support info and whether it is a default version.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterGuardrailVersion_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 _location; + + /// The name of the Azure region. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure region.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterGuardrailVersion_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListGuardrailsVersions(SubscriptionId, Location, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, Location=Location }) + { + 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.ContainerService.Models.Api20240402Preview.IGuardrailsAvailableVersionsList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListGuardrailsVersions_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterKuberneteVersion_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterKuberneteVersion_List.cs new file mode 100644 index 000000000000..34dd26650791 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterKuberneteVersion_List.cs @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details + /// on preview status of the version + /// + /// + /// [OpenAPI] ListKubernetesVersions=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterKuberneteVersion_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersion))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains extra metadata on the version, including supported patch versions, capabilities, available upgrades, and details on preview status of the version")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterKuberneteVersion_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 _location; + + /// The name of the Azure region. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure region.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterKuberneteVersion_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListKubernetesVersions(SubscriptionId, Location, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, Location=Location }) + { + 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.ContainerService.Models.Api20240402Preview.IKubernetesVersionListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / values / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshRevisionProfile_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshRevisionProfile_Get.cs new file mode 100644 index 000000000000..943598feefe4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshRevisionProfile_Get.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades + /// + /// + /// [OpenAPI] GetMeshRevisionProfile=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterMeshRevisionProfile_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterMeshRevisionProfile_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 _location; + + /// The name of the Azure region. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure region.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _mode; + + /// The mode of the mesh. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The mode of the mesh.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The mode of the mesh.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Mode { get => this._mode; set => this._mode = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterMeshRevisionProfile_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersGetMeshRevisionProfile(SubscriptionId, Location, Mode, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location,Mode=Mode}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, Mode=Mode }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, Location=Location, Mode=Mode }) + { + 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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshRevisionProfile_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshRevisionProfile_GetViaIdentity.cs new file mode 100644 index 000000000000..01a53508e70a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshRevisionProfile_GetViaIdentity.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades + /// + /// + /// [OpenAPI] GetMeshRevisionProfile=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterMeshRevisionProfile_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains extra metadata on the revision, including supported revisions, cluster compatibility and available upgrades")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterMeshRevisionProfile_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public GetAzContainerServiceManagedClusterMeshRevisionProfile_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersGetMeshRevisionProfileViaIdentity(InputObject.Id, 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.Location) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Location"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Mode) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Mode"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagedClustersGetMeshRevisionProfile(InputObject.SubscriptionId ?? null, InputObject.Location ?? null, InputObject.Mode ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshRevisionProfile_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshRevisionProfile_List.cs new file mode 100644 index 000000000000..7cd796665f99 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshRevisionProfile_List.cs @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades + /// + /// + /// [OpenAPI] ListMeshRevisionProfiles=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterMeshRevisionProfile_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains extra metadata on each revision, including supported revisions, cluster compatibility and available upgrades")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterMeshRevisionProfile_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 _location; + + /// The name of the Azure region. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure region.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterMeshRevisionProfile_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListMeshRevisionProfiles(SubscriptionId, Location, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, Location=Location }) + { + 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.ContainerService.Models.Api20240402Preview.IMeshRevisionProfileList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListMeshRevisionProfiles_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshUpgradeProfile_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshUpgradeProfile_Get.cs new file mode 100644 index 000000000000..0bcadff1d763 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshUpgradeProfile_Get.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets available upgrades for a service mesh in a cluster. + /// + /// [OpenAPI] GetMeshUpgradeProfile=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterMeshUpgradeProfile_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets available upgrades for a service mesh in a cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterMeshUpgradeProfile_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _mode; + + /// The mode of the mesh. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The mode of the mesh.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The mode of the mesh.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Mode { get => this._mode; set => this._mode = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterMeshUpgradeProfile_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersGetMeshUpgradeProfile(SubscriptionId, ResourceGroupName, ResourceName, Mode, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Mode=Mode}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, Mode=Mode }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, Mode=Mode }) + { + 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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshUpgradeProfile_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshUpgradeProfile_GetViaIdentity.cs new file mode 100644 index 000000000000..c7ebb5250226 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshUpgradeProfile_GetViaIdentity.cs @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets available upgrades for a service mesh in a cluster. + /// + /// [OpenAPI] GetMeshUpgradeProfile=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterMeshUpgradeProfile_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets available upgrades for a service mesh in a cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterMeshUpgradeProfile_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzContainerServiceManagedClusterMeshUpgradeProfile_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersGetMeshUpgradeProfileViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Mode) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Mode"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagedClustersGetMeshUpgradeProfile(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.Mode ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshUpgradeProfile_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshUpgradeProfile_List.cs new file mode 100644 index 000000000000..9065d17629e5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMeshUpgradeProfile_List.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Lists available upgrades for all service meshes in a specific cluster. + /// + /// [OpenAPI] ListMeshUpgradeProfiles=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterMeshUpgradeProfile_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Lists available upgrades for all service meshes in a specific cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterMeshUpgradeProfile_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterMeshUpgradeProfile_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListMeshUpgradeProfiles(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IMeshUpgradeProfileList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListMeshUpgradeProfiles_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMonitoringUserCredentials_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMonitoringUserCredentials_List.cs new file mode 100644 index 000000000000..510e0c9daa3d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterMonitoringUserCredentials_List.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Lists the cluster monitoring user credentials of a managed cluster. + /// + /// [OpenAPI] ListClusterMonitoringUserCredentials=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterMonitoringUserCredentials_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Lists the cluster monitoring user credentials of a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterMonitoringUserCredentials_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _serverFqdn; + + /// server fqdn type for credentials to be returned + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "server fqdn type for credentials to be returned")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server fqdn type for credentials to be returned", + SerializedName = @"server-fqdn", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + public string ServerFqdn { get => this._serverFqdn; set => this._serverFqdn = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzContainerServiceManagedClusterMonitoringUserCredentials_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersListClusterMonitoringUserCredentials' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListClusterMonitoringUserCredentials(SubscriptionId, ResourceGroupName, ResourceName, this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,ServerFqdn=this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, ServerFqdn=this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, ServerFqdn=this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null }) + { + 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.ContainerService.Models.Api20240402Preview.ICredentialResults + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / kubeconfigs / + WriteObject((await response).Kubeconfig, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterOSOption_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterOSOption_Get.cs new file mode 100644 index 000000000000..ff32adfd3922 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterOSOption_Get.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets supported OS options in the specified subscription. + /// + /// [OpenAPI] GetOSOptions=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterOSOption_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets supported OS options in the specified subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterOSOption_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 _location; + + /// The name of the Azure region. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure region.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceType; + + /// The resource type for which the OS options needs to be returned + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource type for which the OS options needs to be returned")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type for which the OS options needs to be returned", + SerializedName = @"resource-type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + public string ResourceType { get => this._resourceType; set => this._resourceType = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterOSOption_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersGetOSOptions(SubscriptionId, Location, this.InvocationInformation.BoundParameters.ContainsKey("ResourceType") ? ResourceType : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location,ResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ResourceType") ? ResourceType : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, ResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ResourceType") ? ResourceType : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, Location=Location, ResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ResourceType") ? ResourceType : null }) + { + 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.ContainerService.Models.Api20240402Preview.IOSOptionProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IOSOptionProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterOSOption_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterOSOption_GetViaIdentity.cs new file mode 100644 index 000000000000..8ccb96059f2f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterOSOption_GetViaIdentity.cs @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets supported OS options in the specified subscription. + /// + /// [OpenAPI] GetOSOptions=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterOSOption_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets supported OS options in the specified subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterOSOption_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceType; + + /// The resource type for which the OS options needs to be returned + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource type for which the OS options needs to be returned")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type for which the OS options needs to be returned", + SerializedName = @"resource-type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + public string ResourceType { get => this._resourceType; set => this._resourceType = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOSOptionProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterOSOption_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersGetOSOptionsViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("ResourceType") ? ResourceType : null, 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.Location) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Location"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagedClustersGetOSOptions(InputObject.SubscriptionId ?? null, InputObject.Location ?? null, this.InvocationInformation.BoundParameters.ContainsKey("ResourceType") ? ResourceType : null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ResourceType") ? ResourceType : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ResourceType") ? ResourceType : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ResourceType") ? ResourceType : null }) + { + 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.ContainerService.Models.Api20240402Preview.IOSOptionProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IOSOptionProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint_List.cs new file mode 100644 index 000000000000..1e95fea67e76 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint_List.cs @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The + /// operation returns properties of each egress endpoint. + /// + /// + /// [OpenAPI] ListOutboundNetworkDependenciesEndpoints=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpoint))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListOutboundNetworkDependenciesEndpoints(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IOutboundEnvironmentEndpointCollection + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListOutboundNetworkDependenciesEndpoints_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSafeguardVersion_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSafeguardVersion_Get.cs new file mode 100644 index 000000000000..9cbcd1da7333 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSafeguardVersion_Get.cs @@ -0,0 +1,439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains Safeguards version along with its support info and whether it is a default version. + /// + /// + /// [OpenAPI] GetSafeguardsVersions=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions/{version}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterSafeguardVersion_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains Safeguards version along with its support info and whether it is a default version.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions/{version}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterSafeguardVersion_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 _location; + + /// The name of the Azure region. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure region.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _version; + + /// Safeguards version + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Safeguards version")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Safeguards version", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Version { get => this._version; set => this._version = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterSafeguardVersion_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersGetSafeguardsVersions(SubscriptionId, Location, Version, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location,Version=Version}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location, Version=Version }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, Location=Location, Version=Version }) + { + 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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSafeguardVersion_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSafeguardVersion_GetViaIdentity.cs new file mode 100644 index 000000000000..c0530fb62a05 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSafeguardVersion_GetViaIdentity.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains Safeguards version along with its support info and whether it is a default version. + /// + /// + /// [OpenAPI] GetSafeguardsVersions=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions/{version}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterSafeguardVersion_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains Safeguards version along with its support info and whether it is a default version.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions/{version}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterSafeguardVersion_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzContainerServiceManagedClusterSafeguardVersion_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersGetSafeguardsVersionsViaIdentity(InputObject.Id, 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.Location) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Location"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Version) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Version"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagedClustersGetSafeguardsVersions(InputObject.SubscriptionId ?? null, InputObject.Location ?? null, InputObject.Version ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSafeguardVersion_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSafeguardVersion_List.cs new file mode 100644 index 000000000000..1d27eced5ac9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSafeguardVersion_List.cs @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Contains list of Safeguards version along with its support info and whether it is a default version. + /// + /// + /// [OpenAPI] ListSafeguardsVersions=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterSafeguardVersion_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersion))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Contains list of Safeguards version along with its support info and whether it is a default version.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterSafeguardVersion_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 _location; + + /// The name of the Azure region. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure region.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterSafeguardVersion_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListSafeguardsVersions(SubscriptionId, Location, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, Location=Location }) + { + 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.ContainerService.Models.Api20240402Preview.ISafeguardsAvailableVersionsList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListSafeguardsVersions_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_Get.cs new file mode 100644 index 000000000000..35eb178e04f3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_Get.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a managed cluster snapshot. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterSnapshot_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a managed cluster snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterSnapshot_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterSnapshot_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClusterSnapshotsGet(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_GetViaIdentity.cs new file mode 100644 index 000000000000..6e1c9ff50ac0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_GetViaIdentity.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a managed cluster snapshot. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterSnapshot_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a managed cluster snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterSnapshot_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterSnapshot_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClusterSnapshotsGetViaIdentity(InputObject.Id, 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.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.ManagedClusterSnapshotsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_List.cs new file mode 100644 index 000000000000..9f46fc4c729b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_List.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a list of managed cluster snapshots in the specified subscription. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterSnapshot_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of managed cluster snapshots in the specified subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterSnapshot_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterSnapshot_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClusterSnapshotsList(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClusterSnapshotsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_List1.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_List1.cs new file mode 100644 index 000000000000..446fe2109248 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterSnapshot_List1.cs @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Lists managed cluster snapshots in the specified subscription and resource group. + /// + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterSnapshot_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Lists managed cluster snapshots in the specified subscription and resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterSnapshot_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterSnapshot_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClusterSnapshotsListByResourceGroup(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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 }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshotListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClusterSnapshotsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterUpgradeProfile_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterUpgradeProfile_Get.cs new file mode 100644 index 000000000000..17ef647df8fc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterUpgradeProfile_Get.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the upgrade profile of a managed cluster. + /// + /// [OpenAPI] GetUpgradeProfile=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterUpgradeProfile_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the upgrade profile of a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterUpgradeProfile_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterUpgradeProfile_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersGetUpgradeProfile(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterUpgradeProfile_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterUpgradeProfile_GetViaIdentity.cs new file mode 100644 index 000000000000..20b60dd1b5cd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterUpgradeProfile_GetViaIdentity.cs @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the upgrade profile of a managed cluster. + /// + /// [OpenAPI] GetUpgradeProfile=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterUpgradeProfile_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the upgrade profile of a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterUpgradeProfile_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public GetAzContainerServiceManagedClusterUpgradeProfile_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersGetUpgradeProfileViaIdentity(InputObject.Id, 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.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.ManagedClustersGetUpgradeProfile(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedClusterUpgradeProfile + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterUserCredentials_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterUserCredentials_List.cs new file mode 100644 index 000000000000..0fbc992c4340 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedClusterUserCredentials_List.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Lists the user credentials of a managed cluster. + /// + /// [OpenAPI] ListClusterUserCredentials=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedClusterUserCredentials_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Lists the user credentials of a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedClusterUserCredentials_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format _format; + + /// + /// Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider + /// kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Format Format { get => this._format; set => this._format = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _serverFqdn; + + /// server fqdn type for credentials to be returned + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "server fqdn type for credentials to be returned")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"server fqdn type for credentials to be returned", + SerializedName = @"server-fqdn", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + public string ServerFqdn { get => this._serverFqdn; set => this._serverFqdn = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICredentialResults + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedClusterUserCredentials_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersListClusterUserCredentials' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListClusterUserCredentials(SubscriptionId, ResourceGroupName, ResourceName, this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null, this.InvocationInformation.BoundParameters.ContainsKey("Format") ? Format : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,ServerFqdn=this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null,Format=this.InvocationInformation.BoundParameters.ContainsKey("Format") ? Format : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, ServerFqdn=this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null, Format=this.InvocationInformation.BoundParameters.ContainsKey("Format") ? Format : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, ServerFqdn=this.InvocationInformation.BoundParameters.ContainsKey("ServerFqdn") ? ServerFqdn : null, Format=this.InvocationInformation.BoundParameters.ContainsKey("Format") ? Format : null }) + { + 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.ContainerService.Models.Api20240402Preview.ICredentialResults + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / kubeconfigs / + WriteObject((await response).Kubeconfig, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_Get.cs new file mode 100644 index 000000000000..33f303b8d54d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_Get.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a managed cluster. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedCluster_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedCluster_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedCluster_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersGet(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedCluster + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_GetViaIdentity.cs new file mode 100644 index 000000000000..319b2c6bcf72 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_GetViaIdentity.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a managed cluster. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedCluster_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedCluster_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedCluster_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersGetViaIdentity(InputObject.Id, 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.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.ManagedClustersGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedCluster + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_List.cs new file mode 100644 index 000000000000..f588f66f161d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_List.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a list of managed clusters in the specified subscription. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedCluster_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of managed clusters in the specified subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedCluster_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedCluster_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersList(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_List1.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_List1.cs new file mode 100644 index 000000000000..bb06f72a8c60 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceManagedCluster_List1.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Lists managed clusters in the specified subscription and resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceManagedCluster_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Lists managed clusters in the specified subscription and resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceManagedCluster_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceManagedCluster_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListByResourceGroup(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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 }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedClusterListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_Get.cs new file mode 100644 index 000000000000..be439dd400cd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_Get.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Get the status of a specific operation in the specified managed cluster. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceOperationStatusResult_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Get the status of a specific operation in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations/{operationId}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceOperationStatusResult_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _operationId; + + /// The ID of an ongoing async operation. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of an ongoing async operation.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of an ongoing async operation.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceOperationStatusResult_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationStatusResultGet(SubscriptionId, ResourceGroupName, ResourceName, OperationId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,OperationId=OperationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, OperationId=OperationId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, OperationId=OperationId }) + { + 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.ContainerService.Models.Api40.IOperationStatusResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api40.IOperationStatusResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_Get1.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_Get1.cs new file mode 100644 index 000000000000..4afba35be340 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_Get1.cs @@ -0,0 +1,465 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Get the status of a specific operation in the specified agent pool. + /// + /// [OpenAPI] GetByAgentPool=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceOperationStatusResult_Get1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Get the status of a specific operation in the specified agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceOperationStatusResult_Get1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _agentPoolName; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string AgentPoolName { get => this._agentPoolName; set => this._agentPoolName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _operationId; + + /// The ID of an ongoing async operation. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of an ongoing async operation.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of an ongoing async operation.", + SerializedName = @"operationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string OperationId { get => this._operationId; set => this._operationId = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceOperationStatusResult_Get1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationStatusResultGetByAgentPool(SubscriptionId, ResourceGroupName, ResourceName, AgentPoolName, OperationId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,AgentPoolName=AgentPoolName,OperationId=OperationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName, OperationId=OperationId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName, OperationId=OperationId }) + { + 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.ContainerService.Models.Api40.IOperationStatusResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api40.IOperationStatusResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_GetViaIdentity.cs new file mode 100644 index 000000000000..ae9d2c2cd9d4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Get the status of a specific operation in the specified managed cluster. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceOperationStatusResult_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Get the status of a specific operation in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations/{operationId}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceOperationStatusResult_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceOperationStatusResult_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.OperationStatusResultGetViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.OperationId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.OperationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.OperationStatusResultGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.OperationId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api40.IOperationStatusResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api40.IOperationStatusResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_GetViaIdentity1.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_GetViaIdentity1.cs new file mode 100644 index 000000000000..014bb941ffa1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_GetViaIdentity1.cs @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Get the status of a specific operation in the specified agent pool. + /// + /// [OpenAPI] GetByAgentPool=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceOperationStatusResult_GetViaIdentity1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Get the status of a specific operation in the specified agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceOperationStatusResult_GetViaIdentity1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceOperationStatusResult_GetViaIdentity1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.OperationStatusResultGetByAgentPoolViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AgentPoolName) + { + 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) ); + } + if (null == InputObject.OperationId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.OperationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.OperationStatusResultGetByAgentPool(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.AgentPoolName ?? null, InputObject.OperationId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api40.IOperationStatusResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api40.IOperationStatusResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_List.cs new file mode 100644 index 000000000000..f1a1c3735e86 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperationStatusResult_List.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a list of operations in the specified managedCluster + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceOperationStatusResult_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IOperationStatusResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of operations in the specified managedCluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceOperationStatusResult_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationStatusResultList + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceOperationStatusResult_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationStatusResultList(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IOperationStatusResultList + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationStatusResultList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperation_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperation_List.cs new file mode 100644 index 000000000000..68031e7fb2e0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceOperation_List.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a list of operations. + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.ContainerService/operations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceOperation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of operations.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/providers/Microsoft.ContainerService/operations", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceOperation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceOperation_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList(onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateEndpointConnection_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateEndpointConnection_Get.cs new file mode 100644 index 000000000000..60239ef8096d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateEndpointConnection_Get.cs @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServicePrivateEndpointConnection_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServicePrivateEndpointConnection_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the private endpoint connection. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection.", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServicePrivateEndpointConnection_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsGet(SubscriptionId, ResourceGroupName, ResourceName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateEndpointConnection_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateEndpointConnection_GetViaIdentity.cs new file mode 100644 index 000000000000..7e585feab900 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateEndpointConnection_GetViaIdentity.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServicePrivateEndpointConnection_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServicePrivateEndpointConnection_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServicePrivateEndpointConnection_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PrivateEndpointConnectionsGetViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PrivateEndpointConnectionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PrivateEndpointConnectionsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.PrivateEndpointConnectionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateEndpointConnection_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateEndpointConnection_List.cs new file mode 100644 index 000000000000..7bb4b340b51c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateEndpointConnection_List.cs @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServicePrivateEndpointConnection_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServicePrivateEndpointConnection_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServicePrivateEndpointConnection_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsList(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IPrivateEndpointConnectionListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateLinkResource_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateLinkResource_List.cs new file mode 100644 index 000000000000..af5b07a2ca58 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServicePrivateLinkResource_List.cs @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServicePrivateLinkResource_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServicePrivateLinkResource_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServicePrivateLinkResource_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateLinkResourcesList(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.IPrivateLinkResourcesListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_Get.cs new file mode 100644 index 000000000000..c6aa99018848 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_Get.cs @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a snapshot. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceSnapshot_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceSnapshot_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceSnapshot_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SnapshotsGet(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ISnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_GetViaIdentity.cs new file mode 100644 index 000000000000..ca612f3ee14a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_GetViaIdentity.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a snapshot. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceSnapshot_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceSnapshot_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceSnapshot_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SnapshotsGetViaIdentity(InputObject.Id, 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.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.SnapshotsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ISnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_List.cs new file mode 100644 index 000000000000..ff1d2844c4b2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_List.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets a list of snapshots in the specified subscription. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceSnapshot_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets a list of snapshots in the specified subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceSnapshot_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceSnapshot_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SnapshotsList(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SnapshotsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_List1.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_List1.cs new file mode 100644 index 000000000000..0354462b29e7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceSnapshot_List1.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Lists snapshots in the specified subscription and resource group. + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceSnapshot_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Lists snapshots in the specified subscription and resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceSnapshot_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshotListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceSnapshot_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SnapshotsListByResourceGroup(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + 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 } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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 }) + { + 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.ContainerService.Models.Api20240402Preview.ISnapshotListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SnapshotsListByResourceGroup_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRoleBinding_Get.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRoleBinding_Get.cs new file mode 100644 index 000000000000..e055f47b4dbc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRoleBinding_Get.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Get a trusted access role binding. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceTrustedAccessRoleBinding_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Get a trusted access role binding.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceTrustedAccessRoleBinding_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of trusted access role binding. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of trusted access role binding.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of trusted access role binding.", + SerializedName = @"trustedAccessRoleBindingName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TrustedAccessRoleBindingName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceTrustedAccessRoleBinding_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrustedAccessRoleBindingsGet(SubscriptionId, ResourceGroupName, ResourceName, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRoleBinding_GetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRoleBinding_GetViaIdentity.cs new file mode 100644 index 000000000000..0ef8edd1d649 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRoleBinding_GetViaIdentity.cs @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Get a trusted access role binding. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceTrustedAccessRoleBinding_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Get a trusted access role binding.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceTrustedAccessRoleBinding_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceTrustedAccessRoleBinding_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TrustedAccessRoleBindingsGetViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TrustedAccessRoleBindingName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TrustedAccessRoleBindingName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TrustedAccessRoleBindingsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.TrustedAccessRoleBindingName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRoleBinding_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRoleBinding_List.cs new file mode 100644 index 000000000000..2b53cb805952 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRoleBinding_List.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// List trusted access role bindings. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceTrustedAccessRoleBinding_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"List trusted access role bindings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceTrustedAccessRoleBinding_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceTrustedAccessRoleBinding_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrustedAccessRoleBindingsList(SubscriptionId, ResourceGroupName, ResourceName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + 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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBindingListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrustedAccessRoleBindingsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRole_List.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRole_List.cs new file mode 100644 index 000000000000..45d297dd015b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/GetAzContainerServiceTrustedAccessRole_List.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// List supported trusted access roles. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzContainerServiceTrustedAccessRole_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"List supported trusted access roles.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles", ApiVersion = "2024-04-02-preview")] + public partial class GetAzContainerServiceTrustedAccessRole_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 _location; + + /// The name of the Azure region. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure region.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure region.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzContainerServiceTrustedAccessRole_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrustedAccessRolesList(SubscriptionId, Location, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, Location=Location }) + { + 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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrustedAccessRolesList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_Load.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_Load.cs new file mode 100644 index 000000000000..105171591322 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_Load.cs @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Rebalance nodes across specific load balancers. + /// + /// [OpenAPI] RebalanceLoadBalancers=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Import, @"AzContainerServiceManagedCluster_Load", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Rebalance nodes across specific load balancers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers", ApiVersion = "2024-04-02-preview")] + public partial class ImportAzContainerServiceManagedCluster_Load : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody _parameter; + + /// + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of ImportAzContainerServiceManagedCluster_Load + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ImportAzContainerServiceManagedCluster_Load Clone() + { + var clone = new ImportAzContainerServiceManagedCluster_Load(); + 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.ResourceName = this.ResourceName; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ImportAzContainerServiceManagedCluster_Load() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRebalanceLoadBalancers' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersRebalanceLoadBalancers(SubscriptionId, ResourceGroupName, ResourceName, Parameter, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.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, ResourceName=ResourceName, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_LoadExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_LoadExpanded.cs new file mode 100644 index 000000000000..b2da2e9c0219 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_LoadExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Rebalance nodes across specific load balancers. + /// + /// [OpenAPI] RebalanceLoadBalancers=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Import, @"AzContainerServiceManagedCluster_LoadExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Rebalance nodes across specific load balancers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers", ApiVersion = "2024-04-02-preview")] + public partial class ImportAzContainerServiceManagedCluster_LoadExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RebalanceLoadBalancersRequestBody(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The load balancer names list. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The load balancer names list.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The load balancer names list.", + SerializedName = @"loadBalancerNames", + PossibleTypes = new [] { typeof(string) })] + public string[] LoadBalancerName { get => _parametersBody.LoadBalancerName ?? null /* arrayOf */; set => _parametersBody.LoadBalancerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of ImportAzContainerServiceManagedCluster_LoadExpanded + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ImportAzContainerServiceManagedCluster_LoadExpanded Clone() + { + var clone = new ImportAzContainerServiceManagedCluster_LoadExpanded(); + 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._parametersBody = this._parametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ResourceName = this.ResourceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ImportAzContainerServiceManagedCluster_LoadExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRebalanceLoadBalancers' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersRebalanceLoadBalancers(SubscriptionId, ResourceGroupName, ResourceName, _parametersBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.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, ResourceName=ResourceName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_LoadViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_LoadViaIdentity.cs new file mode 100644 index 000000000000..99392af97a30 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_LoadViaIdentity.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Rebalance nodes across specific load balancers. + /// + /// [OpenAPI] RebalanceLoadBalancers=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Import, @"AzContainerServiceManagedCluster_LoadViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Rebalance nodes across specific load balancers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers", ApiVersion = "2024-04-02-preview")] + public partial class ImportAzContainerServiceManagedCluster_LoadViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody _parameter; + + /// + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of ImportAzContainerServiceManagedCluster_LoadViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ImportAzContainerServiceManagedCluster_LoadViaIdentity Clone() + { + var clone = new ImportAzContainerServiceManagedCluster_LoadViaIdentity(); + 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.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ImportAzContainerServiceManagedCluster_LoadViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRebalanceLoadBalancers' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersRebalanceLoadBalancersViaIdentity(InputObject.Id, Parameter, 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.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.ManagedClustersRebalanceLoadBalancers(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, Parameter, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_LoadViaIdentityExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_LoadViaIdentityExpanded.cs new file mode 100644 index 000000000000..6d43931f6fa5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ImportAzContainerServiceManagedCluster_LoadViaIdentityExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Rebalance nodes across specific load balancers. + /// + /// [OpenAPI] RebalanceLoadBalancers=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Import, @"AzContainerServiceManagedCluster_LoadViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Rebalance nodes across specific load balancers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers", ApiVersion = "2024-04-02-preview")] + public partial class ImportAzContainerServiceManagedCluster_LoadViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// The names of the load balancers to rebalance. If set to empty, all load balancers will be rebalanced. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRebalanceLoadBalancersRequestBody _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RebalanceLoadBalancersRequestBody(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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 load balancer names list. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The load balancer names list.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The load balancer names list.", + SerializedName = @"loadBalancerNames", + PossibleTypes = new [] { typeof(string) })] + public string[] LoadBalancerName { get => _parametersBody.LoadBalancerName ?? null /* arrayOf */; set => _parametersBody.LoadBalancerName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of ImportAzContainerServiceManagedCluster_LoadViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ImportAzContainerServiceManagedCluster_LoadViaIdentityExpanded Clone() + { + var clone = new ImportAzContainerServiceManagedCluster_LoadViaIdentityExpanded(); + 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._parametersBody = this._parametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public ImportAzContainerServiceManagedCluster_LoadViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRebalanceLoadBalancers' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersRebalanceLoadBalancersViaIdentity(InputObject.Id, _parametersBody, 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.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.ManagedClustersRebalanceLoadBalancers(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _parametersBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortAgentPoolLatestOperation_Abort.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortAgentPoolLatestOperation_Abort.cs new file mode 100644 index 000000000000..c6b12a4ea90c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortAgentPoolLatestOperation_Abort.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually + /// to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, an error + /// is returned. + /// + /// + /// [OpenAPI] AbortLatestOperation=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceAbortAgentPoolLatestOperation_Abort", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, an error is returned.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceAbortAgentPoolLatestOperation_Abort : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _agentPoolName; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string AgentPoolName { get => this._agentPoolName; set => this._agentPoolName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzContainerServiceAbortAgentPoolLatestOperation_Abort + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.InvokeAzContainerServiceAbortAgentPoolLatestOperation_Abort Clone() + { + var clone = new InvokeAzContainerServiceAbortAgentPoolLatestOperation_Abort(); + 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.ResourceName = this.ResourceName; + clone.AgentPoolName = this.AgentPoolName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzContainerServiceAbortAgentPoolLatestOperation_Abort() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsAbortLatestOperation' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsAbortLatestOperation(SubscriptionId, ResourceGroupName, ResourceName, AgentPoolName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,AgentPoolName=AgentPoolName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity.cs new file mode 100644 index 000000000000..5cbc2cf6c655 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually + /// to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, an error + /// is returned. + /// + /// + /// [OpenAPI] AbortLatestOperation=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, an error is returned.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.InvokeAzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity Clone() + { + var clone = new InvokeAzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public InvokeAzContainerServiceAbortAgentPoolLatestOperation_AbortViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsAbortLatestOperation' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AgentPoolsAbortLatestOperationViaIdentity(InputObject.Id, onNoContent, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AgentPoolName) + { + 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.AgentPoolsAbortLatestOperation(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.AgentPoolName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortManagedClusterLatestOperation_Abort.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortManagedClusterLatestOperation_Abort.cs new file mode 100644 index 000000000000..4812800f23e1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortManagedClusterLatestOperation_Abort.cs @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state + /// and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take + /// place, an error is returned. + /// + /// + /// [OpenAPI] AbortLatestOperation=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceAbortManagedClusterLatestOperation_Abort", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, an error is returned.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceAbortManagedClusterLatestOperation_Abort : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzContainerServiceAbortManagedClusterLatestOperation_Abort + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.InvokeAzContainerServiceAbortManagedClusterLatestOperation_Abort Clone() + { + var clone = new InvokeAzContainerServiceAbortManagedClusterLatestOperation_Abort(); + 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.ResourceName = this.ResourceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzContainerServiceAbortManagedClusterLatestOperation_Abort() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersAbortLatestOperation' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersAbortLatestOperation(SubscriptionId, ResourceGroupName, ResourceName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity.cs new file mode 100644 index 000000000000..484fc0ad4562 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state + /// and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take + /// place, an error is returned. + /// + /// + /// [OpenAPI] AbortLatestOperation=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, an error is returned.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.InvokeAzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity Clone() + { + var clone = new InvokeAzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzContainerServiceAbortManagedClusterLatestOperation_AbortViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersAbortLatestOperation' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersAbortLatestOperationViaIdentity(InputObject.Id, onNoContent, 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.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.ManagedClustersAbortLatestOperation(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_Post.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_Post.cs new file mode 100644 index 000000000000..3e0374fdfdaf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_Post.cs @@ -0,0 +1,450 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the private link service ID for the specified managed cluster. + /// + /// [OpenAPI] Post=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceResolvePrivateLinkServiceId_Post", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the private link service ID for the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceResolvePrivateLinkServiceId_Post : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource _parameter; + + /// A private link resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A private link resource", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A private link resource", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzContainerServiceResolvePrivateLinkServiceId_Post() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ResolvePrivateLinkServiceIdPost' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ResolvePrivateLinkServiceIdPost(SubscriptionId, ResourceGroupName, ResourceName, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=Parameter }) + { + 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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_PostExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_PostExpanded.cs new file mode 100644 index 000000000000..a5a18b94bf76 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_PostExpanded.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the private link service ID for the specified managed cluster. + /// + /// [OpenAPI] Post=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceResolvePrivateLinkServiceId_PostExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the private link service ID for the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceResolvePrivateLinkServiceId_PostExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A private link resource + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The group ID of the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The group ID of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The group ID of the resource.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + public string GroupId { get => _parametersBody.GroupId ?? null; set => _parametersBody.GroupId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The ID of the private link resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the private link resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the private link resource.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string Id { get => _parametersBody.Id ?? null; set => _parametersBody.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The name of the private link resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the private link resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the private link resource.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => _parametersBody.Name ?? null; set => _parametersBody.Name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The RequiredMembers of the resource + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The RequiredMembers of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The RequiredMembers of the resource", + SerializedName = @"requiredMembers", + PossibleTypes = new [] { typeof(string) })] + public string[] RequiredMember { get => _parametersBody.RequiredMember ?? null /* arrayOf */; set => _parametersBody.RequiredMember = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// The resource type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string Type { get => _parametersBody.Type ?? null; set => _parametersBody.Type = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzContainerServiceResolvePrivateLinkServiceId_PostExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ResolvePrivateLinkServiceIdPost' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ResolvePrivateLinkServiceIdPost(SubscriptionId, ResourceGroupName, ResourceName, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentity.cs new file mode 100644 index 000000000000..28dad1ac50f0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentity.cs @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the private link service ID for the specified managed cluster. + /// + /// [OpenAPI] Post=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceResolvePrivateLinkServiceId_PostViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the private link service ID for the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource _parameter; + + /// A private link resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A private link resource", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A private link resource", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ResolvePrivateLinkServiceIdPost' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ResolvePrivateLinkServiceIdPostViaIdentity(InputObject.Id, Parameter, 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.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.ResolvePrivateLinkServiceIdPost(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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=Parameter }) + { + 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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentityExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentityExpanded.cs new file mode 100644 index 000000000000..18a1da97e887 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentityExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Gets the private link service ID for the specified managed cluster. + /// + /// [OpenAPI] Post=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceResolvePrivateLinkServiceId_PostViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Gets the private link service ID for the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A private link resource + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.PrivateLinkResource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The group ID of the resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The group ID of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The group ID of the resource.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + public string GroupId { get => _parametersBody.GroupId ?? null; set => _parametersBody.GroupId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The ID of the private link resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the private link resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the private link resource.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string Id { get => _parametersBody.Id ?? null; set => _parametersBody.Id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The name of the private link resource. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the private link resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the private link resource.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => _parametersBody.Name ?? null; set => _parametersBody.Name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The RequiredMembers of the resource + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The RequiredMembers of the resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The RequiredMembers of the resource", + SerializedName = @"requiredMembers", + PossibleTypes = new [] { typeof(string) })] + public string[] RequiredMember { get => _parametersBody.RequiredMember ?? null /* arrayOf */; set => _parametersBody.RequiredMember = value; } + + /// The resource type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string Type { get => _parametersBody.Type ?? null; set => _parametersBody.Type = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzContainerServiceResolvePrivateLinkServiceId_PostViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ResolvePrivateLinkServiceIdPost' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ResolvePrivateLinkServiceIdPostViaIdentity(InputObject.Id, _parametersBody, 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.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.ResolvePrivateLinkServiceIdPost(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IPrivateLinkResource + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterCertificate_Rotate.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterCertificate_Rotate.cs new file mode 100644 index 000000000000..d3f5a7847403 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterCertificate_Rotate.cs @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating + /// managed cluster certificates. + /// + /// + /// [OpenAPI] RotateClusterCertificates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceRotateManagedClusterCertificate_Rotate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceRotateManagedClusterCertificate_Rotate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzContainerServiceRotateManagedClusterCertificate_Rotate + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.InvokeAzContainerServiceRotateManagedClusterCertificate_Rotate Clone() + { + var clone = new InvokeAzContainerServiceRotateManagedClusterCertificate_Rotate(); + 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.ResourceName = this.ResourceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzContainerServiceRotateManagedClusterCertificate_Rotate() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRotateClusterCertificates' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersRotateClusterCertificates(SubscriptionId, ResourceGroupName, ResourceName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity.cs new file mode 100644 index 000000000000..02333975fbaf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating + /// managed cluster certificates. + /// + /// + /// [OpenAPI] RotateClusterCertificates=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.InvokeAzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity Clone() + { + var clone = new InvokeAzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzContainerServiceRotateManagedClusterCertificate_RotateViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRotateClusterCertificates' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersRotateClusterCertificatesViaIdentity(InputObject.Id, onNoContent, 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.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.ManagedClustersRotateClusterCertificates(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate.cs new file mode 100644 index 000000000000..cb8e77fd8350 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Rotates the service account signing keys of a managed cluster. + /// + /// [OpenAPI] RotateServiceAccountSigningKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Rotates the service account signing keys of a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate Clone() + { + var clone = new InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate(); + 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.ResourceName = this.ResourceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_Rotate() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRotateServiceAccountSigningKeys' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersRotateServiceAccountSigningKeys(SubscriptionId, ResourceGroupName, ResourceName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity.cs new file mode 100644 index 000000000000..5f2b274b87af --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity.cs @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Rotates the service account signing keys of a managed cluster. + /// + /// [OpenAPI] RotateServiceAccountSigningKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Rotates the service account signing keys of a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys", ApiVersion = "2024-04-02-preview")] + public partial class InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity Clone() + { + var clone = new InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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"); + } + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzContainerServiceRotateManagedClusterServiceAccountSigningKey_RotateViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRotateServiceAccountSigningKeys' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersRotateServiceAccountSigningKeysViaIdentity(InputObject.Id, onNoContent, 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.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.ManagedClustersRotateServiceAccountSigningKeys(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceAgentPool_CreateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceAgentPool_CreateExpanded.cs new file mode 100644 index 000000000000..f1e2e8a712a5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceAgentPool_CreateExpanded.cs @@ -0,0 +1,1517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Creates or updates an agent pool in the specified managed cluster. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzContainerServiceAgentPool_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Creates or updates an agent pool in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", ApiVersion = "2024-04-02-preview")] + public partial class NewAzContainerServiceAgentPool_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Agent Pool. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPool _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPool(); + + /// + /// Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + /// container images must also enable artifact streaming on ACR. If not specified, the default is false. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, container images must also enable artifact streaming on ACR. If not specified, the default is false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, container images must also enable artifact streaming on ACR. If not specified, the default is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ArtifactStreamingProfileEnabled { get => _parametersBody.ArtifactStreamingProfileEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ArtifactStreamingProfileEnabled = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + public string[] AvailabilityZone { get => _parametersBody.AvailabilityZone ?? null /* arrayOf */; set => _parametersBody.AvailabilityZone = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// + /// AKS will associate the specified agent pool with the Capacity Reservation Group. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "AKS will associate the specified agent pool with the Capacity Reservation Group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"AKS will associate the specified agent pool with the Capacity Reservation Group.", + SerializedName = @"capacityReservationGroupID", + PossibleTypes = new [] { typeof(string) })] + public string CapacityReservationGroupId { get => _parametersBody.CapacityReservationGroupId ?? null; set => _parametersBody.CapacityReservationGroupId = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// + /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user + /// pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(int) })] + public int Count { get => _parametersBody.Count ?? default(int); set => _parametersBody.Count = value; } + + /// This is the ARM ID of the source object to be used to create the target object. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the ARM ID of the source object to be used to create the target object.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string CreationDataSourceResourceId { get => _parametersBody.CreationDataSourceResourceId ?? null; set => _parametersBody.CreationDataSourceResourceId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Whether to enable auto-scaler + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable auto-scaler")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable auto-scaler", + SerializedName = @"enableAutoScaling", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableAutoScaling { get => _parametersBody.EnableAutoScaling ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableAutoScaling = value; } + + /// + /// When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + /// host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node + /// trust stores. Defaults to false. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node trust stores. Defaults to false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with host services to sync custom certificate authorities from user-provided list of base64 encoded certificates into node trust stores. Defaults to false.", + SerializedName = @"enableCustomCATrust", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableCustomCaTrust { get => _parametersBody.EnableCustomCaTrust ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableCustomCaTrust = value; } + + /// + /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption", + SerializedName = @"enableEncryptionAtHost", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableEncryptionAtHost { get => _parametersBody.EnableEncryptionAtHost ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableEncryptionAtHost = value; } + + /// + /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + /// for more details. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.", + SerializedName = @"enableFIPS", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableFips { get => _parametersBody.EnableFips ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableFips = value; } + + /// + /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario + /// is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. + /// For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + /// The default is false. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.", + SerializedName = @"enableNodePublicIP", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableNodePublicIP { get => _parametersBody.EnableNodePublicIP ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableNodePublicIP = value; } + + /// Whether to enable UltraSSD + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable UltraSSD")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable UltraSSD", + SerializedName = @"enableUltraSSD", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableUltraSsd { get => _parametersBody.EnableUltraSsd ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableUltraSsd = value; } + + /// + /// The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + /// of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. + /// The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, + /// the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default + /// value is 31. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size of Public IPPrefix should be selected by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31.", + SerializedName = @"publicIPPrefixSize", + PossibleTypes = new [] { typeof(int) })] + public int GatewayProfilePublicIPPrefixSize { get => _parametersBody.GatewayProfilePublicIPPrefixSize ?? default(int); set => _parametersBody.GatewayProfilePublicIPPrefixSize = value; } + + /// + /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.", + SerializedName = @"gpuInstanceProfile", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile GpuInstanceProfile { get => _parametersBody.GpuInstanceProfile ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.GpuInstanceProfile)""); set => _parametersBody.GpuInstanceProfile = value; } + + /// + /// The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + /// only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. + /// In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated GPU resource. Setting this field to false prevents automatic GPU driver installation. In that case, in order for the GPU to be usable, the user must perform GPU driver installation themselves.", + SerializedName = @"installGPUDriver", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter GpuProfileInstallGpuDriver { get => _parametersBody.GpuProfileInstallGpuDriver ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.GpuProfileInstallGpuDriver = value; } + + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + /// For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).", + SerializedName = @"hostGroupID", + PossibleTypes = new [] { typeof(string) })] + public string HostGroupId { get => _parametersBody.HostGroupId ?? null; set => _parametersBody.HostGroupId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// The request should only proceed if an entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if an entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if an entity matches this string.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// The request should only proceed if no entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if no entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if no entity matches this string.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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; } } + + /// Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`).", + SerializedName = @"allowedUnsafeSysctls", + PossibleTypes = new [] { typeof(string) })] + public string[] KubeletConfigAllowedUnsafeSysctl { get => _parametersBody.KubeletConfigAllowedUnsafeSysctl ?? null /* arrayOf */; set => _parametersBody.KubeletConfigAllowedUnsafeSysctl = value; } + + /// + /// The maximum number of container log files that can be present for a container. The number must be ≥ 2. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number of container log files that can be present for a container. The number must be ≥ 2.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of container log files that can be present for a container. The number must be ≥ 2.", + SerializedName = @"containerLogMaxFiles", + PossibleTypes = new [] { typeof(int) })] + public int KubeletConfigContainerLogMaxFile { get => _parametersBody.KubeletConfigContainerLogMaxFile ?? default(int); set => _parametersBody.KubeletConfigContainerLogMaxFile = value; } + + /// The maximum size (e.g. 10Mi) of container log file before it is rotated. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum size (e.g. 10Mi) of container log file before it is rotated.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size (e.g. 10Mi) of container log file before it is rotated.", + SerializedName = @"containerLogMaxSizeMB", + PossibleTypes = new [] { typeof(int) })] + public int KubeletConfigContainerLogMaxSizeMb { get => _parametersBody.KubeletConfigContainerLogMaxSizeMb ?? default(int); set => _parametersBody.KubeletConfigContainerLogMaxSizeMb = value; } + + /// The default is true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"cpuCfsQuota", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter KubeletConfigCpuCfsQuota { get => _parametersBody.KubeletConfigCpuCfsQuota ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.KubeletConfigCpuCfsQuota = value; } + + /// + /// The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For + /// example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'.", + SerializedName = @"cpuCfsQuotaPeriod", + PossibleTypes = new [] { typeof(string) })] + public string KubeletConfigCpuCfsQuotaPeriod { get => _parametersBody.KubeletConfigCpuCfsQuotaPeriod ?? null; set => _parametersBody.KubeletConfigCpuCfsQuotaPeriod = value; } + + /// + /// The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + /// for more information. Allowed values are 'none' and 'static'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'.", + SerializedName = @"cpuManagerPolicy", + PossibleTypes = new [] { typeof(string) })] + public string KubeletConfigCpuManagerPolicy { get => _parametersBody.KubeletConfigCpuManagerPolicy ?? null; set => _parametersBody.KubeletConfigCpuManagerPolicy = value; } + + /// + /// If set to true it will make the Kubelet fail to start if swap is enabled on the node. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If set to true it will make the Kubelet fail to start if swap is enabled on the node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true it will make the Kubelet fail to start if swap is enabled on the node.", + SerializedName = @"failSwapOn", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter KubeletConfigFailSwapOn { get => _parametersBody.KubeletConfigFailSwapOn ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.KubeletConfigFailSwapOn = value; } + + /// To disable image garbage collection, set to 100. The default is 85% + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "To disable image garbage collection, set to 100. The default is 85%")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"To disable image garbage collection, set to 100. The default is 85%", + SerializedName = @"imageGcHighThreshold", + PossibleTypes = new [] { typeof(int) })] + public int KubeletConfigImageGcHighThreshold { get => _parametersBody.KubeletConfigImageGcHighThreshold ?? default(int); set => _parametersBody.KubeletConfigImageGcHighThreshold = value; } + + /// This cannot be set higher than imageGcHighThreshold. The default is 80% + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This cannot be set higher than imageGcHighThreshold. The default is 80%")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be set higher than imageGcHighThreshold. The default is 80%", + SerializedName = @"imageGcLowThreshold", + PossibleTypes = new [] { typeof(int) })] + public int KubeletConfigImageGcLowThreshold { get => _parametersBody.KubeletConfigImageGcLowThreshold ?? default(int); set => _parametersBody.KubeletConfigImageGcLowThreshold = value; } + + /// The maximum number of processes per pod. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number of processes per pod.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of processes per pod.", + SerializedName = @"podMaxPids", + PossibleTypes = new [] { typeof(int) })] + public int KubeletConfigPodMaxPid { get => _parametersBody.KubeletConfigPodMaxPid ?? default(int); set => _parametersBody.KubeletConfigPodMaxPid = value; } + + /// + /// For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + /// The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'.", + SerializedName = @"topologyManagerPolicy", + PossibleTypes = new [] { typeof(string) })] + public string KubeletConfigTopologyManagerPolicy { get => _parametersBody.KubeletConfigTopologyManagerPolicy ?? null; set => _parametersBody.KubeletConfigTopologyManagerPolicy = value; } + + /// + /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.", + SerializedName = @"kubeletDiskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType KubeletDiskType { get => _parametersBody.KubeletDiskType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubeletDiskType)""); set => _parametersBody.KubeletDiskType = value; } + + /// The size in MB of a swap file that will be created on each node. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The size in MB of a swap file that will be created on each node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size in MB of a swap file that will be created on each node.", + SerializedName = @"swapFileSizeMB", + PossibleTypes = new [] { typeof(int) })] + public int LinuxOSConfigSwapFileSizeMb { get => _parametersBody.LinuxOSConfigSwapFileSizeMb ?? default(int); set => _parametersBody.LinuxOSConfigSwapFileSizeMb = value; } + + /// Sysctl settings for Linux agent nodes. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sysctl settings for Linux agent nodes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sysctl settings for Linux agent nodes.", + SerializedName = @"sysctls", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISysctlConfig LinuxOSConfigSysctl { get => _parametersBody.LinuxOSConfigSysctl ?? null /* object */; set => _parametersBody.LinuxOSConfigSysctl = value; } + + /// + /// Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information + /// see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).", + SerializedName = @"transparentHugePageDefrag", + PossibleTypes = new [] { typeof(string) })] + public string LinuxOSConfigTransparentHugePageDefrag { get => _parametersBody.LinuxOSConfigTransparentHugePageDefrag ?? null; set => _parametersBody.LinuxOSConfigTransparentHugePageDefrag = value; } + + /// + /// Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge).", + SerializedName = @"transparentHugePageEnabled", + PossibleTypes = new [] { typeof(string) })] + public string LinuxOSConfigTransparentHugePageEnabled { get => _parametersBody.LinuxOSConfigTransparentHugePageEnabled ?? null; set => _parametersBody.LinuxOSConfigTransparentHugePageEnabled = value; } + + /// The maximum number of nodes for auto-scaling + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number of nodes for auto-scaling")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of nodes for auto-scaling", + SerializedName = @"maxCount", + PossibleTypes = new [] { typeof(int) })] + public int MaxCount { get => _parametersBody.MaxCount ?? default(int); set => _parametersBody.MaxCount = value; } + + /// The maximum number of pods that can run on a node. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number of pods that can run on a node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number of pods that can run on a node.", + SerializedName = @"maxPods", + PossibleTypes = new [] { typeof(int) })] + public int MaxPod { get => _parametersBody.MaxPod ?? default(int); set => _parametersBody.MaxPod = value; } + + /// + /// A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + /// the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed + /// raw and not be executed as a script). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script).", + SerializedName = @"messageOfTheDay", + PossibleTypes = new [] { typeof(string) })] + public string MessageOfTheDay { get => _parametersBody.MessageOfTheDay ?? null; set => _parametersBody.MessageOfTheDay = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The minimum number of nodes for auto-scaling + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The minimum number of nodes for auto-scaling")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The minimum number of nodes for auto-scaling", + SerializedName = @"minCount", + PossibleTypes = new [] { typeof(int) })] + public int MinCount { get => _parametersBody.MinCount ?? default(int); set => _parametersBody.MinCount = value; } + + /// + /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions + /// and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode Mode { get => _parametersBody.Mode ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolMode)""); set => _parametersBody.Mode = value; } + + /// Backing field for property. + private string _name; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The port ranges that are allowed to access. The specified ranges are allowed to overlap. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The port ranges that are allowed to access. The specified ranges are allowed to overlap.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The port ranges that are allowed to access. The specified ranges are allowed to overlap.", + SerializedName = @"allowedHostPorts", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPortRange[] NetworkProfileAllowedHostPort { get => _parametersBody.NetworkProfileAllowedHostPort ?? null /* arrayOf */; set => _parametersBody.NetworkProfileAllowedHostPort = value; } + + /// + /// The IDs of the application security groups which agent pool will associate when created. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The IDs of the application security groups which agent pool will associate when created.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IDs of the application security groups which agent pool will associate when created.", + SerializedName = @"applicationSecurityGroups", + PossibleTypes = new [] { typeof(string) })] + public string[] NetworkProfileApplicationSecurityGroup { get => _parametersBody.NetworkProfileApplicationSecurityGroup ?? null /* arrayOf */; set => _parametersBody.NetworkProfileApplicationSecurityGroup = value; } + + /// IPTags of instance-level public IPs. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "IPTags of instance-level public IPs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IPTags of instance-level public IPs.", + SerializedName = @"nodePublicIPTags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIPTag[] NetworkProfileNodePublicIPTag { get => _parametersBody.NetworkProfileNodePublicIPTag ?? null /* arrayOf */; set => _parametersBody.NetworkProfileNodePublicIPTag = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + /// pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. + /// node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, + /// for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-` + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-`")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node pool is created, but nodes will not be recreated with new taints until another operation that requires recreation (e.g. node image upgrade) happens. These taints allow for required configuration to run before the node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with `kubectl taint nodes node1 key1=value1:NoSchedule-`", + SerializedName = @"nodeInitializationTaints", + PossibleTypes = new [] { typeof(string) })] + public string[] NodeInitializationTaint { get => _parametersBody.NodeInitializationTaint ?? null /* arrayOf */; set => _parametersBody.NodeInitializationTaint = value; } + + /// The node labels to be persisted across all nodes in agent pool. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The node labels to be persisted across all nodes in agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The node labels to be persisted across all nodes in agent pool.", + SerializedName = @"nodeLabels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesNodeLabels NodeLabel { get => _parametersBody.NodeLabel ?? null /* object */; set => _parametersBody.NodeLabel = value; } + + /// + /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}", + SerializedName = @"nodePublicIPPrefixID", + PossibleTypes = new [] { typeof(string) })] + public string NodePublicIPPrefixId { get => _parametersBody.NodePublicIPPrefixId ?? null; set => _parametersBody.NodePublicIPPrefixId = value; } + + /// + /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.", + SerializedName = @"nodeTaints", + PossibleTypes = new [] { typeof(string) })] + public string[] NodeTaint { get => _parametersBody.NodeTaint ?? null /* arrayOf */; set => _parametersBody.NodeTaint = value; } + + /// + /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it + /// will apply the default osDisk size according to the vmSize specified. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.", + SerializedName = @"osDiskSizeGB", + PossibleTypes = new [] { typeof(int) })] + public int OSDiskSizeGb { get => _parametersBody.OSDiskSizeGb ?? default(int); set => _parametersBody.OSDiskSizeGb = value; } + + /// + /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + /// defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).", + SerializedName = @"osDiskType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType OSDiskType { get => _parametersBody.OSDiskType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSDiskType)""); set => _parametersBody.OSDiskType = value; } + + /// + /// Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + /// OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 after Windows2019 is deprecated.", + SerializedName = @"osSKU", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku OSSku { get => _parametersBody.OSSku ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Ossku)""); set => _parametersBody.OSSku = value; } + + /// The operating system type. The default is Linux. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The operating system type. The default is Linux.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The operating system type. The default is Linux.", + SerializedName = @"osType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType OSType { get => _parametersBody.OSType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.OSType)""); set => _parametersBody.OSType = value; } + + /// + /// Both patch version and are supported. When is specified, the latest supported + /// patch version is chosen automatically. Updating the agent pool with the same once it has been created will + /// not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools + /// in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control + /// plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version + /// cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).", + SerializedName = @"orchestratorVersion", + PossibleTypes = new [] { typeof(string) })] + public string OrchestratorVersion { get => _parametersBody.OrchestratorVersion ?? null; set => _parametersBody.OrchestratorVersion = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'.", + SerializedName = @"podIPAllocationMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode PodIPAllocationMode { get => _parametersBody.PodIPAllocationMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PodIPAllocationMode)""); set => _parametersBody.PodIPAllocationMode = value; } + + /// + /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", + SerializedName = @"podSubnetID", + PossibleTypes = new [] { typeof(string) })] + public string PodSubnetId { get => _parametersBody.PodSubnetId ?? null; set => _parametersBody.PodSubnetId = value; } + + /// Tells whether the cluster is Running or Stopped + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tells whether the cluster is Running or Stopped")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tells whether the cluster is Running or Stopped", + SerializedName = @"code", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code PowerStateCode { get => _parametersBody.PowerStateCode ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Code)""); set => _parametersBody.PowerStateCode = value; } + + /// The type of Agent Pool. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of Agent Pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of Agent Pool.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType PropertiesType { get => _parametersBody.PropertiesType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolType)""); set => _parametersBody.PropertiesType = value; } + + /// The ID for Proximity Placement Group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID for Proximity Placement Group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID for Proximity Placement Group.", + SerializedName = @"proximityPlacementGroupID", + PossibleTypes = new [] { typeof(string) })] + public string ProximityPlacementGroupId { get => _parametersBody.ProximityPlacementGroupId ?? null; set => _parametersBody.ProximityPlacementGroupId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// + /// Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most + /// one AutoScaleProfile is allowed. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one AutoScaleProfile is allowed.", + SerializedName = @"autoscale", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAutoScaleProfile[] ScaleAutoscale { get => _parametersBody.ScaleAutoscale ?? null /* arrayOf */; set => _parametersBody.ScaleAutoscale = value; } + + /// + /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.", + SerializedName = @"scaleDownMode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode ScaleDownMode { get => _parametersBody.ScaleDownMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleDownMode)""); set => _parametersBody.ScaleDownMode = value; } + + /// + /// Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + /// is allowed. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile is allowed.", + SerializedName = @"manual", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManualScaleProfile[] ScaleManual { get => _parametersBody.ScaleManual ?? null /* arrayOf */; set => _parametersBody.ScaleManual = value; } + + /// + /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.", + SerializedName = @"scaleSetEvictionPolicy", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy ScaleSetEvictionPolicy { get => _parametersBody.ScaleSetEvictionPolicy ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetEvictionPolicy)""); set => _parametersBody.ScaleSetEvictionPolicy = value; } + + /// + /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.", + SerializedName = @"scaleSetPriority", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority ScaleSetPriority { get => _parametersBody.ScaleSetPriority ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ScaleSetPriority)""); set => _parametersBody.ScaleSetPriority = value; } + + /// + /// Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For + /// more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.", + SerializedName = @"enableSecureBoot", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SecurityProfileEnableSecureBoot { get => _parametersBody.SecurityProfileEnableSecureBoot ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.SecurityProfileEnableSecureBoot = value; } + + /// + /// vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + /// node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the default is false.", + SerializedName = @"enableVTPM", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SecurityProfileEnableVtpm { get => _parametersBody.SecurityProfileEnableVtpm ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.SecurityProfileEnableVtpm = value; } + + /// SSH access method of an agent pool. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "SSH access method of an agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SSH access method of an agent pool.", + SerializedName = @"sshAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess SecurityProfileSshAccess { get => _parametersBody.SecurityProfileSshAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AgentPoolSshAccess)""); set => _parametersBody.SecurityProfileSshAccess = value; } + + /// + /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. + /// For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing)", + SerializedName = @"spotMaxPrice", + PossibleTypes = new [] { typeof(float) })] + public float SpotMaxPrice { get => _parametersBody.SpotMaxPrice ?? default(float); set => _parametersBody.SpotMaxPrice = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// The tags to be persisted on the agent pool virtual machine scale set. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tags to be persisted on the agent pool virtual machine scale set.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags to be persisted on the agent pool virtual machine scale set.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfilePropertiesTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// + /// The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + /// honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is + /// 30 minutes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The amount of time (in minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 minutes.", + SerializedName = @"drainTimeoutInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int UpgradeSettingDrainTimeoutInMinute { get => _parametersBody.UpgradeSettingDrainTimeoutInMinute ?? default(int); set => _parametersBody.UpgradeSettingDrainTimeoutInMinute = value; } + + /// + /// 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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"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, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + public string UpgradeSettingMaxSurge { get => _parametersBody.UpgradeSettingMaxSurge ?? null; set => _parametersBody.UpgradeSettingMaxSurge = value; } + + /// + /// The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not + /// specified, the default is 0 minutes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not specified, the default is 0 minutes.", + SerializedName = @"nodeSoakDurationInMinutes", + PossibleTypes = new [] { typeof(int) })] + public int UpgradeSettingNodeSoakDurationInMinute { get => _parametersBody.UpgradeSettingNodeSoakDurationInMinute ?? default(int); set => _parametersBody.UpgradeSettingNodeSoakDurationInMinute = value; } + + /// + /// Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + /// Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout + /// or pod is still being in a running state, can also cause undrainable nodes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes.", + SerializedName = @"undrainableNodeBehavior", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior UpgradeSettingUndrainableNodeBehavior { get => _parametersBody.UpgradeSettingUndrainableNodeBehavior ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UndrainableNodeBehavior)""); set => _parametersBody.UpgradeSettingUndrainableNodeBehavior = value; } + + /// + /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might + /// fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + public string VMSize { get => _parametersBody.VMSize ?? null; set => _parametersBody.VMSize = value; } + + /// The status of nodes in a VirtualMachines agent pool. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The status of nodes in a VirtualMachines agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The status of nodes in a VirtualMachines agent pool.", + SerializedName = @"virtualMachineNodesStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IVirtualMachineNodes[] VirtualMachineNodesStatus { get => _parametersBody.VirtualMachineNodesStatus ?? null /* arrayOf */; set => _parametersBody.VirtualMachineNodesStatus = value; } + + /// + /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to + /// nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", + SerializedName = @"vnetSubnetID", + PossibleTypes = new [] { typeof(string) })] + public string VnetSubnetId { get => _parametersBody.VnetSubnetId ?? null; set => _parametersBody.VnetSubnetId = value; } + + /// + /// The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows + /// agent pool does not have node public IP enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP enabled.", + SerializedName = @"disableOutboundNat", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter WindowProfileDisableOutboundNat { get => _parametersBody.WindowProfileDisableOutboundNat ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.WindowProfileDisableOutboundNat = value; } + + /// Determines the type of workload a node can run. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Determines the type of workload a node can run.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Determines the type of workload a node can run.", + SerializedName = @"workloadRuntime", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime WorkloadRuntime { get => _parametersBody.WorkloadRuntime ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WorkloadRuntime)""); set => _parametersBody.WorkloadRuntime = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzContainerServiceAgentPool_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.NewAzContainerServiceAgentPool_CreateExpanded Clone() + { + var clone = new NewAzContainerServiceAgentPool_CreateExpanded(); + 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._parametersBody = this._parametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ResourceName = this.ResourceName; + 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() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzContainerServiceAgentPool_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsCreateOrUpdate(SubscriptionId, ResourceGroupName, ResourceName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.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.ContainerService.Models.Api20240402Preview.IAgentPool + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceLoadBalancer_CreateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceLoadBalancer_CreateExpanded.cs new file mode 100644 index 000000000000..b422e76a3a43 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceLoadBalancer_CreateExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Creates or updates a load balancer in the specified managed cluster. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzContainerServiceLoadBalancer_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Creates or updates a load balancer in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", ApiVersion = "2024-04-02-preview")] + public partial class NewAzContainerServiceLoadBalancer_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + /// Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + /// named `kubernetes`. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.LoadBalancer(); + + /// + /// Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false + /// manually, both of the external and the internal load balancer will not be selected for services unless they explicitly + /// target it. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false manually, both of the external and the internal load balancer will not be selected for services unless they explicitly target it.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false manually, both of the external and the internal load balancer will not be selected for services unless they explicitly target it.", + SerializedName = @"allowServicePlacement", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowServicePlacement { get => _parametersBody.AllowServicePlacement ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowServicePlacement = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the load balancer. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the load balancer.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the load balancer.", + SerializedName = @"loadBalancerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("LoadBalancerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "matchExpressions is a list of label selector requirements. The requirements are ANDed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] NodeSelectorMatchExpression { get => _parametersBody.NodeSelectorMatchExpression ?? null /* arrayOf */; set => _parametersBody.NodeSelectorMatchExpression = value; } + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + public string[] NodeSelectorMatchLabel { get => _parametersBody.NodeSelectorMatchLabel ?? null /* arrayOf */; set => _parametersBody.NodeSelectorMatchLabel = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always + /// be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. + /// An agent pool can only be the primary pool for a single load balancer. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. An agent pool can only be the primary pool for a single load balancer.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool will always be added to this load balancer. This agent pool must have at least one node and minCount>=1 for autoscaling operations. An agent pool can only be the primary pool for a single load balancer.", + SerializedName = @"primaryAgentPoolName", + PossibleTypes = new [] { typeof(string) })] + public string PrimaryAgentPoolName { get => _parametersBody.PrimaryAgentPoolName ?? null; set => _parametersBody.PrimaryAgentPoolName = value; } + + /// + /// Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. + /// The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in + /// LoadBalancer list. There must be a name of kubernetes in the list. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in LoadBalancer list. There must be a name of kubernetes in the list.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the public load balancer. There will be an internal load balancer created if needed, and the name will be `-internal`. The internal lb shares the same configurations as the external one. The internal lbs are not needed to be included in LoadBalancer list. There must be a name of kubernetes in the list.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string PropertiesName { get => _parametersBody.PropertiesName ?? null; set => _parametersBody.PropertiesName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "matchExpressions is a list of label selector requirements. The requirements are ANDed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceLabelSelectorMatchExpression { get => _parametersBody.ServiceLabelSelectorMatchExpression ?? null /* arrayOf */; set => _parametersBody.ServiceLabelSelectorMatchExpression = value; } + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + public string[] ServiceLabelSelectorMatchLabel { get => _parametersBody.ServiceLabelSelectorMatchLabel ?? null /* arrayOf */; set => _parametersBody.ServiceLabelSelectorMatchLabel = value; } + + /// + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "matchExpressions is a list of label selector requirements. The requirements are ANDed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchExpressions is a list of label selector requirements. The requirements are ANDed.", + SerializedName = @"matchExpressions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILabelSelectorRequirement[] ServiceNamespaceSelectorMatchExpression { get => _parametersBody.ServiceNamespaceSelectorMatchExpression ?? null /* arrayOf */; set => _parametersBody.ServiceNamespaceSelectorMatchExpression = value; } + + /// + /// matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element + /// of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements + /// are ANDed. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is `key`, the operator is `In`, and the values array contains only `value`. The requirements are ANDed.", + SerializedName = @"matchLabels", + PossibleTypes = new [] { typeof(string) })] + public string[] ServiceNamespaceSelectorMatchLabel { get => _parametersBody.ServiceNamespaceSelectorMatchLabel ?? null /* arrayOf */; set => _parametersBody.ServiceNamespaceSelectorMatchLabel = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ILoadBalancer + /// 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ILoadBalancer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzContainerServiceLoadBalancer_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LoadBalancersCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LoadBalancersCreateOrUpdate(SubscriptionId, ResourceGroupName, ResourceName, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ILoadBalancer + /// 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.ContainerService.Models.Api20240402Preview.ILoadBalancer + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, Name=Name, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, Name=Name, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.ILoadBalancer + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ILoadBalancer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceMaintenanceConfiguration_CreateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceMaintenanceConfiguration_CreateExpanded.cs new file mode 100644 index 000000000000..6096c4c923aa --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceMaintenanceConfiguration_CreateExpanded.cs @@ -0,0 +1,683 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Creates or updates a maintenance configuration in the specified managed cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzContainerServiceMaintenanceConfiguration_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Creates or updates a maintenance configuration in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", ApiVersion = "2024-04-02-preview")] + public partial class NewAzContainerServiceMaintenanceConfiguration_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + /// maintenance. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.MaintenanceConfiguration(); + + /// The date of the month. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The date of the month.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date of the month.", + SerializedName = @"dayOfMonth", + PossibleTypes = new [] { typeof(int) })] + public int AbsoluteMonthlyDayOfMonth { get => _parametersBody.AbsoluteMonthlyDayOfMonth ?? default(int); set => _parametersBody.AbsoluteMonthlyDayOfMonth = value; } + + /// Specifies the number of months between each set of occurrences. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the number of months between each set of occurrences.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + public int AbsoluteMonthlyIntervalMonth { get => _parametersBody.AbsoluteMonthlyIntervalMonth ?? default(int); set => _parametersBody.AbsoluteMonthlyIntervalMonth = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _configName; + + /// The name of the maintenance configuration. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the maintenance configuration.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the maintenance configuration.", + SerializedName = @"configName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ConfigName { get => this._configName; set => this._configName = value; } + + /// Specifies the number of days between each set of occurrences. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the number of days between each set of occurrences.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of days between each set of occurrences.", + SerializedName = @"intervalDays", + PossibleTypes = new [] { typeof(int) })] + public int DailyIntervalDay { get => _parametersBody.DailyIntervalDay ?? default(int); set => _parametersBody.DailyIntervalDay = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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; } } + + /// Length of maintenance window range from 4 to 24 hours. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Length of maintenance window range from 4 to 24 hours.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Length of maintenance window range from 4 to 24 hours.", + SerializedName = @"durationHours", + PossibleTypes = new [] { typeof(int) })] + public int MaintenanceWindowDurationHour { get => _parametersBody.MaintenanceWindowDurationHour ?? default(int); set => _parametersBody.MaintenanceWindowDurationHour = value; } + + /// + /// Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' + /// and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 + /// 22:00' in UTC time. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time.", + SerializedName = @"notAllowedDates", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IDateSpan[] MaintenanceWindowNotAllowedDate { get => _parametersBody.MaintenanceWindowNotAllowedDate ?? null /* arrayOf */; set => _parametersBody.MaintenanceWindowNotAllowedDate = value; } + + /// + /// The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive + /// and will not be used for upgrades. If not specified, the maintenance window will be active right away. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away.", + SerializedName = @"startDate", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime MaintenanceWindowStartDate { get => _parametersBody.MaintenanceWindowStartDate ?? default(global::System.DateTime); set => _parametersBody.MaintenanceWindowStartDate = value; } + + /// + /// The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. + /// For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + public string MaintenanceWindowStartTime { get => _parametersBody.MaintenanceWindowStartTime ?? null; set => _parametersBody.MaintenanceWindowStartTime = value; } + + /// + /// The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is + /// '+00:00'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'.", + SerializedName = @"utcOffset", + PossibleTypes = new [] { typeof(string) })] + public string MaintenanceWindowUtcOffset { get => _parametersBody.MaintenanceWindowUtcOffset ?? null; set => _parametersBody.MaintenanceWindowUtcOffset = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Time slots on which upgrade is not allowed. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time slots on which upgrade is not allowed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time slots on which upgrade is not allowed.", + SerializedName = @"notAllowedTime", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeSpan[] NotAllowedTime { get => _parametersBody.NotAllowedTime ?? null /* arrayOf */; set => _parametersBody.NotAllowedTime = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Specifies on which day of the week the maintenance occurs. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies on which day of the week the maintenance occurs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay RelativeMonthlyDayOfWeek { get => _parametersBody.RelativeMonthlyDayOfWeek ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); set => _parametersBody.RelativeMonthlyDayOfWeek = value; } + + /// Specifies the number of months between each set of occurrences. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the number of months between each set of occurrences.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of months between each set of occurrences.", + SerializedName = @"intervalMonths", + PossibleTypes = new [] { typeof(int) })] + public int RelativeMonthlyIntervalMonth { get => _parametersBody.RelativeMonthlyIntervalMonth ?? default(int); set => _parametersBody.RelativeMonthlyIntervalMonth = value; } + + /// + /// Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.", + SerializedName = @"weekIndex", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type RelativeMonthlyWeekIndex { get => _parametersBody.RelativeMonthlyWeekIndex ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Type)""); set => _parametersBody.RelativeMonthlyWeekIndex = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.", + SerializedName = @"timeInWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITimeInWeek[] TimeInWeek { get => _parametersBody.TimeInWeek ?? null /* arrayOf */; set => _parametersBody.TimeInWeek = value; } + + /// Specifies on which day of the week the maintenance occurs. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies on which day of the week the maintenance occurs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies on which day of the week the maintenance occurs.", + SerializedName = @"dayOfWeek", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay WeeklyDayOfWeek { get => _parametersBody.WeeklyDayOfWeek ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.WeekDay)""); set => _parametersBody.WeeklyDayOfWeek = value; } + + /// Specifies the number of weeks between each set of occurrences. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the number of weeks between each set of occurrences.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the number of weeks between each set of occurrences.", + SerializedName = @"intervalWeeks", + PossibleTypes = new [] { typeof(int) })] + public int WeeklyIntervalWeek { get => _parametersBody.WeeklyIntervalWeek ?? default(int); set => _parametersBody.WeeklyIntervalWeek = 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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + /// 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzContainerServiceMaintenanceConfiguration_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MaintenanceConfigurationsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MaintenanceConfigurationsCreateOrUpdate(SubscriptionId, ResourceGroupName, ResourceName, ConfigName, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,ConfigName=ConfigName,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + /// 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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, ConfigName=ConfigName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, ConfigName=ConfigName, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IMaintenanceConfiguration + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceManagedClusterSnapshot_CreateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceManagedClusterSnapshot_CreateExpanded.cs new file mode 100644 index 000000000000..df9906aace13 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceManagedClusterSnapshot_CreateExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Creates or updates a managed cluster snapshot. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzContainerServiceManagedClusterSnapshot_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Creates or updates a managed cluster snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class NewAzContainerServiceManagedClusterSnapshot_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A managed cluster snapshot resource. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterSnapshot(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// This is the ARM ID of the source object to be used to create the target object. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the ARM ID of the source object to be used to create the target object.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string CreationDataSourceResourceId { get => _parametersBody.CreationDataSourceResourceId ?? null; set => _parametersBody.CreationDataSourceResourceId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _parametersBody.Location ?? null; set => _parametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// The type of a snapshot. The default is NodePool. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of a snapshot. The default is NodePool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of a snapshot. The default is NodePool.", + SerializedName = @"snapshotType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType SnapshotType { get => _parametersBody.SnapshotType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType)""); set => _parametersBody.SnapshotType = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzContainerServiceManagedClusterSnapshot_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClusterSnapshotsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClusterSnapshotsCreateOrUpdate(SubscriptionId, ResourceGroupName, ResourceName, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceManagedCluster_CreateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceManagedCluster_CreateExpanded.cs new file mode 100644 index 000000000000..1d833dcaa35f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceManagedCluster_CreateExpanded.cs @@ -0,0 +1,2258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Creates or updates a managed cluster. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzContainerServiceManagedCluster_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Creates or updates a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class NewAzContainerServiceManagedCluster_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Managed cluster. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedCluster(); + + /// The list of AAD group object IDs that will have admin role of the cluster. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of AAD group object IDs that will have admin role of the cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of AAD group object IDs that will have admin role of the cluster.", + SerializedName = @"adminGroupObjectIDs", + PossibleTypes = new [] { typeof(string) })] + public string[] AadProfileAdminGroupObjectID { get => _parametersBody.AadProfileAdminGroupObjectID ?? null /* arrayOf */; set => _parametersBody.AadProfileAdminGroupObjectID = value; } + + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"clientAppID", + PossibleTypes = new [] { typeof(string) })] + public string AadProfileClientAppId { get => _parametersBody.AadProfileClientAppId ?? null; set => _parametersBody.AadProfileClientAppId = value; } + + /// Whether to enable Azure RBAC for Kubernetes authorization. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Azure RBAC for Kubernetes authorization.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure RBAC for Kubernetes authorization.", + SerializedName = @"enableAzureRBAC", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AadProfileEnableAzureRbac { get => _parametersBody.AadProfileEnableAzureRbac ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AadProfileEnableAzureRbac = value; } + + /// Whether to enable managed AAD. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable managed AAD.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable managed AAD.", + SerializedName = @"managed", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AadProfileManaged { get => _parametersBody.AadProfileManaged ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AadProfileManaged = value; } + + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppID", + PossibleTypes = new [] { typeof(string) })] + public string AadProfileServerAppId { get => _parametersBody.AadProfileServerAppId ?? null; set => _parametersBody.AadProfileServerAppId = value; } + + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppSecret", + PossibleTypes = new [] { typeof(string) })] + public string AadProfileServerAppSecret { get => _parametersBody.AadProfileServerAppSecret ?? null; set => _parametersBody.AadProfileServerAppSecret = value; } + + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription.", + SerializedName = @"tenantID", + PossibleTypes = new [] { typeof(string) })] + public string AadProfileTenantId { get => _parametersBody.AadProfileTenantId ?? null; set => _parametersBody.AadProfileTenantId = value; } + + /// The profile of managed cluster add-on. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The profile of managed cluster add-on.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The profile of managed cluster add-on.", + SerializedName = @"addonProfiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesAddonProfiles AddonProfile { get => _parametersBody.AddonProfile ?? null /* object */; set => _parametersBody.AddonProfile = value; } + + /// The agent pool properties. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The agent pool properties.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The agent pool properties.", + SerializedName = @"agentPoolProfiles", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAgentPoolProfile[] AgentPoolProfile { get => _parametersBody.AgentPoolProfile ?? null /* arrayOf */; set => _parametersBody.AgentPoolProfile = value; } + + /// Indicates if AI toolchain operator enabled or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates if AI toolchain operator enabled or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if AI toolchain operator enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AiToolchainOperatorProfileEnabled { get => _parametersBody.AiToolchainOperatorProfileEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AiToolchainOperatorProfileEnabled = value; } + + /// + /// IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use + /// Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized + /// IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges).", + SerializedName = @"authorizedIPRanges", + PossibleTypes = new [] { typeof(string) })] + public string[] ApiServerAccessProfileAuthorizedIPRange { get => _parametersBody.ApiServerAccessProfileAuthorizedIPRange ?? null /* arrayOf */; set => _parametersBody.ApiServerAccessProfileAuthorizedIPRange = value; } + + /// Whether to disable run command for the cluster or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to disable run command for the cluster or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to disable run command for the cluster or not.", + SerializedName = @"disableRunCommand", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ApiServerAccessProfileDisableRunCommand { get => _parametersBody.ApiServerAccessProfileDisableRunCommand ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ApiServerAccessProfileDisableRunCommand = value; } + + /// + /// For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters).", + SerializedName = @"enablePrivateCluster", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ApiServerAccessProfileEnablePrivateCluster { get => _parametersBody.ApiServerAccessProfileEnablePrivateCluster ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ApiServerAccessProfileEnablePrivateCluster = value; } + + /// Whether to create additional public FQDN for private cluster or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to create additional public FQDN for private cluster or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to create additional public FQDN for private cluster or not.", + SerializedName = @"enablePrivateClusterPublicFQDN", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ApiServerAccessProfileEnablePrivateClusterPublicFqdn { get => _parametersBody.ApiServerAccessProfileEnablePrivateClusterPublicFqdn ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ApiServerAccessProfileEnablePrivateClusterPublicFqdn = value; } + + /// Whether to enable apiserver vnet integration for the cluster or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable apiserver vnet integration for the cluster or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable apiserver vnet integration for the cluster or not.", + SerializedName = @"enableVnetIntegration", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ApiServerAccessProfileEnableVnetIntegration { get => _parametersBody.ApiServerAccessProfileEnableVnetIntegration ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ApiServerAccessProfileEnableVnetIntegration = value; } + + /// + /// The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + /// Allowed values are 'system' and 'none'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'.", + SerializedName = @"privateDNSZone", + PossibleTypes = new [] { typeof(string) })] + public string ApiServerAccessProfilePrivateDnsZone { get => _parametersBody.ApiServerAccessProfilePrivateDnsZone ?? null; set => _parametersBody.ApiServerAccessProfilePrivateDnsZone = value; } + + /// + /// It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + /// integration. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet integration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet integration.", + SerializedName = @"subnetId", + PossibleTypes = new [] { typeof(string) })] + public string ApiServerAccessProfileSubnetId { get => _parametersBody.ApiServerAccessProfileSubnetId ?? null; set => _parametersBody.ApiServerAccessProfileSubnetId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Indicates if Application Monitoring Auto Instrumentation is enabled or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates if Application Monitoring Auto Instrumentation is enabled or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Auto Instrumentation is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoInstrumentationEnabled { get => _parametersBody.AutoInstrumentationEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AutoInstrumentationEnabled = value; } + + /// Valid values are 'true' and 'false' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Valid values are 'true' and 'false'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Valid values are 'true' and 'false'", + SerializedName = @"balance-similar-node-groups", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileBalanceSimilarNodeGroup { get => _parametersBody.AutoScalerProfileBalanceSimilarNodeGroup ?? null; set => _parametersBody.AutoScalerProfileBalanceSimilarNodeGroup = value; } + + /// + /// If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot + /// be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset + /// pods are deleted or evicted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, all daemonset pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.", + SerializedName = @"daemonset-eviction-for-empty-nodes", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoScalerProfileDaemonsetEvictionForEmptyNode { get => _parametersBody.AutoScalerProfileDaemonsetEvictionForEmptyNode ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AutoScalerProfileDaemonsetEvictionForEmptyNode = value; } + + /// + /// If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod + /// cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring + /// that daemonset pods are deleted or evicted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, all daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are deleted or evicted.", + SerializedName = @"daemonset-eviction-for-occupied-nodes", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoScalerProfileDaemonsetEvictionForOccupiedNode { get => _parametersBody.AutoScalerProfileDaemonsetEvictionForOccupiedNode ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AutoScalerProfileDaemonsetEvictionForOccupiedNode = value; } + + /// Available values are: 'least-waste', 'most-pods', 'priority', 'random'. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Available values are: 'least-waste', 'most-pods', 'priority', 'random'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Available values are: 'least-waste', 'most-pods', 'priority', 'random'.", + SerializedName = @"expander", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander AutoScalerProfileExpander { get => _parametersBody.AutoScalerProfileExpander ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Expander)""); set => _parametersBody.AutoScalerProfileExpander = value; } + + /// + /// If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If set to true, the resources used by daemonset will be taken into account when making scaling down decisions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, the resources used by daemonset will be taken into account when making scaling down decisions.", + SerializedName = @"ignore-daemonsets-utilization", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AutoScalerProfileIgnoreDaemonsetsUtilization { get => _parametersBody.AutoScalerProfileIgnoreDaemonsetsUtilization ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AutoScalerProfileIgnoreDaemonsetsUtilization = value; } + + /// The default is 10. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is 10.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 10.", + SerializedName = @"max-empty-bulk-delete", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileMaxEmptyBulkDelete { get => _parametersBody.AutoScalerProfileMaxEmptyBulkDelete ?? null; set => _parametersBody.AutoScalerProfileMaxEmptyBulkDelete = value; } + + /// The default is 600. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is 600.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 600.", + SerializedName = @"max-graceful-termination-sec", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileMaxGracefulTerminationSec { get => _parametersBody.AutoScalerProfileMaxGracefulTerminationSec ?? null; set => _parametersBody.AutoScalerProfileMaxGracefulTerminationSec = value; } + + /// + /// The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"max-node-provision-time", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileMaxNodeProvisionTime { get => _parametersBody.AutoScalerProfileMaxNodeProvisionTime ?? null; set => _parametersBody.AutoScalerProfileMaxNodeProvisionTime = value; } + + /// The default is 45. The maximum is 100 and the minimum is 0. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is 45. The maximum is 100 and the minimum is 0.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is 45. The maximum is 100 and the minimum is 0.", + SerializedName = @"max-total-unready-percentage", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileMaxTotalUnreadyPercentage { get => _parametersBody.AutoScalerProfileMaxTotalUnreadyPercentage ?? null; set => _parametersBody.AutoScalerProfileMaxTotalUnreadyPercentage = value; } + + /// + /// For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all + /// the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be + /// an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc).", + SerializedName = @"new-pod-scale-up-delay", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileNewPodScaleUpDelay { get => _parametersBody.AutoScalerProfileNewPodScaleUpDelay ?? null; set => _parametersBody.AutoScalerProfileNewPodScaleUpDelay = value; } + + /// This must be an integer. The default is 3. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This must be an integer. The default is 3.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This must be an integer. The default is 3.", + SerializedName = @"ok-total-unready-count", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileOkTotalUnreadyCount { get => _parametersBody.AutoScalerProfileOkTotalUnreadyCount ?? null; set => _parametersBody.AutoScalerProfileOkTotalUnreadyCount = value; } + + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-add", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileScaleDownDelayAfterAdd { get => _parametersBody.AutoScalerProfileScaleDownDelayAfterAdd ?? null; set => _parametersBody.AutoScalerProfileScaleDownDelayAfterAdd = value; } + + /// + /// The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + /// is supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-delete", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileScaleDownDelayAfterDelete { get => _parametersBody.AutoScalerProfileScaleDownDelayAfterDelete ?? null; set => _parametersBody.AutoScalerProfileScaleDownDelayAfterDelete = value; } + + /// + /// The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-delay-after-failure", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileScaleDownDelayAfterFailure { get => _parametersBody.AutoScalerProfileScaleDownDelayAfterFailure ?? null; set => _parametersBody.AutoScalerProfileScaleDownDelayAfterFailure = value; } + + /// + /// The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-unneeded-time", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileScaleDownUnneededTime { get => _parametersBody.AutoScalerProfileScaleDownUnneededTime ?? null; set => _parametersBody.AutoScalerProfileScaleDownUnneededTime = value; } + + /// + /// The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.", + SerializedName = @"scale-down-unready-time", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileScaleDownUnreadyTime { get => _parametersBody.AutoScalerProfileScaleDownUnreadyTime ?? null; set => _parametersBody.AutoScalerProfileScaleDownUnreadyTime = value; } + + /// The default is '0.5'. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is '0.5'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '0.5'.", + SerializedName = @"scale-down-utilization-threshold", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileScaleDownUtilizationThreshold { get => _parametersBody.AutoScalerProfileScaleDownUtilizationThreshold ?? null; set => _parametersBody.AutoScalerProfileScaleDownUtilizationThreshold = value; } + + /// The default is '10'. Values must be an integer number of seconds. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is '10'. Values must be an integer number of seconds.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is '10'. Values must be an integer number of seconds.", + SerializedName = @"scan-interval", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileScanInterval { get => _parametersBody.AutoScalerProfileScanInterval ?? null; set => _parametersBody.AutoScalerProfileScanInterval = value; } + + /// The default is true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"skip-nodes-with-local-storage", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileSkipNodesWithLocalStorage { get => _parametersBody.AutoScalerProfileSkipNodesWithLocalStorage ?? null; set => _parametersBody.AutoScalerProfileSkipNodesWithLocalStorage = value; } + + /// The default is true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is true.", + SerializedName = @"skip-nodes-with-system-pods", + PossibleTypes = new [] { typeof(string) })] + public string AutoScalerProfileSkipNodesWithSystemPod { get => _parametersBody.AutoScalerProfileSkipNodesWithSystemPod ?? null; set => _parametersBody.AutoScalerProfileSkipNodesWithSystemPod = value; } + + /// + /// The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA.", + SerializedName = @"nodeOSUpgradeChannel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel AutoUpgradeProfileNodeOSUpgradeChannel { get => _parametersBody.AutoUpgradeProfileNodeOSUpgradeChannel ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeOSUpgradeChannel)""); set => _parametersBody.AutoUpgradeProfileNodeOSUpgradeChannel = value; } + + /// + /// For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel).", + SerializedName = @"upgradeChannel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel AutoUpgradeProfileUpgradeChannel { get => _parametersBody.AutoUpgradeProfileUpgradeChannel ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.UpgradeChannel)""); set => _parametersBody.AutoUpgradeProfileUpgradeChannel = value; } + + /// Whether to enable Azure Key Vault key management service. The default is false. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Azure Key Vault key management service. The default is false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure Key Vault key management service. The default is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AzureKeyVaultKmEnabled { get => _parametersBody.AzureKeyVaultKmEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AzureKeyVaultKmEnabled = value; } + + /// + /// Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + /// for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key + /// identifier. When Azure Key Vault key management service is disabled, leave the field empty. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty.", + SerializedName = @"keyId", + PossibleTypes = new [] { typeof(string) })] + public string AzureKeyVaultKmKeyId { get => _parametersBody.AzureKeyVaultKmKeyId ?? null; set => _parametersBody.AzureKeyVaultKmKeyId = value; } + + /// + /// Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public + /// access from all networks. `Private` means the key vault disables public access and enables private link. The default value + /// is `Public`. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Network access of key vault. The possible values are `Public` and `Private`. `Public` means the key vault allows public access from all networks. `Private` means the key vault disables public access and enables private link. The default value is `Public`.", + SerializedName = @"keyVaultNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes AzureKeyVaultKmKeyVaultNetworkAccess { get => _parametersBody.AzureKeyVaultKmKeyVaultNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KeyVaultNetworkAccessTypes)""); set => _parametersBody.AzureKeyVaultKmKeyVaultNetworkAccess = value; } + + /// + /// Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource + /// ID. When keyVaultNetworkAccess is `Public`, leave the field empty. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of key vault. When keyVaultNetworkAccess is `Private`, this field is required and must be a valid resource ID. When keyVaultNetworkAccess is `Public`, leave the field empty.", + SerializedName = @"keyVaultResourceId", + PossibleTypes = new [] { typeof(string) })] + public string AzureKeyVaultKmKeyVaultResourceId { get => _parametersBody.AzureKeyVaultKmKeyVaultResourceId ?? null; set => _parametersBody.AzureKeyVaultKmKeyVaultResourceId = value; } + + /// Whether to enable AzureBlob CSI Driver. The default value is false. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable AzureBlob CSI Driver. The default value is false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureBlob CSI Driver. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter BlobCsiDriverEnabled { get => _parametersBody.BlobCsiDriverEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.BlobCsiDriverEnabled = value; } + + /// The source where the artifacts are downloaded from. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The source where the artifacts are downloaded from.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The source where the artifacts are downloaded from.", + SerializedName = @"artifactSource", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource BootstrapProfileArtifactSource { get => _parametersBody.BootstrapProfileArtifactSource ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ArtifactSource)""); set => _parametersBody.BootstrapProfileArtifactSource = value; } + + /// + /// The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy.", + SerializedName = @"containerRegistryId", + PossibleTypes = new [] { typeof(string) })] + public string BootstrapProfileContainerRegistryId { get => _parametersBody.BootstrapProfileContainerRegistryId ?? null; set => _parametersBody.BootstrapProfileContainerRegistryId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// Istio egress gateways. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Istio egress gateways.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio egress gateways.", + SerializedName = @"egressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioEgressGateway[] ComponentEgressGateway { get => _parametersBody.ComponentEgressGateway ?? null /* arrayOf */; set => _parametersBody.ComponentEgressGateway = value; } + + /// Istio ingress gateways. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Istio ingress gateways.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Istio ingress gateways.", + SerializedName = @"ingressGateways", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IIstioIngressGateway[] ComponentIngressGateway { get => _parametersBody.ComponentIngressGateway ?? null /* arrayOf */; set => _parametersBody.ComponentIngressGateway = value; } + + /// + /// Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom metrics will be emitted if this field is false but the container insights enabled field is false")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disableCustomMetrics", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ContainerInsightDisableCustomMetric { get => _parametersBody.ContainerInsightDisableCustomMetric ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ContainerInsightDisableCustomMetric = value; } + + /// + /// Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + /// metrics will be emitted if this field is false but the container insights enabled field is false + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus metrics will be emitted if this field is false but the container insights enabled field is false")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus metrics will be emitted if this field is false but the container insights enabled field is false", + SerializedName = @"disablePrometheusMetricsScraping", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ContainerInsightDisablePrometheusMetricsScraping { get => _parametersBody.ContainerInsightDisablePrometheusMetricsScraping ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ContainerInsightDisablePrometheusMetricsScraping = value; } + + /// Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates if Azure Monitor Container Insights Logs Addon is enabled or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Azure Monitor Container Insights Logs Addon is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ContainerInsightEnabled { get => _parametersBody.ContainerInsightEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ContainerInsightEnabled = value; } + + /// + /// Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string ContainerInsightLogAnalyticsWorkspaceResourceId { get => _parametersBody.ContainerInsightLogAnalyticsWorkspaceResourceId ?? null; set => _parametersBody.ContainerInsightLogAnalyticsWorkspaceResourceId = value; } + + /// The syslog host port. If not specified, the default port is 28330. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The syslog host port. If not specified, the default port is 28330.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The syslog host port. If not specified, the default port is 28330.", + SerializedName = @"syslogPort", + PossibleTypes = new [] { typeof(long) })] + public long ContainerInsightSyslogPort { get => _parametersBody.ContainerInsightSyslogPort ?? default(long); set => _parametersBody.ContainerInsightSyslogPort = value; } + + /// + /// The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes + /// Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + /// For more information see aka.ms/aks/docs/cost-analysis. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. If not specified, the default is false. For more information see aka.ms/aks/docs/cost-analysis.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter CostAnalysisEnabled { get => _parametersBody.CostAnalysisEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.CostAnalysisEnabled = value; } + + /// This is the ARM ID of the source object to be used to create the target object. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the ARM ID of the source object to be used to create the target object.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string CreationDataSourceResourceId { get => _parametersBody.CreationDataSourceResourceId ?? null; set => _parametersBody.CreationDataSourceResourceId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, + /// this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + /// empty. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource ID of the Log Analytics workspace to be associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field empty.", + SerializedName = @"logAnalyticsWorkspaceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string DefenderLogAnalyticsWorkspaceResourceId { get => _parametersBody.DefenderLogAnalyticsWorkspaceResourceId ?? null; set => _parametersBody.DefenderLogAnalyticsWorkspaceResourceId = value; } + + /// + /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + /// that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview).", + SerializedName = @"disableLocalAccounts", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DisableLocalAccount { get => _parametersBody.DisableLocalAccount ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.DisableLocalAccount = value; } + + /// Whether to enable AzureDisk CSI Driver. The default value is true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable AzureDisk CSI Driver. The default value is true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureDisk CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DiskCsiDriverEnabled { get => _parametersBody.DiskCsiDriverEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.DiskCsiDriverEnabled = value; } + + /// The version of AzureDisk CSI Driver. The default value is v1. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The version of AzureDisk CSI Driver. The default value is v1.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of AzureDisk CSI Driver. The default value is v1.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + public string DiskCsiDriverVersion { get => _parametersBody.DiskCsiDriverVersion ?? null; set => _parametersBody.DiskCsiDriverVersion = value; } + + /// + /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'", + SerializedName = @"diskEncryptionSetID", + PossibleTypes = new [] { typeof(string) })] + public string DiskEncryptionSetId { get => _parametersBody.DiskEncryptionSetId ?? null; set => _parametersBody.DiskEncryptionSetId = value; } + + /// This cannot be updated once the Managed Cluster has been created. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This cannot be updated once the Managed Cluster has been created.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be updated once the Managed Cluster has been created.", + SerializedName = @"dnsPrefix", + PossibleTypes = new [] { typeof(string) })] + public string DnsPrefix { get => _parametersBody.DnsPrefix ?? null; set => _parametersBody.DnsPrefix = value; } + + /// + /// The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) + /// for more details on Namespace as a ARM Resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM Resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM Resource.", + SerializedName = @"enableNamespaceResources", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableNamespaceResource { get => _parametersBody.EnableNamespaceResource ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableNamespaceResource = value; } + + /// + /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes + /// v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp.", + SerializedName = @"enablePodSecurityPolicy", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnablePodSecurityPolicy { get => _parametersBody.EnablePodSecurityPolicy ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnablePodSecurityPolicy = value; } + + /// Whether to enable Kubernetes Role-Based Access Control. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Kubernetes Role-Based Access Control.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Kubernetes Role-Based Access Control.", + SerializedName = @"enableRBAC", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableRbac { get => _parametersBody.EnableRbac ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableRbac = value; } + + /// The name of the extended location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the extended location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationName { get => _parametersBody.ExtendedLocationName ?? null; set => _parametersBody.ExtendedLocationName = value; } + + /// The type of the extended location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the extended location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes ExtendedLocationType { get => _parametersBody.ExtendedLocationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ExtendedLocationTypes)""); set => _parametersBody.ExtendedLocationType = value; } + + /// Whether to enable AzureFile CSI Driver. The default value is true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable AzureFile CSI Driver. The default value is true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable AzureFile CSI Driver. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter FileCsiDriverEnabled { get => _parametersBody.FileCsiDriverEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.FileCsiDriverEnabled = value; } + + /// This cannot be updated once the Managed Cluster has been created. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This cannot be updated once the Managed Cluster has been created.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This cannot be updated once the Managed Cluster has been created.", + SerializedName = @"fqdnSubdomain", + PossibleTypes = new [] { typeof(string) })] + public string FqdnSubdomain { get => _parametersBody.FqdnSubdomain ?? null; set => _parametersBody.FqdnSubdomain = value; } + + /// + /// Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet + /// which is used to create the managed cluster. + ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"dnsServer", + PossibleTypes = new [] { typeof(string) })] + public string GmsaProfileDnsServer { get => _parametersBody.GmsaProfileDnsServer ?? null; set => _parametersBody.GmsaProfileDnsServer = value; } + + /// Specifies whether to enable Windows gMSA in the managed cluster. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies whether to enable Windows gMSA in the managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether to enable Windows gMSA in the managed cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter GmsaProfileEnabled { get => _parametersBody.GmsaProfileEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.GmsaProfileEnabled = value; } + + /// + /// Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the + /// vnet which is used to create the managed cluster. + ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster.", + SerializedName = @"rootDomainName", + PossibleTypes = new [] { typeof(string) })] + public string GmsaProfileRootDomainName { get => _parametersBody.GmsaProfileRootDomainName ?? null; set => _parametersBody.GmsaProfileRootDomainName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The HTTP proxy server endpoint to use. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The HTTP proxy server endpoint to use.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTP proxy server endpoint to use.", + SerializedName = @"httpProxy", + PossibleTypes = new [] { typeof(string) })] + public string HttpProxyConfigHttpProxy { get => _parametersBody.HttpProxyConfigHttpProxy ?? null; set => _parametersBody.HttpProxyConfigHttpProxy = value; } + + /// The HTTPS proxy server endpoint to use. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The HTTPS proxy server endpoint to use.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The HTTPS proxy server endpoint to use.", + SerializedName = @"httpsProxy", + PossibleTypes = new [] { typeof(string) })] + public string HttpProxyConfigHttpsProxy { get => _parametersBody.HttpProxyConfigHttpsProxy ?? null; set => _parametersBody.HttpProxyConfigHttpsProxy = value; } + + /// The endpoints that should not go through proxy. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The endpoints that should not go through proxy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The endpoints that should not go through proxy.", + SerializedName = @"noProxy", + PossibleTypes = new [] { typeof(string) })] + public string[] HttpProxyConfigNoProxy { get => _parametersBody.HttpProxyConfigNoProxy ?? null /* arrayOf */; set => _parametersBody.HttpProxyConfigNoProxy = value; } + + /// Alternative CA cert to use for connecting to proxy servers. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Alternative CA cert to use for connecting to proxy servers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Alternative CA cert to use for connecting to proxy servers.", + SerializedName = @"trustedCa", + PossibleTypes = new [] { typeof(string) })] + public string HttpProxyConfigTrustedCa { get => _parametersBody.HttpProxyConfigTrustedCa ?? null; set => _parametersBody.HttpProxyConfigTrustedCa = value; } + + /// + /// The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, + /// and managed cluster only accept one delegated identity resource. Internal use only. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. Internal use only.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The delegated identity resources assigned to this managed cluster. This can only be set by another Azure Resource Provider, and managed cluster only accept one delegated identity resource. Internal use only.", + SerializedName = @"delegatedResources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.IDelegatedResources IdentityDelegatedResource { get => _parametersBody.IdentityDelegatedResource ?? null /* object */; set => _parametersBody.IdentityDelegatedResource = value; } + + /// Identities associated with the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identities associated with the cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identities associated with the cluster.", + SerializedName = @"identityProfile", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPropertiesIdentityProfile IdentityProfile { get => _parametersBody.IdentityProfile ?? null /* object */; set => _parametersBody.IdentityProfile = value; } + + /// + /// For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity).", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType IdentityType { get => _parametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ResourceIdentityType)""); set => _parametersBody.IdentityType = value; } + + /// + /// The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => _parametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _parametersBody.IdentityUserAssignedIdentity = value; } + + /// Backing field for property. + private string _ifMatch; + + /// The request should only proceed if an entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if an entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if an entity matches this string.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// The request should only proceed if no entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if no entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if no entity matches this string.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = value; } + + /// Whether to enable Image Cleaner on AKS cluster. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Image Cleaner on AKS cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Image Cleaner on AKS cluster.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImageCleanerEnabled { get => _parametersBody.ImageCleanerEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ImageCleanerEnabled = value; } + + /// Image Cleaner scanning interval in hours. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Image Cleaner scanning interval in hours.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Image Cleaner scanning interval in hours.", + SerializedName = @"intervalHours", + PossibleTypes = new [] { typeof(int) })] + public int ImageCleanerIntervalHour { get => _parametersBody.ImageCleanerIntervalHour ?? default(int); set => _parametersBody.ImageCleanerIntervalHour = value; } + + /// Whether to enable image integrity. The default value is false. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable image integrity. The default value is false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable image integrity. The default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImageIntegrityEnabled { get => _parametersBody.ImageIntegrityEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ImageIntegrityEnabled = 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 revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary + /// upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of revisions of the Istio control plane. When an upgrade is not in progress, this holds one value. When canary upgrade is in progress, this can only hold two consecutive values. For more information, see: https://learn.microsoft.com/en-us/azure/aks/istio-upgrade", + SerializedName = @"revisions", + PossibleTypes = new [] { typeof(string) })] + public string[] IstioRevision { get => _parametersBody.IstioRevision ?? null /* arrayOf */; set => _parametersBody.IstioRevision = value; } + + /// Whether to enable KEDA. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable KEDA.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable KEDA.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter KedaEnabled { get => _parametersBody.KedaEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.KedaEnabled = value; } + + /// + /// This is primarily used to expose different UI experiences in the portal for different kinds + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is primarily used to expose different UI experiences in the portal for different kinds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is primarily used to expose different UI experiences in the portal for different kinds", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(string) })] + public string Kind { get => _parametersBody.Kind ?? null; set => _parametersBody.Kind = value; } + + /// + /// Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric.", + SerializedName = @"metricAnnotationsAllowList", + PossibleTypes = new [] { typeof(string) })] + public string KubeStateMetricAnnotationsAllowList { get => _parametersBody.KubeStateMetricAnnotationsAllowList ?? null; set => _parametersBody.KubeStateMetricAnnotationsAllowList = value; } + + /// + /// Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. ", + SerializedName = @"metricLabelsAllowlist", + PossibleTypes = new [] { typeof(string) })] + public string KubeStateMetricLabelsAllowlist { get => _parametersBody.KubeStateMetricLabelsAllowlist ?? null; set => _parametersBody.KubeStateMetricLabelsAllowlist = value; } + + /// + /// When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed + /// sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + /// however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) + /// for more details. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + public string KubernetesVersion { get => _parametersBody.KubernetesVersion ?? null; set => _parametersBody.KubernetesVersion = value; } + + /// The administrator username to use for Linux VMs. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The administrator username to use for Linux VMs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The administrator username to use for Linux VMs.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + public string LinuxProfileAdminUsername { get => _parametersBody.LinuxProfileAdminUsername ?? null; set => _parametersBody.LinuxProfileAdminUsername = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _parametersBody.Location ?? null; set => _parametersBody.Location = value; } + + /// Whether to enable the Prometheus collector + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable the Prometheus collector")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable the Prometheus collector", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter MetricEnabled { get => _parametersBody.MetricEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.MetricEnabled = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The network configuration profile. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The network configuration profile.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The network configuration profile.", + SerializedName = @"networkProfile", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceNetworkProfile NetworkProfile { get => _parametersBody.NetworkProfile ?? null /* object */; set => _parametersBody.NetworkProfile = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Once the mode it set to Auto, it cannot be changed back to Manual. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Once the mode it set to Auto, it cannot be changed back to Manual.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Once the mode it set to Auto, it cannot be changed back to Manual.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode NodeProvisioningProfileMode { get => _parametersBody.NodeProvisioningProfileMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.NodeProvisioningMode)""); set => _parametersBody.NodeProvisioningProfileMode = value; } + + /// The name of the resource group containing agent pool nodes. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the resource group containing agent pool nodes.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the resource group containing agent pool nodes.", + SerializedName = @"nodeResourceGroup", + PossibleTypes = new [] { typeof(string) })] + public string NodeResourceGroup { get => _parametersBody.NodeResourceGroup ?? null; set => _parametersBody.NodeResourceGroup = value; } + + /// The restriction level applied to the cluster's node resource group + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The restriction level applied to the cluster's node resource group")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The restriction level applied to the cluster's node resource group", + SerializedName = @"restrictionLevel", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel NodeResourceGroupProfileRestrictionLevel { get => _parametersBody.NodeResourceGroupProfileRestrictionLevel ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.RestrictionLevel)""); set => _parametersBody.NodeResourceGroupProfileRestrictionLevel = value; } + + /// Whether to enable Node Restriction + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Node Restriction")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Node Restriction", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter NodeRestrictionEnabled { get => _parametersBody.NodeRestrictionEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.NodeRestrictionEnabled = value; } + + /// Whether the OIDC issuer is enabled. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether the OIDC issuer is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the OIDC issuer is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter OidcIssuerProfileEnabled { get => _parametersBody.OidcIssuerProfileEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.OidcIssuerProfileEnabled = value; } + + /// + /// Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter OpenTelemetryLogEnabled { get => _parametersBody.OpenTelemetryLogEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.OpenTelemetryLogEnabled = value; } + + /// + /// The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + public long OpenTelemetryLogPort { get => _parametersBody.OpenTelemetryLogPort ?? default(long); set => _parametersBody.OpenTelemetryLogPort = value; } + + /// Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates if Application Monitoring Open Telemetry Metrics is enabled or not.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates if Application Monitoring Open Telemetry Metrics is enabled or not.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter OpenTelemetryMetricEnabled { get => _parametersBody.OpenTelemetryMetricEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.OpenTelemetryMetricEnabled = value; } + + /// + /// The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333.", + SerializedName = @"port", + PossibleTypes = new [] { typeof(long) })] + public long OpenTelemetryMetricPort { get => _parametersBody.OpenTelemetryMetricPort ?? default(long); set => _parametersBody.OpenTelemetryMetricPort = value; } + + /// + /// Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections + /// such as checking for deprecated API usage. Enable this option only with caution. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to force upgrade the cluster. Note that this option instructs upgrade operation to bypass upgrade protections such as checking for deprecated API usage. Enable this option only with caution.", + SerializedName = @"forceUpgrade", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter OverrideSettingForceUpgrade { get => _parametersBody.OverrideSettingForceUpgrade ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.OverrideSettingForceUpgrade = value; } + + /// + /// Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness + /// won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. + /// It must be set for the overrides to take effect. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Until when the overrides are effective. Note that this only matches the start time of an upgrade, and the effectiveness won't change once an upgrade starts even if the `until` expires as upgrade proceeds. This field is not set by default. It must be set for the overrides to take effect.", + SerializedName = @"until", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime OverrideSettingUntil { get => _parametersBody.OverrideSettingUntil ?? default(global::System.DateTime); set => _parametersBody.OverrideSettingUntil = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// Certificate chain object name in Azure Key Vault. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Certificate chain object name in Azure Key Vault.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Certificate chain object name in Azure Key Vault.", + SerializedName = @"certChainObjectName", + PossibleTypes = new [] { typeof(string) })] + public string PluginCertChainObjectName { get => _parametersBody.PluginCertChainObjectName ?? null; set => _parametersBody.PluginCertChainObjectName = value; } + + /// Intermediate certificate object name in Azure Key Vault. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Intermediate certificate object name in Azure Key Vault.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate object name in Azure Key Vault.", + SerializedName = @"certObjectName", + PossibleTypes = new [] { typeof(string) })] + public string PluginCertObjectName { get => _parametersBody.PluginCertObjectName ?? null; set => _parametersBody.PluginCertObjectName = value; } + + /// Intermediate certificate private key object name in Azure Key Vault. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Intermediate certificate private key object name in Azure Key Vault.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Intermediate certificate private key object name in Azure Key Vault.", + SerializedName = @"keyObjectName", + PossibleTypes = new [] { typeof(string) })] + public string PluginKeyObjectName { get => _parametersBody.PluginKeyObjectName ?? null; set => _parametersBody.PluginKeyObjectName = value; } + + /// The resource ID of the Key Vault. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the Key Vault.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the Key Vault.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + public string PluginKeyVaultId { get => _parametersBody.PluginKeyVaultId ?? null; set => _parametersBody.PluginKeyVaultId = value; } + + /// Root certificate object name in Azure Key Vault. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Root certificate object name in Azure Key Vault.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Root certificate object name in Azure Key Vault.", + SerializedName = @"rootCertObjectName", + PossibleTypes = new [] { typeof(string) })] + public string PluginRootCertObjectName { get => _parametersBody.PluginRootCertObjectName ?? null; set => _parametersBody.PluginRootCertObjectName = value; } + + /// + /// Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. + /// See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + /// for more information. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information.", + SerializedName = @"allowNetworkPluginKubenet", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter PodIdentityProfileAllowNetworkPluginKubenet { get => _parametersBody.PodIdentityProfileAllowNetworkPluginKubenet ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.PodIdentityProfileAllowNetworkPluginKubenet = value; } + + /// Whether the pod identity addon is enabled. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether the pod identity addon is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the pod identity addon is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter PodIdentityProfileEnabled { get => _parametersBody.PodIdentityProfileEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.PodIdentityProfileEnabled = value; } + + /// The pod identities to use in the cluster. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The pod identities to use in the cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The pod identities to use in the cluster.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentity[] PodIdentityProfileUserAssignedIdentity { get => _parametersBody.PodIdentityProfileUserAssignedIdentity ?? null /* arrayOf */; set => _parametersBody.PodIdentityProfileUserAssignedIdentity = value; } + + /// The pod identity exceptions to allow. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The pod identity exceptions to allow.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The pod identity exceptions to allow.", + SerializedName = @"userAssignedIdentityExceptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterPodIdentityException[] PodIdentityProfileUserAssignedIdentityException { get => _parametersBody.PodIdentityProfileUserAssignedIdentityException ?? null /* arrayOf */; set => _parametersBody.PodIdentityProfileUserAssignedIdentityException = value; } + + /// Private link resources associated with the cluster. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Private link resources associated with the cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Private link resources associated with the cluster.", + SerializedName = @"privateLinkResources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IPrivateLinkResource[] PrivateLinkResource { get => _parametersBody.PrivateLinkResource ?? null /* arrayOf */; set => _parametersBody.PrivateLinkResource = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Allow or deny public network access for AKS + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or deny public network access for AKS")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or deny public network access for AKS", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.PublicNetworkAccess)""); set => _parametersBody.PublicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// List of namespaces excluded from Safeguards checks + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of namespaces excluded from Safeguards checks")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of namespaces excluded from Safeguards checks", + SerializedName = @"excludedNamespaces", + PossibleTypes = new [] { typeof(string) })] + public string[] SafeguardProfileExcludedNamespace { get => _parametersBody.SafeguardProfileExcludedNamespace ?? null /* arrayOf */; set => _parametersBody.SafeguardProfileExcludedNamespace = value; } + + /// + /// The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via + /// systemExcludedNamespaces + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces", + SerializedName = @"level", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level SafeguardProfileLevel { get => _parametersBody.SafeguardProfileLevel ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.Level)""); set => _parametersBody.SafeguardProfileLevel = value; } + + /// The version of constraints to use + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The version of constraints to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of constraints to use", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + public string SafeguardProfileVersion { get => _parametersBody.SafeguardProfileVersion ?? null; set => _parametersBody.SafeguardProfileVersion = value; } + + /// Whether to enable Defender threat detection + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Defender threat detection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Defender threat detection", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SecurityMonitoringEnabled { get => _parametersBody.SecurityMonitoringEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.SecurityMonitoringEnabled = value; } + + /// + /// A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature + /// enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority) + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. For more information see [Custom CA Trust Certificates](https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority)", + SerializedName = @"customCATrustCertificates", + PossibleTypes = new [] { typeof(byte[]) })] + public byte[][] SecurityProfileCustomCaTrustCertificate { get => _parametersBody.SecurityProfileCustomCaTrustCertificate ?? null /* arrayOf */; set => _parametersBody.SecurityProfileCustomCaTrustCertificate = value; } + + /// Mode of the service mesh. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Mode of the service mesh.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode of the service mesh.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode ServiceMeshProfileMode { get => _parametersBody.ServiceMeshProfileMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ServiceMeshMode)""); set => _parametersBody.ServiceMeshProfileMode = value; } + + /// The ID for the service principal. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID for the service principal.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID for the service principal.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + public string ServicePrincipalProfileClientId { get => _parametersBody.ServicePrincipalProfileClientId ?? null; set => _parametersBody.ServicePrincipalProfileClientId = value; } + + /// The secret password associated with the service principal in plain text. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The secret password associated with the service principal in plain text.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secret password associated with the service principal in plain text.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(string) })] + public string ServicePrincipalProfileSecret { get => _parametersBody.ServicePrincipalProfileSecret ?? null; set => _parametersBody.ServicePrincipalProfileSecret = value; } + + /// The name of a managed cluster SKU. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of a managed cluster SKU.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of a managed cluster SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName SkuName { get => _parametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuName)""); set => _parametersBody.SkuName = value; } + + /// + /// If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) + /// for more details. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"If not specified, the default is 'Free'. See [AKS Pricing Tier](https://learn.microsoft.com/azure/aks/free-standard-pricing-tiers) for more details.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier SkuTier { get => _parametersBody.SkuTier ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.ManagedClusterSkuTier)""); set => _parametersBody.SkuTier = value; } + + /// Whether to enable Snapshot Controller. The default value is true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Snapshot Controller. The default value is true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Snapshot Controller. The default value is true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter SnapshotControllerEnabled { get => _parametersBody.SnapshotControllerEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.SnapshotControllerEnabled = value; } + + /// + /// The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified.", + SerializedName = @"publicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IContainerServiceSshPublicKey[] SshPublicKey { get => _parametersBody.SshPublicKey ?? null /* arrayOf */; set => _parametersBody.SshPublicKey = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'.", + SerializedName = @"supportPlan", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan SupportPlan { get => _parametersBody.SupportPlan ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.KubernetesSupportPlan)""); set => _parametersBody.SupportPlan = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether VPA add-on is enabled and configured to scale AKS-managed add-ons.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether VPA add-on is enabled and configured to scale AKS-managed add-ons.", + SerializedName = @"addonAutoscaling", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling VerticalPodAutoscalerAddonAutoscaling { get => _parametersBody.VerticalPodAutoscalerAddonAutoscaling ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.AddonAutoscaling)""); set => _parametersBody.VerticalPodAutoscalerAddonAutoscaling = value; } + + /// Whether to enable VPA add-on in cluster. Default value is false. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable VPA add-on in cluster. Default value is false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable VPA add-on in cluster. Default value is false.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter VerticalPodAutoscalerEnabled { get => _parametersBody.VerticalPodAutoscalerEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.VerticalPodAutoscalerEnabled = value; } + + /// + /// Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + /// Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource + /// group and all private DNS zones must be in the same resource group. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be in different resource groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group.", + SerializedName = @"dnsZoneResourceIds", + PossibleTypes = new [] { typeof(string) })] + public string[] WebAppRoutingDnsZoneResourceId { get => _parametersBody.WebAppRoutingDnsZoneResourceId ?? null /* arrayOf */; set => _parametersBody.WebAppRoutingDnsZoneResourceId = value; } + + /// Whether to enable Web App Routing. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Web App Routing.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Web App Routing.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter WebAppRoutingEnabled { get => _parametersBody.WebAppRoutingEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.WebAppRoutingEnabled = value; } + + /// + /// Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** + /// 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters + ///
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + /// "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\\W_])

**Disallowed values:** \"abc@123\", \"P@$$w0rd\", \"P@ssw0rd\", \"P@ssword123\", \"Pa$$word\", \"pass@word1\", \"Password!\", \"Password1\", \"Password22\", \"iloveyou!\"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** ""abc@123"", ""P@$$w0rd"", ""P@ssw0rd"", ""P@ssword123"", ""Pa$$word"", ""pass@word1"", ""Password!"", ""Password1"", ""Password22"", ""iloveyou!""", + SerializedName = @"adminPassword", + PossibleTypes = new [] { typeof(string) })] + public string WindowProfileAdminPassword { get => _parametersBody.WindowProfileAdminPassword ?? null; set => _parametersBody.WindowProfileAdminPassword = value; } + + /// + /// Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", + /// "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + /// "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the name of the administrator account.

**Restriction:** Cannot end in \".\"

**Disallowed values:** \"administrator\", \"admin\", \"user\", \"user1\", \"test\", \"user2\", \"test1\", \"user3\", \"admin1\", \"1\", \"123\", \"a\", \"actuser\", \"adm\", \"admin2\", \"aspnet\", \"backup\", \"console\", \"david\", \"guest\", \"john\", \"owner\", \"root\", \"server\", \"sql\", \"support\", \"support_388945a0\", \"sys\", \"test2\", \"test3\", \"user4\", \"user5\".

**Minimum-length:** 1 character

**Max-length:** 20 characters")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the name of the administrator account.

**Restriction:** Cannot end in "".""

**Disallowed values:** ""administrator"", ""admin"", ""user"", ""user1"", ""test"", ""user2"", ""test1"", ""user3"", ""admin1"", ""1"", ""123"", ""a"", ""actuser"", ""adm"", ""admin2"", ""aspnet"", ""backup"", ""console"", ""david"", ""guest"", ""john"", ""owner"", ""root"", ""server"", ""sql"", ""support"", ""support_388945a0"", ""sys"", ""test2"", ""test3"", ""user4"", ""user5"".

**Minimum-length:** 1 character

**Max-length:** 20 characters", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + public string WindowProfileAdminUsername { get => _parametersBody.WindowProfileAdminUsername ?? null; set => _parametersBody.WindowProfileAdminUsername = value; } + + /// + /// For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy).", + SerializedName = @"enableCSIProxy", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter WindowProfileEnableCsiProxy { get => _parametersBody.WindowProfileEnableCsiProxy ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.WindowProfileEnableCsiProxy = value; } + + /// + /// The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) + /// for more details. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details.", + SerializedName = @"licenseType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType WindowProfileLicenseType { get => _parametersBody.WindowProfileLicenseType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.LicenseType)""); set => _parametersBody.WindowProfileLicenseType = value; } + + /// Whether to enable workload identity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable workload identity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable workload identity.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter WorkloadIdentityEnabled { get => _parametersBody.WorkloadIdentityEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.WorkloadIdentityEnabled = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzContainerServiceManagedCluster_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.NewAzContainerServiceManagedCluster_CreateExpanded Clone() + { + var clone = new NewAzContainerServiceManagedCluster_CreateExpanded(); + 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._parametersBody = this._parametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ResourceName = this.ResourceName; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzContainerServiceManagedCluster_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersCreateOrUpdate(SubscriptionId, ResourceGroupName, ResourceName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedCluster + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceSnapshot_CreateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceSnapshot_CreateExpanded.cs new file mode 100644 index 000000000000..7bf837caabda --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceSnapshot_CreateExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Creates or updates a snapshot. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzContainerServiceSnapshot_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Creates or updates a snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class NewAzContainerServiceSnapshot_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A node pool snapshot resource. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.Snapshot(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// This is the ARM ID of the source object to be used to create the target object. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the ARM ID of the source object to be used to create the target object.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the ARM ID of the source object to be used to create the target object.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string CreationDataSourceResourceId { get => _parametersBody.CreationDataSourceResourceId ?? null; set => _parametersBody.CreationDataSourceResourceId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _parametersBody.Location ?? null; set => _parametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// The type of a snapshot. The default is NodePool. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of a snapshot. The default is NodePool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of a snapshot. The default is NodePool.", + SerializedName = @"snapshotType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType))] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType SnapshotType { get => _parametersBody.SnapshotType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support.SnapshotType)""); set => _parametersBody.SnapshotType = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api40.ITrackedResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.ContainerService.Models.Api20240402Preview.ISnapshot + /// 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzContainerServiceSnapshot_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SnapshotsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SnapshotsCreateOrUpdate(SubscriptionId, ResourceGroupName, ResourceName, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ISnapshot + /// 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.ContainerService.Models.Api20240402Preview.ISnapshot + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ISnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceTrustedAccessRoleBinding_CreateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceTrustedAccessRoleBinding_CreateExpanded.cs new file mode 100644 index 000000000000..a91713a64e36 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/NewAzContainerServiceTrustedAccessRoleBinding_CreateExpanded.cs @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Create or update a trusted access role binding + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzContainerServiceTrustedAccessRoleBinding_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Create or update a trusted access role binding")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", ApiVersion = "2024-04-02-preview")] + public partial class NewAzContainerServiceTrustedAccessRoleBinding_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Defines binding between a resource and role + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding _trustedAccessRoleBindingBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TrustedAccessRoleBinding(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of trusted access role binding. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of trusted access role binding.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of trusted access role binding.", + SerializedName = @"trustedAccessRoleBindingName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TrustedAccessRoleBindingName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// + /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'.", + SerializedName = @"roles", + PossibleTypes = new [] { typeof(string) })] + public string[] Role { get => _trustedAccessRoleBindingBody.Role ?? null /* arrayOf */; set => _trustedAccessRoleBindingBody.Role = value; } + + /// The ARM resource ID of source resource that trusted access is configured for. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ARM resource ID of source resource that trusted access is configured for.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ARM resource ID of source resource that trusted access is configured for.", + SerializedName = @"sourceResourceId", + PossibleTypes = new [] { typeof(string) })] + public string SourceResourceId { get => _trustedAccessRoleBindingBody.SourceResourceId ?? null; set => _trustedAccessRoleBindingBody.SourceResourceId = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzContainerServiceTrustedAccessRoleBinding_CreateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.NewAzContainerServiceTrustedAccessRoleBinding_CreateExpanded Clone() + { + var clone = new NewAzContainerServiceTrustedAccessRoleBinding_CreateExpanded(); + 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._trustedAccessRoleBindingBody = this._trustedAccessRoleBindingBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ResourceName = this.ResourceName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzContainerServiceTrustedAccessRoleBinding_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TrustedAccessRoleBindingsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrustedAccessRoleBindingsCreateOrUpdate(SubscriptionId, ResourceGroupName, ResourceName, Name, _trustedAccessRoleBindingBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name,body=_trustedAccessRoleBindingBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.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, ResourceName=ResourceName, Name=Name, body=_trustedAccessRoleBindingBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, Name=Name, body=_trustedAccessRoleBindingBody }) + { + 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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ITrustedAccessRoleBinding + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_Delete.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_Delete.cs new file mode 100644 index 000000000000..4b576685f9ea --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_Delete.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes specific machines in an agent pool. + /// + /// [OpenAPI] DeleteMachines=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceAgentPoolMachine_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes specific machines in an agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceAgentPoolMachine_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _agentPoolName; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string AgentPoolName { get => this._agentPoolName; set => this._agentPoolName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter _machine; + + /// Specifies a list of machine names from the agent pool to be deleted. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Specifies a list of machine names from the agent pool to be deleted.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies a list of machine names from the agent pool to be deleted.", + SerializedName = @"machines", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter Machine { get => this._machine; set => this._machine = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzContainerServiceAgentPoolMachine_Delete + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceAgentPoolMachine_Delete Clone() + { + var clone = new RemoveAzContainerServiceAgentPoolMachine_Delete(); + 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.ResourceName = this.ResourceName; + clone.AgentPoolName = this.AgentPoolName; + clone.Machine = this.Machine; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsDeleteMachines' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsDeleteMachines(SubscriptionId, ResourceGroupName, ResourceName, AgentPoolName, Machine, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,AgentPoolName=AgentPoolName,body=Machine}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceAgentPoolMachine_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName, body=Machine }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName, body=Machine }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_DeleteExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_DeleteExpanded.cs new file mode 100644 index 000000000000..30a3a0cc26d6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_DeleteExpanded.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes specific machines in an agent pool. + /// + /// [OpenAPI] DeleteMachines=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceAgentPoolMachine_DeleteExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes specific machines in an agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceAgentPoolMachine_DeleteExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Specifies a list of machine names from the agent pool to be deleted. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter _machinesBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolDeleteMachinesParameter(); + + /// Backing field for property. + private string _agentPoolName; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string AgentPoolName { get => this._agentPoolName; set => this._agentPoolName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The agent pool machine names. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The agent pool machine names.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The agent pool machine names.", + SerializedName = @"machineNames", + PossibleTypes = new [] { typeof(string) })] + public string[] MachineName { get => _machinesBody.MachineName ?? null /* arrayOf */; set => _machinesBody.MachineName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzContainerServiceAgentPoolMachine_DeleteExpanded + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceAgentPoolMachine_DeleteExpanded Clone() + { + var clone = new RemoveAzContainerServiceAgentPoolMachine_DeleteExpanded(); + 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._machinesBody = this._machinesBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ResourceName = this.ResourceName; + clone.AgentPoolName = this.AgentPoolName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsDeleteMachines' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsDeleteMachines(SubscriptionId, ResourceGroupName, ResourceName, AgentPoolName, _machinesBody, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,AgentPoolName=AgentPoolName,body=_machinesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceAgentPoolMachine_DeleteExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName, body=_machinesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName, body=_machinesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentity.cs new file mode 100644 index 000000000000..ed7b6ad6fb04 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentity.cs @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes specific machines in an agent pool. + /// + /// [OpenAPI] DeleteMachines=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceAgentPoolMachine_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes specific machines in an agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter _machine; + + /// Specifies a list of machine names from the agent pool to be deleted. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Specifies a list of machine names from the agent pool to be deleted.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies a list of machine names from the agent pool to be deleted.", + SerializedName = @"machines", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter Machine { get => this._machine; set => this._machine = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentity Clone() + { + var clone = new RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentity(); + 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.Machine = this.Machine; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsDeleteMachines' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AgentPoolsDeleteMachinesViaIdentity(InputObject.Id, Machine, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AgentPoolName) + { + 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.AgentPoolsDeleteMachines(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.AgentPoolName ?? null, Machine, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Machine}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Machine }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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=Machine }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded.cs new file mode 100644 index 000000000000..08c35a9b1a1f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes specific machines in an agent pool. + /// + /// [OpenAPI] DeleteMachines=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes specific machines in an agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Specifies a list of machine names from the agent pool to be deleted. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IAgentPoolDeleteMachinesParameter _machinesBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.AgentPoolDeleteMachinesParameter(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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 agent pool machine names. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The agent pool machine names.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The agent pool machine names.", + SerializedName = @"machineNames", + PossibleTypes = new [] { typeof(string) })] + public string[] MachineName { get => _machinesBody.MachineName ?? null /* arrayOf */; set => _machinesBody.MachineName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded Clone() + { + var clone = new RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded(); + 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._machinesBody = this._machinesBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsDeleteMachines' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AgentPoolsDeleteMachinesViaIdentity(InputObject.Id, _machinesBody, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AgentPoolName) + { + 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.AgentPoolsDeleteMachines(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.AgentPoolName ?? null, _machinesBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_machinesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzContainerServiceAgentPoolMachine_DeleteViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_machinesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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=_machinesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPool_Delete.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPool_Delete.cs new file mode 100644 index 000000000000..cd85a4fa0f31 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPool_Delete.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes an agent pool in the specified managed cluster. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceAgentPool_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes an agent pool in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceAgentPool_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// The request should only proceed if an entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if an entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if an entity matches this string.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _ignorePodDisruptionBudget; + + /// + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget", + SerializedName = @"ignore-pod-disruption-budget", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter IgnorePodDisruptionBudget { get => this._ignorePodDisruptionBudget; set => this._ignorePodDisruptionBudget = 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzContainerServiceAgentPool_Delete + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceAgentPool_Delete Clone() + { + var clone = new RemoveAzContainerServiceAgentPool_Delete(); + 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.ResourceName = this.ResourceName; + clone.Name = this.Name; + clone.IgnorePodDisruptionBudget = this.IgnorePodDisruptionBudget; + clone.IfMatch = this.IfMatch; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsDelete(SubscriptionId, ResourceGroupName, ResourceName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name,IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?),IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceAgentPool_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, Name=Name, IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, Name=Name, IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPool_DeleteViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPool_DeleteViaIdentity.cs new file mode 100644 index 000000000000..2d330b7605b6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceAgentPool_DeleteViaIdentity.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes an agent pool in the specified managed cluster. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceAgentPool_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes an agent pool in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceAgentPool_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// The request should only proceed if an entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if an entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if an entity matches this string.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _ignorePodDisruptionBudget; + + /// + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget", + SerializedName = @"ignore-pod-disruption-budget", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter IgnorePodDisruptionBudget { get => this._ignorePodDisruptionBudget; set => this._ignorePodDisruptionBudget = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzContainerServiceAgentPool_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceAgentPool_DeleteViaIdentity Clone() + { + var clone = new RemoveAzContainerServiceAgentPool_DeleteViaIdentity(); + 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.IgnorePodDisruptionBudget = this.IgnorePodDisruptionBudget; + clone.IfMatch = this.IfMatch; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AgentPoolsDeleteViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AgentPoolName) + { + 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.AgentPoolsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.AgentPoolName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?),IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceAgentPool_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceLoadBalancer_Delete.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceLoadBalancer_Delete.cs new file mode 100644 index 000000000000..8bfefd351ee0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceLoadBalancer_Delete.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a load balancer in the specified managed cluster. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceLoadBalancer_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a load balancer in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceLoadBalancer_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the load balancer. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the load balancer.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the load balancer.", + SerializedName = @"loadBalancerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("LoadBalancerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzContainerServiceLoadBalancer_Delete + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceLoadBalancer_Delete Clone() + { + var clone = new RemoveAzContainerServiceLoadBalancer_Delete(); + 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.ResourceName = this.ResourceName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LoadBalancersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LoadBalancersDelete(SubscriptionId, ResourceGroupName, ResourceName, Name, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceLoadBalancer_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.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, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceLoadBalancer_DeleteViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceLoadBalancer_DeleteViaIdentity.cs new file mode 100644 index 000000000000..e68328eb2666 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceLoadBalancer_DeleteViaIdentity.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a load balancer in the specified managed cluster. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceLoadBalancer_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a load balancer in the specified managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceLoadBalancer_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzContainerServiceLoadBalancer_DeleteViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceLoadBalancer_DeleteViaIdentity Clone() + { + var clone = new RemoveAzContainerServiceLoadBalancer_DeleteViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LoadBalancersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.LoadBalancersDeleteViaIdentity(InputObject.Id, onNoContent, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.LoadBalancerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.LoadBalancerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.LoadBalancersDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.LoadBalancerName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceLoadBalancer_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceMaintenanceConfiguration_Delete.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceMaintenanceConfiguration_Delete.cs new file mode 100644 index 000000000000..eb613e3a5c45 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceMaintenanceConfiguration_Delete.cs @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a maintenance configuration. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceMaintenanceConfiguration_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a maintenance configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceMaintenanceConfiguration_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _configName; + + /// The name of the maintenance configuration. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the maintenance configuration.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the maintenance configuration.", + SerializedName = @"configName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ConfigName { get => this._configName; set => this._configName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MaintenanceConfigurationsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MaintenanceConfigurationsDelete(SubscriptionId, ResourceGroupName, ResourceName, ConfigName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,ConfigName=ConfigName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceMaintenanceConfiguration_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, ConfigName=ConfigName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, ConfigName=ConfigName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceMaintenanceConfiguration_DeleteViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceMaintenanceConfiguration_DeleteViaIdentity.cs new file mode 100644 index 000000000000..3dc4f1727779 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceMaintenanceConfiguration_DeleteViaIdentity.cs @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a maintenance configuration. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceMaintenanceConfiguration_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a maintenance configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceMaintenanceConfiguration_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MaintenanceConfigurationsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.MaintenanceConfigurationsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ConfigName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ConfigName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.MaintenanceConfigurationsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.ConfigName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzContainerServiceMaintenanceConfiguration_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedClusterSnapshot_Delete.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedClusterSnapshot_Delete.cs new file mode 100644 index 000000000000..a78c880c7fae --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedClusterSnapshot_Delete.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a managed cluster snapshot. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceManagedClusterSnapshot_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a managed cluster snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceManagedClusterSnapshot_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClusterSnapshotsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClusterSnapshotsDelete(SubscriptionId, ResourceGroupName, ResourceName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceManagedClusterSnapshot_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedClusterSnapshot_DeleteViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedClusterSnapshot_DeleteViaIdentity.cs new file mode 100644 index 000000000000..e5731b85fc7a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedClusterSnapshot_DeleteViaIdentity.cs @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a managed cluster snapshot. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceManagedClusterSnapshot_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a managed cluster snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceManagedClusterSnapshot_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClusterSnapshotsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClusterSnapshotsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, 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.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.ManagedClusterSnapshotsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzContainerServiceManagedClusterSnapshot_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedCluster_Delete.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedCluster_Delete.cs new file mode 100644 index 000000000000..71d73f26d29e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedCluster_Delete.cs @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a managed cluster. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceManagedCluster_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceManagedCluster_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// The request should only proceed if an entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if an entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if an entity matches this string.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _ignorePodDisruptionBudget; + + /// + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget", + SerializedName = @"ignore-pod-disruption-budget", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter IgnorePodDisruptionBudget { get => this._ignorePodDisruptionBudget; set => this._ignorePodDisruptionBudget = 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzContainerServiceManagedCluster_Delete + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceManagedCluster_Delete Clone() + { + var clone = new RemoveAzContainerServiceManagedCluster_Delete(); + 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.ResourceName = this.ResourceName; + clone.IgnorePodDisruptionBudget = this.IgnorePodDisruptionBudget; + clone.IfMatch = this.IfMatch; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersDelete(SubscriptionId, ResourceGroupName, ResourceName, this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?),IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceManagedCluster_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedCluster_DeleteViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedCluster_DeleteViaIdentity.cs new file mode 100644 index 000000000000..088f101f512d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceManagedCluster_DeleteViaIdentity.cs @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a managed cluster. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceManagedCluster_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceManagedCluster_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// The request should only proceed if an entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if an entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if an entity matches this string.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private global::System.Management.Automation.SwitchParameter _ignorePodDisruptionBudget; + + /// + /// ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget", + SerializedName = @"ignore-pod-disruption-budget", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Query)] + public global::System.Management.Automation.SwitchParameter IgnorePodDisruptionBudget { get => this._ignorePodDisruptionBudget; set => this._ignorePodDisruptionBudget = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzContainerServiceManagedCluster_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceManagedCluster_DeleteViaIdentity Clone() + { + var clone = new RemoveAzContainerServiceManagedCluster_DeleteViaIdentity(); + 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.IgnorePodDisruptionBudget = this.IgnorePodDisruptionBudget; + clone.IfMatch = this.IfMatch; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersDeleteViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, 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.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.ManagedClustersDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?),IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceManagedCluster_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IgnorePodDisruptionBudget=this.InvocationInformation.BoundParameters.ContainsKey("IgnorePodDisruptionBudget") ? IgnorePodDisruptionBudget : default(global::System.Management.Automation.SwitchParameter?), IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServicePrivateEndpointConnection_Delete.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServicePrivateEndpointConnection_Delete.cs new file mode 100644 index 000000000000..980d4e393a39 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServicePrivateEndpointConnection_Delete.cs @@ -0,0 +1,560 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a private endpoint connection. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServicePrivateEndpointConnection_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a private endpoint connection.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServicePrivateEndpointConnection_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the private endpoint connection. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection.", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzContainerServicePrivateEndpointConnection_Delete + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServicePrivateEndpointConnection_Delete Clone() + { + var clone = new RemoveAzContainerServicePrivateEndpointConnection_Delete(); + 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.ResourceName = this.ResourceName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsDelete(SubscriptionId, ResourceGroupName, ResourceName, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServicePrivateEndpointConnection_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServicePrivateEndpointConnection_DeleteViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServicePrivateEndpointConnection_DeleteViaIdentity.cs new file mode 100644 index 000000000000..5ce26bf6b07f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServicePrivateEndpointConnection_DeleteViaIdentity.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a private endpoint connection. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServicePrivateEndpointConnection_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a private endpoint connection.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServicePrivateEndpointConnection_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzContainerServicePrivateEndpointConnection_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServicePrivateEndpointConnection_DeleteViaIdentity Clone() + { + var clone = new RemoveAzContainerServicePrivateEndpointConnection_DeleteViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PrivateEndpointConnectionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PrivateEndpointConnectionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PrivateEndpointConnectionsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.PrivateEndpointConnectionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzContainerServicePrivateEndpointConnection_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceSnapshot_Delete.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceSnapshot_Delete.cs new file mode 100644 index 000000000000..24002da202ed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceSnapshot_Delete.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a snapshot. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceSnapshot_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceSnapshot_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SnapshotsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SnapshotsDelete(SubscriptionId, ResourceGroupName, ResourceName, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceSnapshot_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceSnapshot_DeleteViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceSnapshot_DeleteViaIdentity.cs new file mode 100644 index 000000000000..3c225011736b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceSnapshot_DeleteViaIdentity.cs @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Deletes a snapshot. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceSnapshot_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Deletes a snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceSnapshot_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SnapshotsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SnapshotsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, 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.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.SnapshotsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceSnapshot_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceTrustedAccessRoleBinding_Delete.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceTrustedAccessRoleBinding_Delete.cs new file mode 100644 index 000000000000..6b7766fab65a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceTrustedAccessRoleBinding_Delete.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Delete a trusted access role binding. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceTrustedAccessRoleBinding_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Delete a trusted access role binding.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceTrustedAccessRoleBinding_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of trusted access role binding. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of trusted access role binding.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of trusted access role binding.", + SerializedName = @"trustedAccessRoleBindingName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TrustedAccessRoleBindingName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzContainerServiceTrustedAccessRoleBinding_Delete + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceTrustedAccessRoleBinding_Delete Clone() + { + var clone = new RemoveAzContainerServiceTrustedAccessRoleBinding_Delete(); + 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.ResourceName = this.ResourceName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TrustedAccessRoleBindingsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrustedAccessRoleBindingsDelete(SubscriptionId, ResourceGroupName, ResourceName, Name, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzContainerServiceTrustedAccessRoleBinding_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.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, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, ResourceName=ResourceName, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity.cs new file mode 100644 index 000000000000..5faf74cacac8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/RemoveAzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Delete a trusted access role binding. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Delete a trusted access role binding.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", ApiVersion = "2024-04-02-preview")] + public partial class RemoveAzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.RemoveAzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity Clone() + { + var clone = new RemoveAzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TrustedAccessRoleBindingsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TrustedAccessRoleBindingsDeleteViaIdentity(InputObject.Id, onNoContent, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TrustedAccessRoleBindingName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TrustedAccessRoleBindingName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TrustedAccessRoleBindingsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.TrustedAccessRoleBindingName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzContainerServiceTrustedAccessRoleBinding_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api40.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_Reset.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_Reset.cs new file mode 100644 index 000000000000..c5a3dc3373c3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_Reset.cs @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) + /// to update your cluster with AKS-managed Azure AD. + /// + /// + /// [OpenAPI] ResetAADProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Reset, @"AzContainerServiceManagedClusterAadProfile_Reset", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"**WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", ApiVersion = "2024-04-02-preview")] + public partial class ResetAzContainerServiceManagedClusterAadProfile_Reset : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile _parameter; + + /// + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad).", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad).", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of ResetAzContainerServiceManagedClusterAadProfile_Reset + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ResetAzContainerServiceManagedClusterAadProfile_Reset Clone() + { + var clone = new ResetAzContainerServiceManagedClusterAadProfile_Reset(); + 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.ResourceName = this.ResourceName; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersResetAadProfile' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersResetAadProfile(SubscriptionId, ResourceGroupName, ResourceName, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ResetAzContainerServiceManagedClusterAadProfile_Reset() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=Parameter }) + { + 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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_ResetExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_ResetExpanded.cs new file mode 100644 index 000000000000..058e39708de6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_ResetExpanded.cs @@ -0,0 +1,605 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) + /// to update your cluster with AKS-managed Azure AD. + /// + /// + /// [OpenAPI] ResetAADProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Reset, @"AzContainerServiceManagedClusterAadProfile_ResetExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"**WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", ApiVersion = "2024-04-02-preview")] + public partial class ResetAzContainerServiceManagedClusterAadProfile_ResetExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfile(); + + /// The list of AAD group object IDs that will have admin role of the cluster. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of AAD group object IDs that will have admin role of the cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of AAD group object IDs that will have admin role of the cluster.", + SerializedName = @"adminGroupObjectIDs", + PossibleTypes = new [] { typeof(string) })] + public string[] AdminGroupObjectID { get => _parametersBody.AdminGroupObjectID ?? null /* arrayOf */; set => _parametersBody.AdminGroupObjectID = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"clientAppID", + PossibleTypes = new [] { typeof(string) })] + public string ClientAppId { get => _parametersBody.ClientAppId ?? null; set => _parametersBody.ClientAppId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Whether to enable Azure RBAC for Kubernetes authorization. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Azure RBAC for Kubernetes authorization.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure RBAC for Kubernetes authorization.", + SerializedName = @"enableAzureRBAC", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableAzureRbac { get => _parametersBody.EnableAzureRbac ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableAzureRbac = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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; } } + + /// Whether to enable managed AAD. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable managed AAD.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable managed AAD.", + SerializedName = @"managed", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter Managed { get => _parametersBody.Managed ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.Managed = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppID", + PossibleTypes = new [] { typeof(string) })] + public string ServerAppId { get => _parametersBody.ServerAppId ?? null; set => _parametersBody.ServerAppId = value; } + + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppSecret", + PossibleTypes = new [] { typeof(string) })] + public string ServerAppSecret { get => _parametersBody.ServerAppSecret ?? null; set => _parametersBody.ServerAppSecret = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription.", + SerializedName = @"tenantID", + PossibleTypes = new [] { typeof(string) })] + public string TenantId { get => _parametersBody.TenantId ?? null; set => _parametersBody.TenantId = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of ResetAzContainerServiceManagedClusterAadProfile_ResetExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ResetAzContainerServiceManagedClusterAadProfile_ResetExpanded Clone() + { + var clone = new ResetAzContainerServiceManagedClusterAadProfile_ResetExpanded(); + 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._parametersBody = this._parametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ResourceName = this.ResourceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersResetAadProfile' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersResetAadProfile(SubscriptionId, ResourceGroupName, ResourceName, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ResetAzContainerServiceManagedClusterAadProfile_ResetExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=_parametersBody }) + { + 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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentity.cs new file mode 100644 index 000000000000..bc2317035cc9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentity.cs @@ -0,0 +1,509 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) + /// to update your cluster with AKS-managed Azure AD. + /// + /// + /// [OpenAPI] ResetAADProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Reset, @"AzContainerServiceManagedClusterAadProfile_ResetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"**WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", ApiVersion = "2024-04-02-preview")] + public partial class ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile _parameter; + + /// + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad).", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad).", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentity Clone() + { + var clone = new ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentity(); + 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.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersResetAadProfile' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersResetAadProfileViaIdentity(InputObject.Id, Parameter, 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.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.ManagedClustersResetAadProfile(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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=Parameter }) + { + 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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded.cs new file mode 100644 index 000000000000..4ff488f33a6a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// **WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) + /// to update your cluster with AKS-managed Azure AD. + /// + /// + /// [OpenAPI] ResetAADProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Reset, @"AzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"**WARNING**: This API will be deprecated. Please see [AKS-managed Azure Active Directory integration](https://aka.ms/aks-managed-aad) to update your cluster with AKS-managed Azure AD.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", ApiVersion = "2024-04-02-preview")] + public partial class ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterAadProfile _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterAadProfile(); + + /// The list of AAD group object IDs that will have admin role of the cluster. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of AAD group object IDs that will have admin role of the cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of AAD group object IDs that will have admin role of the cluster.", + SerializedName = @"adminGroupObjectIDs", + PossibleTypes = new [] { typeof(string) })] + public string[] AdminGroupObjectID { get => _parametersBody.AdminGroupObjectID ?? null /* arrayOf */; set => _parametersBody.AdminGroupObjectID = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// + /// (DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The client AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"clientAppID", + PossibleTypes = new [] { typeof(string) })] + public string ClientAppId { get => _parametersBody.ClientAppId ?? null; set => _parametersBody.ClientAppId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Whether to enable Azure RBAC for Kubernetes authorization. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable Azure RBAC for Kubernetes authorization.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable Azure RBAC for Kubernetes authorization.", + SerializedName = @"enableAzureRBAC", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableAzureRbac { get => _parametersBody.EnableAzureRbac ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableAzureRbac = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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; } } + + /// Whether to enable managed AAD. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether to enable managed AAD.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether to enable managed AAD.", + SerializedName = @"managed", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter Managed { get => _parametersBody.Managed ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.Managed = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// (DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application ID. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppID", + PossibleTypes = new [] { typeof(string) })] + public string ServerAppId { get => _parametersBody.ServerAppId ?? null; set => _parametersBody.ServerAppId = value; } + + /// + /// (DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "(DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"(DEPRECATED) The server AAD application secret. Learn more at https://aka.ms/aks/aad-legacy.", + SerializedName = @"serverAppSecret", + PossibleTypes = new [] { typeof(string) })] + public string ServerAppSecret { get => _parametersBody.ServerAppSecret ?? null; set => _parametersBody.ServerAppSecret = value; } + + /// + /// The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription.", + SerializedName = @"tenantID", + PossibleTypes = new [] { typeof(string) })] + public string TenantId { get => _parametersBody.TenantId ?? null; set => _parametersBody.TenantId = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded Clone() + { + var clone = new ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded(); + 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._parametersBody = this._parametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersResetAadProfile' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersResetAadProfileViaIdentity(InputObject.Id, _parametersBody, 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.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.ManagedClustersResetAadProfile(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ResetAzContainerServiceManagedClusterAadProfile_ResetViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + 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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_Reset.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_Reset.cs new file mode 100644 index 000000000000..0f9900238829 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_Reset.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// This action cannot be performed on a cluster that is not using a service principal + /// + /// + /// [OpenAPI] ResetServicePrincipalProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Reset, @"AzContainerServiceManagedClusterServicePrincipalProfile_Reset", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"This action cannot be performed on a cluster that is not using a service principal")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", ApiVersion = "2024-04-02-preview")] + public partial class ResetAzContainerServiceManagedClusterServicePrincipalProfile_Reset : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile _parameter; + + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Information about a service principal identity for the cluster to use for manipulating Azure APIs.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Information about a service principal identity for the cluster to use for manipulating Azure APIs.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of ResetAzContainerServiceManagedClusterServicePrincipalProfile_Reset + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ResetAzContainerServiceManagedClusterServicePrincipalProfile_Reset Clone() + { + var clone = new ResetAzContainerServiceManagedClusterServicePrincipalProfile_Reset(); + 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.ResourceName = this.ResourceName; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersResetServicePrincipalProfile' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersResetServicePrincipalProfile(SubscriptionId, ResourceGroupName, ResourceName, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public ResetAzContainerServiceManagedClusterServicePrincipalProfile_Reset() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=Parameter }) + { + 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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded.cs new file mode 100644 index 000000000000..640a7d64292f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded.cs @@ -0,0 +1,541 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// This action cannot be performed on a cluster that is not using a service principal + /// + /// + /// [OpenAPI] ResetServicePrincipalProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Reset, @"AzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"This action cannot be performed on a cluster that is not using a service principal")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", ApiVersion = "2024-04-02-preview")] + public partial class ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfile(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// The ID for the service principal. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID for the service principal.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID for the service principal.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + public string ClientId { get => _parametersBody.ClientId ?? null; set => _parametersBody.ClientId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// The secret password associated with the service principal in plain text. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The secret password associated with the service principal in plain text.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secret password associated with the service principal in plain text.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(string) })] + public string Secret { get => _parametersBody.Secret ?? null; set => _parametersBody.Secret = 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded Clone() + { + var clone = new ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded(); + 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._parametersBody = this._parametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ResourceName = this.ResourceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersResetServicePrincipalProfile' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersResetServicePrincipalProfile(SubscriptionId, ResourceGroupName, ResourceName, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=_parametersBody }) + { + 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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity.cs new file mode 100644 index 000000000000..2bfb82e7abed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// This action cannot be performed on a cluster that is not using a service principal + /// + /// + /// [OpenAPI] ResetServicePrincipalProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Reset, @"AzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"This action cannot be performed on a cluster that is not using a service principal")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", ApiVersion = "2024-04-02-preview")] + public partial class ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile _parameter; + + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Information about a service principal identity for the cluster to use for manipulating Azure APIs.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Information about a service principal identity for the cluster to use for manipulating Azure APIs.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity Clone() + { + var clone = new ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity(); + 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.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersResetServicePrincipalProfile' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersResetServicePrincipalProfileViaIdentity(InputObject.Id, Parameter, 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.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.ManagedClustersResetServicePrincipalProfile(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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=Parameter }) + { + 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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded.cs new file mode 100644 index 000000000000..859787b71532 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded.cs @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// This action cannot be performed on a cluster that is not using a service principal + /// + /// + /// [OpenAPI] ResetServicePrincipalProfile=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Reset, @"AzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"This action cannot be performed on a cluster that is not using a service principal")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", ApiVersion = "2024-04-02-preview")] + public partial class ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// Information about a service principal identity for the cluster to use for manipulating Azure APIs. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterServicePrincipalProfile _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ManagedClusterServicePrincipalProfile(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// The ID for the service principal. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID for the service principal.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID for the service principal.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + public string ClientId { get => _parametersBody.ClientId ?? null; set => _parametersBody.ClientId = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The secret password associated with the service principal in plain text. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The secret password associated with the service principal in plain text.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The secret password associated with the service principal in plain text.", + SerializedName = @"secret", + PossibleTypes = new [] { typeof(string) })] + public string Secret { get => _parametersBody.Secret ?? null; set => _parametersBody.Secret = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded Clone() + { + var clone = new ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded(); + 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._parametersBody = this._parametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersResetServicePrincipalProfile' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersResetServicePrincipalProfileViaIdentity(InputObject.Id, _parametersBody, 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.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.ManagedClustersResetServicePrincipalProfile(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ResetAzContainerServiceManagedClusterServicePrincipalProfile_ResetViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + 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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_Run.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_Run.cs new file mode 100644 index 000000000000..dcd8bedf018a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_Run.cs @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS + /// Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + /// + /// + /// [OpenAPI] RunCommand=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzContainerServiceManagedClusterCommand_Run", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand", ApiVersion = "2024-04-02-preview")] + public partial class StartAzContainerServiceManagedClusterCommand_Run : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest _requestPayload; + + /// A run command request + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A run command request", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A run command request", + SerializedName = @"requestPayload", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest RequestPayload { get => this._requestPayload; set => this._requestPayload = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StartAzContainerServiceManagedClusterCommand_Run + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.StartAzContainerServiceManagedClusterCommand_Run Clone() + { + var clone = new StartAzContainerServiceManagedClusterCommand_Run(); + 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.ResourceName = this.ResourceName; + clone.RequestPayload = this.RequestPayload; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRunCommand' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersRunCommand(SubscriptionId, ResourceGroupName, ResourceName, RequestPayload, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=RequestPayload}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzContainerServiceManagedClusterCommand_Run() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=RequestPayload }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=RequestPayload }) + { + 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_RunExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_RunExpanded.cs new file mode 100644 index 000000000000..9712ea6f7e68 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_RunExpanded.cs @@ -0,0 +1,545 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS + /// Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + /// + /// + /// [OpenAPI] RunCommand=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzContainerServiceManagedClusterCommand_RunExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand", ApiVersion = "2024-04-02-preview")] + public partial class StartAzContainerServiceManagedClusterCommand_RunExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A run command request + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest _requestPayloadBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RunCommandRequest(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// AuthToken issued for AKS AAD Server App. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "AuthToken issued for AKS AAD Server App.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"AuthToken issued for AKS AAD Server App.", + SerializedName = @"clusterToken", + PossibleTypes = new [] { typeof(string) })] + public string ClusterToken { get => _requestPayloadBody.ClusterToken ?? null; set => _requestPayloadBody.ClusterToken = value; } + + /// The command to run. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The command to run.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The command to run.", + SerializedName = @"command", + PossibleTypes = new [] { typeof(string) })] + public string Command { get => _requestPayloadBody.Command ?? null; set => _requestPayloadBody.Command = value; } + + /// A base64 encoded zip file containing the files required by the command. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A base64 encoded zip file containing the files required by the command.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64 encoded zip file containing the files required by the command.", + SerializedName = @"context", + PossibleTypes = new [] { typeof(string) })] + public string Context { get => _requestPayloadBody.Context ?? null; set => _requestPayloadBody.Context = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StartAzContainerServiceManagedClusterCommand_RunExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.StartAzContainerServiceManagedClusterCommand_RunExpanded Clone() + { + var clone = new StartAzContainerServiceManagedClusterCommand_RunExpanded(); + 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._requestPayloadBody = this._requestPayloadBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ResourceName = this.ResourceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRunCommand' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersRunCommand(SubscriptionId, ResourceGroupName, ResourceName, _requestPayloadBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=_requestPayloadBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzContainerServiceManagedClusterCommand_RunExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=_requestPayloadBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=_requestPayloadBody }) + { + 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_RunViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_RunViaIdentity.cs new file mode 100644 index 000000000000..0c112ad179d8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_RunViaIdentity.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS + /// Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + /// + /// + /// [OpenAPI] RunCommand=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzContainerServiceManagedClusterCommand_RunViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand", ApiVersion = "2024-04-02-preview")] + public partial class StartAzContainerServiceManagedClusterCommand_RunViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest _requestPayload; + + /// A run command request + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A run command request", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A run command request", + SerializedName = @"requestPayload", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest RequestPayload { get => this._requestPayload; set => this._requestPayload = 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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StartAzContainerServiceManagedClusterCommand_RunViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.StartAzContainerServiceManagedClusterCommand_RunViaIdentity Clone() + { + var clone = new StartAzContainerServiceManagedClusterCommand_RunViaIdentity(); + 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.RequestPayload = this.RequestPayload; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRunCommand' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersRunCommandViaIdentity(InputObject.Id, RequestPayload, 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.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.ManagedClustersRunCommand(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, RequestPayload, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RequestPayload}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzContainerServiceManagedClusterCommand_RunViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RequestPayload }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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=RequestPayload }) + { + 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_RunViaIdentityExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_RunViaIdentityExpanded.cs new file mode 100644 index 000000000000..43cce381b409 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedClusterCommand_RunViaIdentityExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS + /// Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + /// + /// + /// [OpenAPI] RunCommand=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzContainerServiceManagedClusterCommand_RunViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand", ApiVersion = "2024-04-02-preview")] + public partial class StartAzContainerServiceManagedClusterCommand_RunViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A run command request + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandRequest _requestPayloadBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.RunCommandRequest(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.ClientAPI; + + /// AuthToken issued for AKS AAD Server App. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "AuthToken issued for AKS AAD Server App.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"AuthToken issued for AKS AAD Server App.", + SerializedName = @"clusterToken", + PossibleTypes = new [] { typeof(string) })] + public string ClusterToken { get => _requestPayloadBody.ClusterToken ?? null; set => _requestPayloadBody.ClusterToken = value; } + + /// The command to run. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The command to run.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The command to run.", + SerializedName = @"command", + PossibleTypes = new [] { typeof(string) })] + public string Command { get => _requestPayloadBody.Command ?? null; set => _requestPayloadBody.Command = value; } + + /// A base64 encoded zip file containing the files required by the command. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A base64 encoded zip file containing the files required by the command.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A base64 encoded zip file containing the files required by the command.", + SerializedName = @"context", + PossibleTypes = new [] { typeof(string) })] + public string Context { get => _requestPayloadBody.Context ?? null; set => _requestPayloadBody.Context = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StartAzContainerServiceManagedClusterCommand_RunViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.StartAzContainerServiceManagedClusterCommand_RunViaIdentityExpanded Clone() + { + var clone = new StartAzContainerServiceManagedClusterCommand_RunViaIdentityExpanded(); + 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._requestPayloadBody = this._requestPayloadBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersRunCommand' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersRunCommandViaIdentity(InputObject.Id, _requestPayloadBody, 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.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.ManagedClustersRunCommand(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _requestPayloadBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_requestPayloadBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public StartAzContainerServiceManagedClusterCommand_RunViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_requestPayloadBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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=_requestPayloadBody }) + { + 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IRunCommandResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedCluster_Start.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedCluster_Start.cs new file mode 100644 index 000000000000..de3b22394781 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedCluster_Start.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + /// + /// + /// [OpenAPI] Start=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzContainerServiceManagedCluster_Start", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start", ApiVersion = "2024-04-02-preview")] + public partial class StartAzContainerServiceManagedCluster_Start : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StartAzContainerServiceManagedCluster_Start + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.StartAzContainerServiceManagedCluster_Start Clone() + { + var clone = new StartAzContainerServiceManagedCluster_Start(); + 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.ResourceName = this.ResourceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersStart' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersStart(SubscriptionId, ResourceGroupName, ResourceName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzContainerServiceManagedCluster_Start() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedCluster_StartViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedCluster_StartViaIdentity.cs new file mode 100644 index 000000000000..7b9c24d28942 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StartAzContainerServiceManagedCluster_StartViaIdentity.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + /// + /// + /// [OpenAPI] Start=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Start, @"AzContainerServiceManagedCluster_StartViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start", ApiVersion = "2024-04-02-preview")] + public partial class StartAzContainerServiceManagedCluster_StartViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StartAzContainerServiceManagedCluster_StartViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.StartAzContainerServiceManagedCluster_StartViaIdentity Clone() + { + var clone = new StartAzContainerServiceManagedCluster_StartViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersStart' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersStartViaIdentity(InputObject.Id, onNoContent, 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.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.ManagedClustersStart(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StartAzContainerServiceManagedCluster_StartViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/StopAzContainerServiceManagedCluster_Stop.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StopAzContainerServiceManagedCluster_Stop.cs new file mode 100644 index 000000000000..eb80e044447f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StopAzContainerServiceManagedCluster_Stop.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane + /// and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is + /// stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping + /// a cluster. + /// + /// + /// [OpenAPI] Stop=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzContainerServiceManagedCluster_Stop", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop", ApiVersion = "2024-04-02-preview")] + public partial class StopAzContainerServiceManagedCluster_Stop : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StopAzContainerServiceManagedCluster_Stop + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.StopAzContainerServiceManagedCluster_Stop Clone() + { + var clone = new StopAzContainerServiceManagedCluster_Stop(); + 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.ResourceName = this.ResourceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersStop' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersStop(SubscriptionId, ResourceGroupName, ResourceName, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzContainerServiceManagedCluster_Stop() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/StopAzContainerServiceManagedCluster_StopViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StopAzContainerServiceManagedCluster_StopViaIdentity.cs new file mode 100644 index 000000000000..b5fff68be952 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/StopAzContainerServiceManagedCluster_StopViaIdentity.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane + /// and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is + /// stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping + /// a cluster. + /// + /// + /// [OpenAPI] Stop=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzContainerServiceManagedCluster_StopViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop", ApiVersion = "2024-04-02-preview")] + public partial class StopAzContainerServiceManagedCluster_StopViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StopAzContainerServiceManagedCluster_StopViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.StopAzContainerServiceManagedCluster_StopViaIdentity Clone() + { + var clone = new StopAzContainerServiceManagedCluster_StopViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersStop' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersStopViaIdentity(InputObject.Id, onNoContent, 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.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.ManagedClustersStop(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public StopAzContainerServiceManagedCluster_StopViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceAgentPoolNodeImageVersion_Upgrade.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceAgentPoolNodeImageVersion_Upgrade.cs new file mode 100644 index 000000000000..3cf95d8790c0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceAgentPoolNodeImageVersion_Upgrade.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides + /// one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + /// + /// + /// [OpenAPI] UpgradeNodeImageVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzContainerServiceAgentPoolNodeImageVersion_Upgrade", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion", ApiVersion = "2024-04-02-preview")] + public partial class UpdateAzContainerServiceAgentPoolNodeImageVersion_Upgrade : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _agentPoolName; + + /// The name of the agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string AgentPoolName { get => this._agentPoolName; set => this._agentPoolName = 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzContainerServiceAgentPoolNodeImageVersion_Upgrade + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.UpdateAzContainerServiceAgentPoolNodeImageVersion_Upgrade Clone() + { + var clone = new UpdateAzContainerServiceAgentPoolNodeImageVersion_Upgrade(); + 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.ResourceName = this.ResourceName; + clone.AgentPoolName = this.AgentPoolName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsUpgradeNodeImageVersion' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsUpgradeNodeImageVersion(SubscriptionId, ResourceGroupName, ResourceName, AgentPoolName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,AgentPoolName=AgentPoolName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzContainerServiceAgentPoolNodeImageVersion_Upgrade() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, AgentPoolName=AgentPoolName }) + { + 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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity.cs new file mode 100644 index 000000000000..d7cc263c0296 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// + /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides + /// one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + /// + /// + /// [OpenAPI] UpgradeNodeImageVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion", ApiVersion = "2024-04-02-preview")] + public partial class UpdateAzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.UpdateAzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity Clone() + { + var clone = new UpdateAzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity(); + 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; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsUpgradeNodeImageVersion' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AgentPoolsUpgradeNodeImageVersionViaIdentity(InputObject.Id, 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.ResourceName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AgentPoolName) + { + 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.AgentPoolsUpgradeNodeImageVersion(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, InputObject.AgentPoolName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzContainerServiceAgentPoolNodeImageVersion_UpgradeViaIdentity() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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 == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateExpanded.cs new file mode 100644 index 000000000000..29a9231928b6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateExpanded.cs @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Updates tags on a managed cluster snapshot. + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzContainerServiceManagedClusterSnapshotTag_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Updates tags on a managed cluster snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Tags object for patch operations. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObject(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClusterSnapshotsUpdateTags' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClusterSnapshotsUpdateTags(SubscriptionId, ResourceGroupName, ResourceName, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateViaIdentityExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..0e06222462f6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateViaIdentityExpanded.cs @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Updates tags on a managed cluster snapshot. + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzContainerServiceManagedClusterSnapshotTag_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Updates tags on a managed cluster snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Tags object for patch operations. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObject(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClusterSnapshotsUpdateTags' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClusterSnapshotsUpdateTagsViaIdentity(InputObject.Id, _parametersBody, 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.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.ManagedClusterSnapshotsUpdateTags(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzContainerServiceManagedClusterSnapshotTag_UpdateViaIdentityExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedClusterSnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterTag_UpdateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterTag_UpdateExpanded.cs new file mode 100644 index 000000000000..985617f83d8e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterTag_UpdateExpanded.cs @@ -0,0 +1,536 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Updates tags on a managed cluster. + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzContainerServiceManagedClusterTag_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Updates tags on a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class UpdateAzContainerServiceManagedClusterTag_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Tags object for patch operations. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObject(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// The request should only proceed if an entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if an entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if an entity matches this string.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzContainerServiceManagedClusterTag_UpdateExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.UpdateAzContainerServiceManagedClusterTag_UpdateExpanded Clone() + { + var clone = new UpdateAzContainerServiceManagedClusterTag_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._parametersBody = this._parametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ResourceName = this.ResourceName; + clone.IfMatch = this.IfMatch; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersUpdateTags' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagedClustersUpdateTags(SubscriptionId, ResourceGroupName, ResourceName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzContainerServiceManagedClusterTag_UpdateExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedCluster + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..10d8a54b8e3c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded.cs @@ -0,0 +1,516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Updates tags on a managed cluster. + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Updates tags on a managed cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class UpdateAzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Tags object for patch operations. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObject(); + + /// 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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// The request should only proceed if an entity matches this string. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The request should only proceed if an entity matches this string.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The request should only proceed if an entity matches this string.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Cmdlets.UpdateAzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzContainerServiceManagedClusterTag_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._parametersBody = this._parametersBody; + clone.IfMatch = this.IfMatch; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.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.ContainerService.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + 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.ContainerService.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagedClustersUpdateTags' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagedClustersUpdateTagsViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, _parametersBody, 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.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.ManagedClustersUpdateTags(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public UpdateAzContainerServiceManagedClusterTag_UpdateViaIdentityExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.IManagedCluster + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.IManagedCluster + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceSnapshotTag_UpdateExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceSnapshotTag_UpdateExpanded.cs new file mode 100644 index 000000000000..3fd73ee1b463 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceSnapshotTag_UpdateExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Updates tags on a snapshot. + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzContainerServiceSnapshotTag_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Updates tags on a snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class UpdateAzContainerServiceSnapshotTag_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Tags object for patch operations. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObject(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _resourceName; + + /// The name of the managed cluster resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the managed cluster resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the managed cluster resource.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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. 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.ContainerService.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.ContainerService.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SnapshotsUpdateTags' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SnapshotsUpdateTags(SubscriptionId, ResourceGroupName, ResourceName, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.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,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzContainerServiceSnapshotTag_UpdateExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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, ResourceName=ResourceName, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.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, ResourceName=ResourceName, body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ISnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceSnapshotTag_UpdateViaIdentityExpanded.cs b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceSnapshotTag_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..bd68b212cfe7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/cmdlets/UpdateAzContainerServiceSnapshotTag_UpdateViaIdentityExpanded.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.ContainerService.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + using System; + + /// Updates tags on a snapshot. + /// + /// [OpenAPI] UpdateTags=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzContainerServiceSnapshotTag_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Description(@"Updates tags on a snapshot.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", ApiVersion = "2024-04-02-preview")] + public partial class UpdateAzContainerServiceSnapshotTag_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Tags object for patch operations. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObject _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.TagsObject(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ContainerServiceClient Client => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.IContainerServiceIdentity 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.ContainerService.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ContainerService.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ITagsObjectTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip 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.ContainerService.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SnapshotsUpdateTags' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.SnapshotsUpdateTagsViaIdentity(InputObject.Id, _parametersBody, 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.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.SnapshotsUpdateTags(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ResourceName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzContainerServiceSnapshotTag_UpdateViaIdentityExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Models.Api20240402Preview.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + 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.ContainerService.Models.Api20240402Preview.ISnapshot + /// from the remote call + /// + /// A that will be complete when handling of 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.ContainerService.Models.Api20240402Preview.ISnapshot + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml new file mode 100644 index 000000000000..4d28aa4b2f4f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.format.ps1xml @@ -0,0 +1,554 @@ + + + + + AzureErrorRecords + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + AzureErrorRecords + + + $_.InvocationInfo.HistoryId + + + + + + + + ErrorCategory + + + ErrorDetail + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.BoundParameters + + + + $_.InvocationInfo.UnboundParameters + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord] + + + + + RequestId + + + Message + + + ServerMessage + + + ServerResponse + + + RequestMessage + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + StackTrace + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord] + + + + + Message + + + StackTrace + + + + $_.Exception.GetType() + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.HistoryId + + + + + + + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Description + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + Token + + + ExpiresOn + + + Type + + + TenantId + + + UserId + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + + + + Left + + + + Left + + + + Left + + + + + + + + Left + locationPlacementId + + + Left + QuotaId + + + Left + SpendingLimit + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + Id + + + Type + + + Tenants + + + Credential + + + TenantMap + + + CertificateThumbprint + + + + $_.ExtendedProperties.GetEnumerator() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + + + + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Key + + + Left + Value + + + Left + AppliesTo + + + Left + Scope + + + Left + HelpMessage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..8271581789c7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.generated.format.ps1xml @@ -0,0 +1,471 @@ + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + ResourceManagerUrl + + + Left + ActiveDirectoryAuthority + + + Left + Type + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Id + + + Left + TenantId + + + Left + State + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + $_.Context.Account.ToString() + + + Left + $_.Context.Subscription.Name + + + Left + $_.Context.Tenant.ToString() + + + Left + $_.Context.Environment.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + 40 + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Account + + + Left + $_.Subscription.Name + + + Left + Environment + + + Left + $_.Tenant.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Id + + + Left + $_.Name + + + Left + $_.TenantCategory + + + Left + $_.Domains + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml new file mode 100644 index 000000000000..2873f28fd663 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Accounts.types.ps1xml @@ -0,0 +1,306 @@ + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.AuthenticationStoreTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.ProtectedFileTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + Microsoft.Azure.Commands.Profile.Models.AzureContextConverter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.nuspec b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.nuspec new file mode 100644 index 000000000000..c7025c12758f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.nuspec @@ -0,0 +1,19 @@ + + + + Az.Accounts + 2.13.1 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://learn.microsoft.com/powershell/azure/authenticate-azureps + * Added the module name in breaking change messages +* Upgraded Microsoft.ApplicationInsights version from 2.13.1 to 2.18.0 + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCmdlet_Get-AzConfig PSCmdlet_Update-AzConfig PSCmdlet_Clear-AzConfig PSCmdlet_Export-AzConfig PSCmdlet_Import-AzConfig PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Get-AzConfig PSCommand_Update-AzConfig PSCommand_Clear-AzConfig PSCommand_Export-AzConfig PSCommand_Import-AzConfig PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest PSCommand_Set-AzConfig + + \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 new file mode 100644 index 000000000000..8b322becabf0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psd1 @@ -0,0 +1,389 @@ +# +# Module manifest for module 'Az.Accounts' +# +# Generated by: Microsoft Corporation +# +# Generated on: 9/20/2023 +# + +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'Az.Accounts.psm1' + +# Version number of this module. +ModuleVersion = '2.13.1' + +# Supported PSEditions +CompatiblePSEditions = 'Core', 'Desktop' + +# ID used to uniquely identify this module +GUID = '17a2feff-488b-47f9-8729-e2cec094624c' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://learn.microsoft.com/powershell/azure/authenticate-azureps' + +# Minimum version of the PowerShell engine required by this module +PowerShellVersion = '5.1' + +# Name of the PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +DotNetFrameworkVersion = '4.7.2' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# ClrVersion = '' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +# RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = 'Microsoft.Azure.PowerShell.AssemblyLoading.dll', + 'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll', + 'Microsoft.Azure.PowerShell.Authentication.dll', + 'Microsoft.Azure.PowerShell.Authenticators.dll', + 'Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Clients.Authorization.dll', + 'Microsoft.Azure.PowerShell.Clients.Compute.dll', + 'Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll', + 'Microsoft.Azure.PowerShell.Clients.Monitor.dll', + 'Microsoft.Azure.PowerShell.Clients.Network.dll', + 'Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll', + 'Microsoft.Azure.PowerShell.Clients.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Common.dll', + 'Microsoft.Azure.PowerShell.Storage.dll', + 'Microsoft.Azure.PowerShell.Clients.Storage.Management.dll', + 'Microsoft.Azure.PowerShell.Clients.KeyVault.dll', + 'Microsoft.Azure.PowerShell.Clients.Websites.dll', + 'Hyak.Common.dll', 'Microsoft.ApplicationInsights.dll', + 'Microsoft.Azure.Common.dll', 'Microsoft.Rest.ClientRuntime.dll', + 'Microsoft.Rest.ClientRuntime.Azure.dll', + 'Microsoft.WindowsAzure.Storage.dll', + 'Microsoft.WindowsAzure.Storage.DataMovement.dll', + 'Microsoft.Azure.PowerShell.Clients.Aks.dll', + 'Microsoft.Azure.PowerShell.Strategies.dll', + 'Microsoft.Azure.PowerShell.Common.Share.dll', 'FuzzySharp.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = 'Accounts.format.ps1xml', 'Accounts.generated.format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @() + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = 'Disable-AzDataCollection', 'Disable-AzContextAutosave', + 'Enable-AzDataCollection', 'Enable-AzContextAutosave', + 'Remove-AzEnvironment', 'Get-AzEnvironment', 'Set-AzEnvironment', + 'Add-AzEnvironment', 'Get-AzSubscription', 'Connect-AzAccount', + 'Get-AzContext', 'Set-AzContext', 'Import-AzContext', 'Save-AzContext', + 'Get-AzTenant', 'Send-Feedback', 'Resolve-AzError', 'Select-AzContext', + 'Rename-AzContext', 'Remove-AzContext', 'Clear-AzContext', + 'Disconnect-AzAccount', 'Get-AzContextAutosaveSetting', + 'Set-AzDefault', 'Get-AzDefault', 'Clear-AzDefault', + 'Register-AzModule', 'Enable-AzureRmAlias', 'Disable-AzureRmAlias', + 'Uninstall-AzureRm', 'Invoke-AzRestMethod', 'Get-AzAccessToken', + 'Open-AzSurveyLink', 'Get-AzConfig', 'Update-AzConfig', + 'Clear-AzConfig', 'Export-AzConfig', 'Import-AzConfig' + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = 'Add-AzAccount', 'Login-AzAccount', 'Remove-AzAccount', + 'Logout-AzAccount', 'Select-AzSubscription', 'Resolve-Error', + 'Save-AzProfile', 'Get-AzDomain', 'Invoke-AzRest', 'Set-AzConfig' + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure','ResourceManager','ARM','Accounts','Authentication','Environment','Subscription' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + ReleaseNotes = '* Added the module name in breaking change messages +* Upgraded Microsoft.ApplicationInsights version from 2.13.1 to 2.18.0 ' + + # Prerelease string of this module + # Prerelease = '' + + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false + + # External dependent modules of this module + # ExternalModuleDependencies = @() + + } # End of PSData hashtable + + } # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} + + +# SIG # Begin signature block +# MIIn0QYJKoZIhvcNAQcCoIInwjCCJ74CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAk2HPcwhsJ45gq +# tueQH3lZy0qaJUF7KlbsF568k8m1kaCCDYUwggYDMIID66ADAgECAhMzAAADTU6R +# phoosHiPAAAAAANNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI4WhcNMjQwMzE0MTg0MzI4WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDUKPcKGVa6cboGQU03ONbUKyl4WpH6Q2Xo9cP3RhXTOa6C6THltd2RfnjlUQG+ +# Mwoy93iGmGKEMF/jyO2XdiwMP427j90C/PMY/d5vY31sx+udtbif7GCJ7jJ1vLzd +# j28zV4r0FGG6yEv+tUNelTIsFmmSb0FUiJtU4r5sfCThvg8dI/F9Hh6xMZoVti+k +# bVla+hlG8bf4s00VTw4uAZhjGTFCYFRytKJ3/mteg2qnwvHDOgV7QSdV5dWdd0+x +# zcuG0qgd3oCCAjH8ZmjmowkHUe4dUmbcZfXsgWlOfc6DG7JS+DeJak1DvabamYqH +# g1AUeZ0+skpkwrKwXTFwBRltAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUId2Img2Sp05U6XI04jli2KohL+8w +# VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMDUxNzAfBgNVHSMEGDAW +# gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw +# MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx +# XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +# ACMET8WuzLrDwexuTUZe9v2xrW8WGUPRQVmyJ1b/BzKYBZ5aU4Qvh5LzZe9jOExD +# YUlKb/Y73lqIIfUcEO/6W3b+7t1P9m9M1xPrZv5cfnSCguooPDq4rQe/iCdNDwHT +# 6XYW6yetxTJMOo4tUDbSS0YiZr7Mab2wkjgNFa0jRFheS9daTS1oJ/z5bNlGinxq +# 2v8azSP/GcH/t8eTrHQfcax3WbPELoGHIbryrSUaOCphsnCNUqUN5FbEMlat5MuY +# 94rGMJnq1IEd6S8ngK6C8E9SWpGEO3NDa0NlAViorpGfI0NYIbdynyOB846aWAjN +# fgThIcdzdWFvAl/6ktWXLETn8u/lYQyWGmul3yz+w06puIPD9p4KPiWBkCesKDHv +# XLrT3BbLZ8dKqSOV8DtzLFAfc9qAsNiG8EoathluJBsbyFbpebadKlErFidAX8KE +# usk8htHqiSkNxydamL/tKfx3V/vDAoQE59ysv4r3pE+zdyfMairvkFNNw7cPn1kH +# Gcww9dFSY2QwAxhMzmoM0G+M+YvBnBu5wjfxNrMRilRbxM6Cj9hKFh0YTwba6M7z +# ntHHpX3d+nabjFm/TnMRROOgIXJzYbzKKaO2g1kWeyG2QtvIR147zlrbQD4X10Ab +# rRg9CpwW7xYxywezj+iNAc+QmFzR94dzJkEPUSCJPsTFMIIHejCCBWKgAwIBAgIK +# YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm +# aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw +# OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD +# VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG +# 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la +# UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc +# 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D +# dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ +# lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk +# kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 +# A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd +# X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL +# 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd +# sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 +# T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS +# 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI +# bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL +# BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD +# uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv +# c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF +# BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h +# cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA +# YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn +# 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 +# v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b +# pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ +# KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy +# CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp +# mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi +# hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb +# BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS +# oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL +# gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX +# cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGaIwghmeAgEBMIGVMH4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p +# Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAANNTpGmGiiweI8AAAAA +# A00wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw +# HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIPqM +# nLtedTpCCZWzygnrN5qjriZa3nvW0MEUhgHrBf/kMEIGCisGAQQBgjcCAQwxNDAy +# oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20wDQYJKoZIhvcNAQEBBQAEggEAS7p4ZPALh+4+yJuTQhIPP+LV4A+Jom3lI5qs +# lp7zGTEfbcL8TMbAGgLGl186yuYk/eJlpkSh/cGFRhbcBzQUgXmUfAGnRYugqMXE +# VvX3Qil+ivulxYqiozTr9zWcJ3vitlWIAFJqTTmdHjP0smU7TqrS66Tk06fR4sXU +# x5BVXrlrIismo9vw+sA7wI8LHKwTB61N+w9w2QRDXotckocOV5R/T6ySpCkJfjiP +# V/Ht7VO4JbhDXBedTy9uZ6yQdaBJgmF21iJxacaeYL+StSI/OaHApGTHpJo0/l8K +# UzZmO3S3+sUX3NwAyZ6A4iTM3dGMPFTiEykJD41kS/eAZgy+TaGCFywwghcoBgor +# BgEEAYI3AwMBMYIXGDCCFxQGCSqGSIb3DQEHAqCCFwUwghcBAgEDMQ8wDQYJYIZI +# AWUDBAIBBQAwggFZBgsqhkiG9w0BCRABBKCCAUgEggFEMIIBQAIBAQYKKwYBBAGE +# WQoDATAxMA0GCWCGSAFlAwQCAQUABCDzkxGA6Q74EKQNCUJRJIpLLx9SAzmpu+DM +# Ytnz01KnYQIGZN5VuexfGBMyMDIzMDkyMDA2MzM0Ni4wMjVaMASAAgH0oIHYpIHV +# MIHSMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQL +# EyRNaWNyb3NvZnQgSXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsT +# HVRoYWxlcyBUU1MgRVNOOjA4NDItNEJFNi1DMjlBMSUwIwYDVQQDExxNaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBTZXJ2aWNloIIRezCCBycwggUPoAMCAQICEzMAAAGybkAD +# f26plJIAAQAAAbIwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAg +# UENBIDIwMTAwHhcNMjIwOTIwMjAyMjAxWhcNMjMxMjE0MjAyMjAxWjCB0jELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9z +# b2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMg +# VFNTIEVTTjowODQyLTRCRTYtQzI5QTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt +# U3RhbXAgU2VydmljZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMqi +# ZTIde/lQ4rC+Bml5f/Wuq/xKTxrfbG23HofmQ+qZAN4GyO73PF3y9OAfpt7Qf2jc +# ldWOGUB+HzBuwllYyP3fx4MY8zvuAuB37FvoytnNC2DKnVrVlHOVcGUL9CnmhDNM +# A2/nskjIf2IoiG9J0qLYr8duvHdQJ9Li2Pq9guySb9mvUL60ogslCO9gkh6FiEDw +# MrwUr8Wja6jFpUTny8tg0N0cnCN2w4fKkp5qZcbUYFYicLSb/6A7pHCtX6xnjqwh +# mJoib3vkKJyVxbuFLRhVXxH95b0LHeNhifn3jvo2j+/4QV10jEpXVW+iC9BsTtR6 +# 9xvTjU51ZgP7BR4YDEWq7JsylSOv5B5THTDXRf184URzFhTyb8OZQKY7mqMh7c8J +# 8w1sEM4XDUF2UZNy829NVCzG2tfdEXZaHxF8RmxpQYBxyhZwY1rotuIS+gfN2eq+ +# hkAT3ipGn8/KmDwDtzAbnfuXjApgeZqwgcYJ8pDJ+y/xU6ouzJz1Bve5TTihkiA7 +# wQsQe6R60Zk9dPdNzw0MK5niRzuQZAt4GI96FhjhlUWcUZOCkv/JXM/OGu/rgSpl +# YwdmPLzzfDtXyuy/GCU5I4l08g6iifXypMgoYkkceOAAz4vx1x0BOnZWfI3fSwqN +# UvoN7ncTT+MB4Vpvf1QBppjBAQUuvui6eCG0MCVNAgMBAAGjggFJMIIBRTAdBgNV +# HQ4EFgQUmfIngFzZEZlPkjDOVluBSDDaanEwHwYDVR0jBBgwFoAUn6cVXQBeYl2D +# 9OXSZacbUzUZ6XIwXwYDVR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3Nv +# ZnQuY29tL3BraW9wcy9jcmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy +# MDIwMTAoMSkuY3JsMGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1l +# LVN0YW1wJTIwUENBJTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADAWBgNVHSUB +# Af8EDDAKBggrBgEFBQcDCDAOBgNVHQ8BAf8EBAMCB4AwDQYJKoZIhvcNAQELBQAD +# ggIBANxHtu3FzIabaDbWqswdKBlAhKXRCN+5CSMiv2TYa4i2QuWIm+99piwAhDhA +# Dfbqor1zyLi95Y6GQnvIWUgdeC7oL1ZtZye92zYK+EIfwYZmhS+CH4infAzUvscH +# ZF3wlrJUfPUIDGVP0lCYVse9mguvG0dqkY4ayQPEHOvJubgZZaOdg/N8dInd6fGe +# Oc+0DoGzB+LieObJ2Q0AtEt3XN3iX8Cp6+dZTX8xwE/LvhRwPpb/+nKshO7TVuve +# nwdTwqB/LT6CNPaElwFeKxKrqRTPMbHeg+i+KnBLfwmhEXsMg2s1QX7JIxfvT96m +# d0eiMjiMEO22LbOzmLMNd3LINowAnRBAJtX+3/e390B9sMGMHp+a1V+hgs62AopB +# l0p/00li30DN5wEQ5If35Zk7b/T6pEx6rJUDYCti7zCbikjKTanBnOc99zGMlej5 +# X+fC/k5ExUCrOs3/VzGRCZt5LvVQSdWqq/QMzTEmim4sbzASK9imEkjNtZZyvC1C +# sUcD1voFktld4mKMjE+uDEV3IddD+DrRk94nVzNPSuZXewfVOnXHSeqG7xM3V7fl +# 2aL4v1OhL2+JwO1Tx3B0irO1O9qbNdJk355bntd1RSVKgM22KFBHnoL7Js7pRhBi +# aKmVTQGoOb+j1Qa7q+cixGo48Vh9k35BDsJS/DLoXFSPDl4mMIIHcTCCBVmgAwIB +# AgITMwAAABXF52ueAptJmQAAAAAAFTANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UE +# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc +# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0 +# IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1 +# WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCC +# AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOThpkzntHIhC3miy9ckeb0O +# 1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDivbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZn +# hUYjDLWNE893MsAQGOhgfWpSg0S3po5GawcU88V29YZQ3MFEyHFcUTE3oAo4bo3t +# 1w/YJlN8OWECesSq/XJprx2rrPY2vjUmZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxq +# D89d9P6OU8/W7IVWTe/dvI2k45GPsjksUZzpcGkNyjYtcI4xyDUoveO0hyTD4MmP +# frVUj9z6BVWYbWg7mka97aSueik3rMvrg0XnRm7KMtXAhjBcTyziYrLNueKNiOSW +# rAFKu75xqRdbZ2De+JKRHh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv +# 231fgLrbqn427DZM9ituqBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zb +# r17C89XYcz1DTsEzOUyOArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7XKHYC4jMYcten +# IPDC+hIK12NvDMk2ZItboKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiER9vcG9H9stQc +# xWv2XFJRXRLbJbqvUAV6bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/eKtFtvUeh17a +# j54WcmnGrnu3tz5q4i6tAgMBAAGjggHdMIIB2TASBgkrBgEEAYI3FQEEBQIDAQAB +# MCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQU +# n6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEw +# QTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9E +# b2NzL1JlcG9zaXRvcnkuaHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQB +# gjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/ +# MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJ +# oEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01p +# Y1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQROMEwwSgYIKwYB +# BQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2VydHMvTWljUm9v +# Q2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3h +# LB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pkbHzQdTltuw8x +# 5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gngugnue99qb74p +# y27YP0h1AdkY3m2CDPVtI1TkeFN1JFe53Z/zjj3G82jfZfakVqr3lbYoVSfQJL1A +# oL8ZthISEV09J+BAljis9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbC +# HcNhcy4sa3tuPywJeBTpkbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB +# 9s7GdP32THJvEKt1MMU0sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNt +# yo4JvbMBV0lUZNlz138eW0QBjloZkWsNn6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3 +# rsjoiV5PndLQTHa1V1QJsWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcV +# v7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrpNPgkNWcr4A24 +# 5oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6gMTN9vMvpe784cETRkPHIqzqKOghif9lw +# Y1NNje6CbaUFEMFxBmoQtB1VM1izoXBm8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB +# 0jELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl +# ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMk +# TWljcm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1U +# aGFsZXMgVFNTIEVTTjowODQyLTRCRTYtQzI5QTElMCMGA1UEAxMcTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUAjhJ+EeySRfn2KCNs +# jn9cF9AUSTqggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAN +# BgkqhkiG9w0BAQUFAAIFAOi0+i0wIhgPMjAyMzA5MjAxMjU3MTdaGA8yMDIzMDky +# MTEyNTcxN1owdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA6LT6LQIBADAKAgEAAgIR +# nAIB/zAHAgEAAgIR0DAKAgUA6LZLrQIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgor +# BgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUA +# A4GBAGjRjrn62VuBz/kNRF8KdoG4YOpoAZu0e3XBc+tcCCiG1Je/ZYXUzMrrq/cz +# MFXWzdmSQRBFPRvcFJw8LcTRu4C6eQOJywts4MMoyE3nJOUUUsOB/i2h2w7L/fo0 +# 3EeEXVTQn/aSK7jkMyysxQEWOw64WNG06Sd08ZDadqbnAc7zMYIEDTCCBAkCAQEw +# gZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAGybkADf26plJIA +# AQAAAbIwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0B +# CRABBDAvBgkqhkiG9w0BCQQxIgQgDd3716NLDTxGc+0tAskrKgBsB9PO5RK3smyU +# vyfE7/owgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCBTeM485+E+t4PEVieU +# oFKX7PVyLo/nzu+htJPCG04+NTCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABsm5AA39uqZSSAAEAAAGyMCIEILLYuf/URU9tiFRXIhgo +# OAyZuYAFYpFAH2I0pLSN1lWkMA0GCSqGSIb3DQEBCwUABIICAMQZqLlhmv19+CcR +# claEHbZr4MgJjWr2Da27FqRgoOLDtNaS/IZ16UHukAV7JVdIOdVroxfvVdWXh5iq +# dSAfYNMkSBBPxxLbSFnndIw7KWkp3vbxFcJ6+JsK9k54TDZAUP17OpTM11gpTYfm +# uVAWZaqh086moHKLZsjVU/rzFA3En+QY5ZticB0LytwkIY+7pS6ikN4Q3e/pzPLH +# CSa2OZN3bXezZzOWMFLQwJ2IQJLpCKs0RiICTOaOKTpsjcoK2eBLwzXsgnnNZmj/ +# q1XMWGUJbnNJH4mszFVJ6X0cUo3OJvkF9V796VoZZMUS9i0EmCUZNE0rcvPdBnIE +# c8P+QSbLudmDA+XXno2ItqeA1ZkatNLyZGYGSjK4BU48MzcHMkWKCcUlqyfUiJt7 +# 7UGXDTuCzVkqCVVo7XpJNbN7X1oLkh8yTPr5RBbmlzzykIfEkoVnYj4Qc89ohb1N +# qXKDWby0ldBFOZIgyOgRiYJ984yyeAAXvOpTexhDtDCguYGfV56U+NTMve18Oa8u +# IODMD1Nfr+JLHL+J2tkMfZGFa71tGGnI2w9W6xUltjs8XINLrF08szKC6Vlo20wl +# F09Em/cF6qbZ2cnC/BDOt3xDDnJHYOHLR9QCZABbMd7JiuH32PE5C79PbpPYzyje +# p0LB6iM1n1UYaSSFWCx/a3Itdf6/ +# SIG # End signature block diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 new file mode 100644 index 000000000000..2022fcfde49d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Az.Accounts.psm1 @@ -0,0 +1,365 @@ +# +# Script module for module 'Az.Accounts' that is executed when 'Az.Accounts' is imported in a PowerShell session. +# +# Generated by: Microsoft Corporation +# +# Generated on: 09/20/2023 05:38:15 +# + +$PSDefaultParameterValues.Clear() +Set-StrictMode -Version Latest + +function Test-DotNet +{ + try + { + if ((Get-PSDrive 'HKLM' -ErrorAction Ignore) -and (-not (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' -ErrorAction Stop | Get-ItemPropertyValue -ErrorAction Stop -Name Release | Where-Object { $_ -ge 461808 }))) + { + throw ".NET Framework versions lower than 4.7.2 are not supported in Az. Please upgrade to .NET Framework 4.7.2 or higher." + } + } + catch [System.Management.Automation.DriveNotFoundException] + { + Write-Verbose ".NET Framework version check failed." + } +} + +function Preload-Assembly { + param ( + [string] + $AssemblyDirectory + ) + if($PSEdition -eq 'Desktop' -and (Test-Path $AssemblyDirectory -ErrorAction Ignore)) + { + try + { + Get-ChildItem -ErrorAction Stop -Path $AssemblyDirectory -Filter "*.dll" | ForEach-Object { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + catch {} + } +} + +if ($true -and ($PSEdition -eq 'Desktop')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'5.1') + { + throw "PowerShell versions lower than 5.1 are not supported in Az. Please upgrade to PowerShell 5.1 or higher." + } + + Test-DotNet +} + +if ($true -and ($PSEdition -eq 'Core')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'6.2.4') + { + throw "Current Az version doesn't support PowerShell Core versions lower than 6.2.4. Please upgrade to PowerShell Core 6.2.4 or higher." + } + if ($PSVersionTable.PSVersion -lt [Version]'7.0.6') + { + Write-Warning "This version of Az.Accounts is only supported on Windows PowerShell 5.1 and PowerShell 7.0.6 or greater, open https://aka.ms/install-powershell to learn how to upgrade. For further information, go to https://aka.ms/azpslifecycle." + } +} + +if (Test-Path -Path "$PSScriptRoot\StartupScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\StartupScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +# [windows powershell] preload assemblies +if ($PSEdition -eq "Desktop") { + [Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyProvider]::GetAssemblies().Values | ForEach-Object { + $path = $_.Item1 + try { + Add-Type -Path $path -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose "Could not preload $path" + } + } +} + +# [windows powershell] preload module alc assemblies +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "ModuleAlcAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll) + + +if (Test-Path -Path "$PSScriptRoot\PostImportScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\PostImportScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +$FilteredCommands = @() + +if ($Env:ACC_CLOUD -eq $null) +{ + $FilteredCommands | ForEach-Object { + + $existingDefault = $false + foreach ($key in $global:PSDefaultParameterValues.Keys) + { + if ($_ -like "$key") + { + $existingDefault = $true + } + } + + if (!$existingDefault) + { + $global:PSDefaultParameterValues.Add($_, + { + if ((Get-Command Get-AzContext -ErrorAction Ignore) -eq $null) + { + $context = Get-AzureRmContext + } + else + { + $context = Get-AzContext + } + if (($context -ne $null) -and $context.ExtendedProperties.ContainsKey("Default Resource Group")) { + $context.ExtendedProperties["Default Resource Group"] + } + }) + } + } +} + +[Microsoft.Azure.Commands.Profile.Utilities.CommandNotFoundHelper]::RegisterCommandNotFoundAction($ExecutionContext.InvokeCommand) + +# SIG # Begin signature block +# MIInwgYJKoZIhvcNAQcCoIInszCCJ68CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCb9fJw7tRJSjyo +# JEg82Xj/MrcwppXsz44viAgrYDK20aCCDXYwggX0MIID3KADAgECAhMzAAADTrU8 +# esGEb+srAAAAAANOMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI5WhcNMjQwMzE0MTg0MzI5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDdCKiNI6IBFWuvJUmf6WdOJqZmIwYs5G7AJD5UbcL6tsC+EBPDbr36pFGo1bsU +# p53nRyFYnncoMg8FK0d8jLlw0lgexDDr7gicf2zOBFWqfv/nSLwzJFNP5W03DF/1 +# 1oZ12rSFqGlm+O46cRjTDFBpMRCZZGddZlRBjivby0eI1VgTD1TvAdfBYQe82fhm +# WQkYR/lWmAK+vW/1+bO7jHaxXTNCxLIBW07F8PBjUcwFxxyfbe2mHB4h1L4U0Ofa +# +HX/aREQ7SqYZz59sXM2ySOfvYyIjnqSO80NGBaz5DvzIG88J0+BNhOu2jl6Dfcq +# jYQs1H/PMSQIK6E7lXDXSpXzAgMBAAGjggFzMIIBbzAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUnMc7Zn/ukKBsBiWkwdNfsN5pdwAw +# RQYDVR0RBD4wPKQ6MDgxHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEW +# MBQGA1UEBRMNMjMwMDEyKzUwMDUxNjAfBgNVHSMEGDAWgBRIbmTlUAXTgqoXNzci +# tW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3JsMGEG +# CCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDovL3d3dy5taWNyb3NvZnQu +# Y29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3J0 +# MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIBAD21v9pHoLdBSNlFAjmk +# mx4XxOZAPsVxxXbDyQv1+kGDe9XpgBnT1lXnx7JDpFMKBwAyIwdInmvhK9pGBa31 +# TyeL3p7R2s0L8SABPPRJHAEk4NHpBXxHjm4TKjezAbSqqbgsy10Y7KApy+9UrKa2 +# kGmsuASsk95PVm5vem7OmTs42vm0BJUU+JPQLg8Y/sdj3TtSfLYYZAaJwTAIgi7d +# hzn5hatLo7Dhz+4T+MrFd+6LUa2U3zr97QwzDthx+RP9/RZnur4inzSQsG5DCVIM +# pA1l2NWEA3KAca0tI2l6hQNYsaKL1kefdfHCrPxEry8onJjyGGv9YKoLv6AOO7Oh +# JEmbQlz/xksYG2N/JSOJ+QqYpGTEuYFYVWain7He6jgb41JbpOGKDdE/b+V2q/gX +# UgFe2gdwTpCDsvh8SMRoq1/BNXcr7iTAU38Vgr83iVtPYmFhZOVM0ULp/kKTVoir +# IpP2KCxT4OekOctt8grYnhJ16QMjmMv5o53hjNFXOxigkQWYzUO+6w50g0FAeFa8 +# 5ugCCB6lXEk21FFB1FdIHpjSQf+LP/W2OV/HfhC3uTPgKbRtXo83TZYEudooyZ/A +# Vu08sibZ3MkGOJORLERNwKm2G7oqdOv4Qj8Z0JrGgMzj46NFKAxkLSpE5oHQYP1H +# tPx1lPfD7iNSbJsP6LiUHXH1MIIHejCCBWKgAwIBAgIKYQ6Q0gAAAAAAAzANBgkq +# hkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x +# EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv +# bjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +# IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEwOTA5WjB+MQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQg +# Q29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +# CgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+laUKq4BjgaBEm6f8MMHt03 +# a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc6Whe0t+bU7IKLMOv2akr +# rnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4Ddato88tt8zpcoRb0Rrrg +# OGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+lD3v++MrWhAfTVYoonpy +# 4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nkkDstrjNYxbc+/jLTswM9 +# sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6A4aN91/w0FK/jJSHvMAh +# dCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmdX4jiJV3TIUs+UsS1Vz8k +# A/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL5zmhD+kjSbwYuER8ReTB +# w3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zdsGbiwZeBe+3W7UvnSSmn +# Eyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3T8HhhUSJxAlMxdSlQy90 +# lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS4NaIjAsCAwEAAaOCAe0w +# ggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRIbmTlUAXTgqoXNzcitW2o +# ynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYD +# VR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBDuRQFTuHqp8cx0SOJNDBa +# BgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2Ny +# bC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3JsMF4GCCsG +# AQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3J0MIGfBgNV +# HSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1hcnljcHMuaHRtMEAGCCsG +# AQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkAYwB5AF8AcwB0AGEAdABl +# AG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn8oalmOBUeRou09h0ZyKb +# C5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7v0epo/Np22O/IjWll11l +# hJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0bpdS1HXeUOeLpZMlEPXh6 +# I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/KmtYSWMfCWluWpiW5IP0 +# wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvyCInWH8MyGOLwxS3OW560 +# STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBpmLJZiWhub6e3dMNABQam +# ASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJihsMdYzaXht/a8/jyFqGa +# J+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYbBL7fQccOKO7eZS/sl/ah +# XJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbSoqKfenoi+kiVH6v7RyOA +# 9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sLgOppO6/8MO0ETI7f33Vt +# Y5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtXcVZOSEXAQsmbdlsKgEhr +# /Xmfwb1tbWrJUnMTDXpQzTGCGaIwghmeAgEBMIGVMH4xCzAJBgNVBAYTAlVTMRMw +# EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN +# aWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNp +# Z25pbmcgUENBIDIwMTECEzMAAANOtTx6wYRv6ysAAAAAA04wDQYJYIZIAWUDBAIB +# BQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEO +# MAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIBsLZoT0GL3AfKW+v1FN9bVc +# VG31uoPh0H8hDfNXM1ivMEIGCisGAQQBgjcCAQwxNDAyoBSAEgBNAGkAYwByAG8A +# cwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20wDQYJKoZIhvcNAQEB +# BQAEggEAjm1RFaOR3jSivggTJhg8Xe4uZwJNAA0kGjYaTLK0sO7bf6gszj9yyZOW +# xl5OXc3I5e8idePoA9U2yMuNyGLP10P/SjCg/FSClm4PZr0HA1ORNDHn85kNLc+7 +# sQMWCkOiYLKNq/TudhmRGfeuEzjeZSiXKGbB65Fr5LeqGAuMNcZ5lKsP4Es7Cavs +# hG+lQd/27Lrb3xnB5LF5FZ9blmjY9UcS0hBnd6x/ynOB4WBFBjsu42fJZz2xx/04 +# panwkiuigz301YvY0maYIiNYJOWaNU32fVM+YX9b7+Iq5plTEx8XhWsexqmQTv9H +# jMkZa/2RkYvkbGfHQ3Ckw/oYI1NydKGCFywwghcoBgorBgEEAYI3AwMBMYIXGDCC +# FxQGCSqGSIb3DQEHAqCCFwUwghcBAgEDMQ8wDQYJYIZIAWUDBAIBBQAwggFZBgsq +# hkiG9w0BCRABBKCCAUgEggFEMIIBQAIBAQYKKwYBBAGEWQoDATAxMA0GCWCGSAFl +# AwQCAQUABCCehXSh9EH4ZOe8kqIKTs5kjZxVf/mTlUUsukZabtyKDwIGZN/OPZ5t +# GBMyMDIzMDkyMDA1NTAzNS4zNjZaMASAAgH0oIHYpIHVMIHSMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQgSXJl +# bGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1MgRVNO +# OkQwODItNEJGRC1FRUJBMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBT +# ZXJ2aWNloIIRezCCBycwggUPoAMCAQICEzMAAAG6Hz8Z98F1vXwAAQAAAbowDQYJ +# KoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x +# EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv +# bjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwHhcNMjIw +# OTIwMjAyMjE5WhcNMjMxMjE0MjAyMjE5WjCB0jELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxhbmQgT3Bl +# cmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpEMDgyLTRC +# RkQtRUVCQTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZTCC +# AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAIhOFYMzkjWAE9UVnXF9hRGv +# 0xBRxc+I5Hu3hxVFXyK3u38xusEb0pLkwjgGtDsaLLbrlMxqX3tFb/3BgEPEC3L0 +# wX76gD8zHt+wiBV5mq5BWop29qRrgMJKKCPcpQnSjs9B/4XMFFvrpdPicZDv43FL +# gz9fHqMq0LJDw5JAHGDS30TCY9OF43P4d44Z9lE7CaVS2pJMF3L453MXB5yYK/KD +# bilhERP1jxn2yl+tGCRguIAsMG0oeOhXaw8uSGOhS6ACSHb+ebi0038MFHyoTNhK +# f+SYo4OpSY3xP4+swBBTKDoYP1wH+CfxG6h9fymBJQPQZaqfl0riiDLjmDunQtH1 +# GD64Air5k9Jdwhq5wLmSWXjyFVL+IDfOpdixJ6f5o+MhE6H4t31w+prygHmd2UHQ +# 657UGx6FNuzwC+SpAHmV76MZYac4uAhTgaP47P2eeS1ockvyhl9ya+9JzPfMkug3 +# xevzFADWiLRMr066EMV7q3JSRAsnCS9GQ08C4FKPbSh8OPM33Lng0ffxANnHAAX/ +# DE7cHcx7l9jaV3Acmkj7oqir4Eh2u5YxwiaTE37XaMumX2ES3PJ5NBaXq7YdLJwy +# SD+U9pk/tl4dQ1t/Eeo7uDTliOyQkD8I74xpVB0T31/67KHfkBkFVvy6wye21V+9 +# IC8uSD++RgD3RwtN2kE/AgMBAAGjggFJMIIBRTAdBgNVHQ4EFgQUimLm8QMeJa25 +# j9MWeabI2HSvZOUwHwYDVR0jBBgwFoAUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXwYD +# VR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9j +# cmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3JsMGwG +# CCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDovL3d3dy5taWNyb3NvZnQu +# Y29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIw +# MjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcD +# CDAOBgNVHQ8BAf8EBAMCB4AwDQYJKoZIhvcNAQELBQADggIBAF/I8U6hbZhvDcn9 +# 6nZ6tkbSEjXPvKZ6wroaXcgstEhpgaeEwleLuPXHLzEWtuJuYz4eshmhXqFr49lb +# AcX5SN5/cEsP0xdFayb7U5P94JZd3HjFvpWRNoNBhF3SDM0A38sI2H+hjhB/VfX1 +# XcZiei1ROPAyCHcBgHLyQrEu6mnb3HhbIdr8h0Ta7WFylGhLSFW6wmzKusP6aOlm +# nGSac5NMfla6lRvTYHd28rbbCgfSm1RhTgoZj+W8DTKtiEMwubHJ3mIPKmo8xtJI +# WXPnXq6XKgldrL5cynLMX/0WX65OuWbHV5GTELdfWvGV3DaZrHPUQ/UP31Keqb2x +# jVCb30LVwgbjIvYS77N1dARkN8F/9pJ1gO4IvZWMwyMlKKFGojO1f1wbjSWcA/57 +# tsc+t2blrMWgSNHgzDr01jbPSupRjy3Ht9ZZs4xN02eiX3eG297NrtC6l4c/gzn2 +# 0eqoqWx/uHWxmTgB0F5osBuTHOe77DyEA0uhArGlgKP91jghgt/OVHoH65g0QqCt +# gZ+36mnCEg6IOhFoFrCc0fJFGVmb1+17gEe+HRMM7jBk4O06J+IooFrI3e3PJjPr +# Qano/MyE3h+zAuBWGMDRcUlNKCDU7dGnWvH3XWwLrCCIcz+3GwRUMsLsDdPW2OVv +# 7v1eEJiMSIZ2P+M7L20Q8aznU4OAMIIHcTCCBVmgAwIBAgITMwAAABXF52ueAptJ +# mQAAAAAAFTANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgT +# Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m +# dCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNh +# dGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1 +# WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQD +# Ex1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEB +# BQADggIPADCCAgoCggIBAOThpkzntHIhC3miy9ckeb0O1YLT/e6cBwfSqWxOdcjK +# NVf2AX9sSuDivbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZnhUYjDLWNE893MsAQGOhg +# fWpSg0S3po5GawcU88V29YZQ3MFEyHFcUTE3oAo4bo3t1w/YJlN8OWECesSq/XJp +# rx2rrPY2vjUmZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxqD89d9P6OU8/W7IVWTe/d +# vI2k45GPsjksUZzpcGkNyjYtcI4xyDUoveO0hyTD4MmPfrVUj9z6BVWYbWg7mka9 +# 7aSueik3rMvrg0XnRm7KMtXAhjBcTyziYrLNueKNiOSWrAFKu75xqRdbZ2De+JKR +# Hh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv231fgLrbqn427DZM9itu +# qBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zbr17C89XYcz1DTsEzOUyO +# ArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7XKHYC4jMYctenIPDC+hIK12NvDMk2ZItb +# oKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiER9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6 +# bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/eKtFtvUeh17aj54WcmnGrnu3tz5q4i6t +# AgMBAAGjggHdMIIB2TASBgkrBgEEAYI3FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQW +# BBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacb +# UzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEwQTA/BggrBgEFBQcCARYz +# aHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9Eb2NzL1JlcG9zaXRvcnku +# aHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIA +# QwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNX2 +# VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwu +# bWljcm9zb2Z0LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEw +# LTA2LTIzLmNybDBaBggrBgEFBQcBAQROMEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYt +# MjMuY3J0MA0GCSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3hLB9nATEkW+Geckv8qW/q +# XBS2Pk5HZHixBpOXPTEztTnXwnE2P9pkbHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6 +# U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gngugnue99qb74py27YP0h1AdkY3m2CDPVt +# I1TkeFN1JFe53Z/zjj3G82jfZfakVqr3lbYoVSfQJL1AoL8ZthISEV09J+BAljis +# 9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTp +# kbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0 +# sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNtyo4JvbMBV0lUZNlz138e +# W0QBjloZkWsNn6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJ +# sWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7 +# Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrpNPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0 +# dFtq0Z4+7X6gMTN9vMvpe784cETRkPHIqzqKOghif9lwY1NNje6CbaUFEMFxBmoQ +# tB1VM1izoXBm8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB0jELMAkGA1UEBhMCVVMx +# EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT +# FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxh +# bmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpE +# MDgyLTRCRkQtRUVCQTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2Vy +# dmljZaIjCgEBMAcGBSsOAwIaAxUAdqNHe113gCJ87aZIGa5QBUqIwvKggYMwgYCk +# fjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQD +# Ex1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIF +# AOi0eZswIhgPMjAyMzA5MjAwMzQ4NDNaGA8yMDIzMDkyMTAzNDg0M1owdzA9Bgor +# BgEEAYRZCgQBMS8wLTAKAgUA6LR5mwIBADAKAgEAAgIL+AIB/zAHAgEAAgIULDAK +# AgUA6LXLGwIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIB +# AAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUAA4GBAClyBBu79vwaDEgr +# sDdtLY+7se9ISbk8pveb65oGP9gabWe8mNnqfg1SxEN1eW2I4ihQvT2bQVBGeDi7 +# wVO+vcDBDl/uDAaYT7wKES/l/PJORKyBmUoDGFoLJT7bHa+uqFek2mjsC8RIlpdj +# oVOh5HQksZd5HgNF4K/uv2nUyKuEMYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMC +# VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNV +# BAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgUENBIDIwMTACEzMAAAG6Hz8Z98F1vXwAAQAAAbowDQYJYIZIAWUD +# BAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0B +# CQQxIgQgbjk/IiL8KyUtICVXFblxmt8j6F3g0s6KsH+WJzhAIqAwgfoGCyqGSIb3 +# DQEJEAIvMYHqMIHnMIHkMIG9BCApVb08M25w+tYGWsmlGtp1gy1nPcqWfqgMF3nl +# WYVzBTCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9u +# MRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRp +# b24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB +# uh8/GffBdb18AAEAAAG6MCIEIJ9hCOdmkSHZdWHnjcQBaILiGo+/uNr71agjiWaN +# bF2dMA0GCSqGSIb3DQEBCwUABIICACgD9Dbo/LkUWEGprq7D+RTXofFwwH6qSKeh +# N1y8UNvmYAtF83AuC2amIWELSmnnblZEv1sMvjteyyLsLRuid8la04mjjLUBduUN +# yGhij+4aarTuuVuwf/Ap273AGk1mv3slKF3R7lQnObcO4SEXYYoDeBDY/HI8Pa3g +# 6FkNw18RsDp3Atj0Eun/UZaL+XCNHPJCsLoEK69bz9cxhiEwQfcEhc9kDzKTqjZV +# Yla/8Qh+WoC/0uQz1lEpQvP4vrSVOXw89ZGUicwjRHZ3Oys2IgPu5vrG3BeFZNCO +# q3ieylUYWrOBvIxZQWcHR5tqmwdQDnUHRR6vZNVxqErZ0dLdd824gFoKGUbup0MG +# SdD/k2nffp38SFvsfiDiO6DRwt49LX5ClzxeXt4LFv9GTNq4/9vlInIQoi9BujGg +# 3vJIDEVxEDZzq//guGDkz1ybPLz3/hrSzySBD5YWaVtcqapTPGMxqSOcwjFD9AbY +# 5BYD0o6/0lXAIBQVLCI4elTZToeECLJkkerZA79OU9UJFL6cdrr5s6KENdLQkXIO +# o3M2KywJgUYUVK4v2mSeUzyahW3XW0+i5K03EPAlDi4ONFZZSE5l73er2SziU0go +# a8R5O6oYM6AAPmSBTX/6EpF1vb5fkPfOSI3nBe1TBlovGg3WvWQGn9Ft5B/kSq6F +# MXMUpngZ +# SIG # End signature block diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/FuzzySharp.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/FuzzySharp.dll new file mode 100644 index 000000000000..d25fb236c3e9 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/FuzzySharp.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Hyak.Common.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Hyak.Common.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..8ef5eef2989d Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.Common.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.Common.dll new file mode 100644 index 000000000000..1c9d8e2a0ef5 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll new file mode 100644 index 000000000000..38f5f8542077 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AssemblyLoading.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll new file mode 100644 index 000000000000..77cc1c46f5a7 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll new file mode 100644 index 000000000000..d8429b2b6881 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll new file mode 100644 index 000000000000..1503a5b6d3ac Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll new file mode 100644 index 000000000000..acc0eb23524f Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..1d35ab395d17 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll new file mode 100644 index 000000000000..3ab15df83c30 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Authorization.dll new file mode 100644 index 000000000000..4b6131e2a0f6 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Compute.dll new file mode 100644 index 000000000000..b5c2285f8237 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll new file mode 100644 index 000000000000..afd56a7b9208 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.KeyVault.dll new file mode 100644 index 000000000000..b6838bea7093 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Monitor.dll new file mode 100644 index 000000000000..d28204acd31a Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Network.dll new file mode 100644 index 000000000000..b35c96f4c5cb Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll new file mode 100644 index 000000000000..3a37aeb3a3d5 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll new file mode 100644 index 000000000000..6b3270044fbc Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll new file mode 100644 index 000000000000..eaa53e5a4ac9 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Websites.dll new file mode 100644 index 000000000000..947ac62a5ac0 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll new file mode 100644 index 000000000000..f2f380543ee1 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml new file mode 100644 index 000000000000..07d9948aca17 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml @@ -0,0 +1,13631 @@ + + + + + Add-AzEnvironment + Add + AzEnvironment + + Adds endpoints and metadata for an instance of Azure Resource Manager. + + + + The Add-AzEnvironment cmdlet adds endpoints and metadata to enable Azure Resource Manager cmdlets to connect with a new instance of Azure Resource Manager. The built-in environments AzureCloud and AzureChinaCloud target existing public instances of Azure Resource Manager. + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + AutoDiscover + + Discovers environments via default or configured endpoint. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AutoDiscover + + Discovers environments via default or configured endpoint. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : +VersionProfiles : {} +ExtendedProperties : {} +BatchEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + ------- Example 2: Discovering a new environment via Uri ------- + <# +Uri https://configuredmetadata.net returns an array of environment metadata. The following example contains a payload for the AzureCloud default environment. + +[ + { + "portal": "https://portal.azure.com", + "authentication": { + "loginEndpoint": "https://login.microsoftonline.com/", + "audiences": [ + "https://management.core.windows.net/" + ], + "tenant": "common", + "identityProvider": "AAD" + }, + "media": "https://rest.media.azure.net", + "graphAudience": "https://graph.windows.net/", + "graph": "https://graph.windows.net/", + "name": "AzureCloud", + "suffixes": { + "azureDataLakeStoreFileSystem": "azuredatalakestore.net", + "acrLoginServer": "azurecr.io", + "sqlServerHostname": ".database.windows.net", + "azureDataLakeAnalyticsCatalogAndJob": "azuredatalakeanalytics.net", + "keyVaultDns": "vault.azure.net", + "storage": "core.windows.net", + "azureFrontDoorEndpointSuffix": "azurefd.net" + }, + "batch": "https://batch.core.windows.net/", + "resourceManager": "https://management.azure.com/", + "vmImageAliasDoc": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json", + "activeDirectoryDataLake": "https://datalake.azure.net/", + "sqlManagement": "https://management.core.windows.net:8443/", + "gallery": "https://gallery.azure.com/" + }, +…… +] +#> + +Add-AzEnvironment -AutoDiscover -Uri https://configuredmetadata.net + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + In this example, we are discovering a new Azure environment from the `https://configuredmetadata.net` Uri. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/add-azenvironment + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Clear-AzConfig + Clear + AzConfig + + Clears the values of configs that are set by the user. + + + + Clears the values of configs that are set by the user. By default all the configs will be cleared. You can also specify keys of configs to clear. + + + + Clear-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns true if cmdlet executes correctly. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Clear-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Do not ask for confirmation when clearing all configs. + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns true if cmdlet executes correctly. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Force + + Do not ask for confirmation when clearing all configs. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns true if cmdlet executes correctly. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Clear-AzConfig -Force + + Clear all the configs. `-Force` suppresses the prompt for confirmation. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzConfig -EnableDataCollection + + Clear the "EnableDataCollection" config. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/clear-azconfig + + + + + + Clear-AzContext + Clear + AzContext + + Remove all Azure credentials, account, and subscription information. + + + + Remove all Azure Credentials, account, and subscription information. + + + + Clear-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + --------------- Example 1: Clear global context --------------- + Clear-AzContext -Scope CurrentUser + + Remove all account, subscription, and credential information for any powershell session. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/clear-azcontext + + + + + + Clear-AzDefault + Clear + AzDefault + + Clears the defaults set by the user in the current context. + + + + The Clear-AzDefault cmdlet removes the defaults set by the user depending on the switch parameters specified by the user. + + + + Clear-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Clear-AzDefault + + This command removes all the defaults set by the user in the current context. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzDefault -ResourceGroup + + This command removes the default resource group set by the user in the current context. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/clear-azdefault + + + + + + Connect-AzAccount + Connect + AzAccount + + Connect to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. + + + + The `Connect-AzAccount` cmdlet connects to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. You can use this authenticated account only with Azure Resource Manager requests. To add an authenticated account for use with Service Management, use the `Add-AzureAccount` cmdlet from the Azure PowerShell module. If no context is found for the current user, the user's context list is populated with a context for each of their first 25 subscriptions. The list of contexts created for the user can be found by running `Get-AzContext -ListAvailable`. To skip this context population, specify the SkipContextPopulation switch parameter. After executing this cmdlet, you can disconnect from an Azure account using `Disconnect-AzAccount`. + + + + Connect-AzAccount + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + Identity + + Login using a Managed Service Identity. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + Identity + + Login using a Managed Service Identity. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------------ Example 1: Connect to an Azure account ------------ + Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 2: Connect to Azure using organizational ID credentials + $Credential = Get-Credential +Connect-AzAccount -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 3: Connect to Azure using a service principal account + $SecurePassword = ConvertTo-SecureString -String "Password123!" -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $SecurePassword +Connect-AzAccount -ServicePrincipal -TenantId $TenantId -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxx-xxxx-xxxx-xxxx Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 4: Use an interactive login to connect to a specific tenant and subscription + Connect-AzAccount -Tenant 'xxxx-xxxx-xxxx-xxxx' -SubscriptionId 'yyyy-yyyy-yyyy-yyyy' + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ----- Example 5: Connect using a Managed Service Identity ----- + Connect-AzAccount -Identity +Set-AzContext -Subscription Subscription1 + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +MSI@50342 Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 6: Connect using Managed Service Identity login and ClientId + $identity = Get-AzUserAssignedIdentity -ResourceGroupName 'myResourceGroup' -Name 'myUserAssignedIdentity' +Get-AzVM -ResourceGroupName contoso -Name testvm | Update-AzVM -IdentityType UserAssigned -IdentityId $identity.Id +Connect-AzAccount -Identity -AccountId $identity.ClientId # Run on the virtual machine + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ------------ Example 7: Connect using certificates ------------ + $Thumbprint = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = '00000000-0000-0000-0000-00000000' +Connect-AzAccount -CertificateThumbprint $Thumbprint -ApplicationId $ApplicationId -Tenant $TenantId -ServicePrincipal + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + +Account : xxxxxxxx-xxxx-xxxx-xxxxxxxx +SubscriptionName : MyTestSubscription +SubscriptionId : zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz +TenantId : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy +Environment : AzureCloud + + + + + + + + -------------- Example 8: Connect with AuthScope -------------- + Connect-AzAccount -AuthScope Storage + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ---------- Example 9: Connect using certificate file ---------- + $SecurePassword = ConvertTo-SecureString -String "Password123!" -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +Connect-AzAccount -ServicePrincipal -ApplicationId $ApplicationId -TenantId $TenantId -CertificatePath './certificatefortest.pfx' -CertificatePassword $securePassword + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + --------- Example 10: Connect interactively using WAM --------- + Update-AzConfig -EnableLoginByWam $true +Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/connect-azaccount + + + + + + Disable-AzContextAutosave + Disable + AzContextAutosave + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Disable-AzContextAutosave + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ---------- Example 1: Disable autosaving the context ---------- + Disable-AzContextAutosave + + Disable autosave for the current user. + + + + + + -------------------------- Example 2 -------------------------- + Disable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/disable-azcontextautosave + + + + + + Disable-AzDataCollection + Disable + AzDataCollection + + Opts out of collecting data to improve the Azure PowerShell cmdlets. Data is collected by default unless you explicitly opt out. + + + + The `Disable-AzDataCollection` cmdlet is used to opt out of data collection. Azure PowerShell automatically collects telemetry data by default. To disable data collection, you must explicitly opt-out. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. If you've previously opted out, run the `Enable-AzDataCollection` cmdlet to re-enable data collection for the current user on the current machine. + + + + Disable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -- Example 1: Disabling data collection for the current user -- + Disable-AzDataCollection + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/disable-azdatacollection + + + Enable-AzDataCollection + + + + + + + Disable-AzureRmAlias + Disable + AzureRmAlias + + Disables AzureRm prefix aliases for Az modules. + + + + Disables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases disabled. Otherwise all AzureRm aliases are disabled. + + + + Disable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Disable-AzureRmAlias + + Disables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Disable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Disables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/disable-azurermalias + + + + + + Disconnect-AzAccount + Disconnect + AzAccount + + Disconnects a connected Azure account and removes all credentials and contexts associated with that account. + + + + The Disconnect-AzAccount cmdlet disconnects a connected Azure account and removes all credentials and contexts (subscription and tenant information) associated with that account. After executing this cmdlet, you will need to login again using Connect-AzAccount. + + + + Disconnect-AzAccount + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + + + + + + + ----------- Example 1: Logout of the current account ----------- + Disconnect-AzAccount + + Logs out of the Azure account associated with the current context. + + + + + + Example 2: Logout of the account associated with a particular context + Get-AzContext "Work" | Disconnect-AzAccount -Scope CurrentUser + + Logs out the account associated with the given context (named 'Work'). Because this uses the 'CurrentUser' scope, all credentials and contexts will be permanently deleted. + + + + + + ------------- Example 3: Log out a particular user ------------- + Disconnect-AzAccount -Username 'user1@contoso.org' + + Logs out the 'user1@contoso.org' user - all credentials and all contexts associated with this user will be removed. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/disconnect-azaccount + + + + + + Enable-AzContextAutosave + Enable + AzContextAutosave + + Azure contexts are PowerShell objects representing your active subscription to run commands against, and the authentication information needed to connect to an Azure cloud. With Azure contexts, Azure PowerShell doesn't need to reauthenticate your account each time you switch subscriptions. For more information, see Azure PowerShell context objects (https://learn.microsoft.com/powershell/azure/context-persistence). + This cmdlet allows the Azure context information to be saved and automatically loaded when you start a PowerShell process. For example, when opening a new window. + + + + Allows the Azure context information to be saved and automatically loaded when a PowerShell process starts. The context is saved at the end of the execution of any cmdlet that affects the context. For example, any profile cmdlet. If you're using user authentication, then tokens can be updated during the course of running any cmdlet. + + + + Enable-AzContextAutosave + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + Example 1: Enable autosaving credentials for the current user + Enable-AzContextAutosave + + + + + + + + -------------------------- Example 2 -------------------------- + Enable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/enable-azcontextautosave + + + + + + Enable-AzDataCollection + Enable + AzDataCollection + + Enables Azure PowerShell to collect data to improve the user experience with the Azure PowerShell cmdlets. Executing this cmdlet opts in to data collection for the current user on the current machine. Data is collected by default unless you explicitly opt out. + + + + The `Enable-AzDataCollection` cmdlet is used to opt in to data collection. Azure PowerShell automatically collects telemetry data by default. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. To disable data collection, you must explicitly opt out by executing `Disable-AzDataCollection`. + + + + Enable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + --- Example 1: Enabling data collection for the current user --- + Enable-AzDataCollection + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/enable-azdatacollection + + + Disable-AzDataCollection + + + + + + + Enable-AzureRmAlias + Enable + AzureRmAlias + + Enables AzureRm prefix aliases for Az modules. + + + + Enables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases enabled. Otherwise all AzureRm aliases are enabled. + + + + Enable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + + Local + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Enable-AzureRmAlias + + Enables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Enable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Enables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/enable-azurermalias + + + + + + Export-AzConfig + Export + AzConfig + + Exports all the configs into a file so that it can be imported on another machine. + + + + The `Export-AzConfig` cmdlet exports all the configs that are set at the "CurrentUser" scope into a file at given path in JSON format. The file can then be imported by `Import-AzConfig` for example on another machine. + + + + Export-AzConfig + + Path + + Specifies the path of the file to which to save the configs. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrites the given file if it exists. + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns a boolean value indicating success or failure. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrites the given file if it exists. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Returns a boolean value indicating success or failure. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save the configs. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Export-AzConfig -Path ./config.json + + This example exports the configs to `./config.json` file which can later be imported via `Import-AzConfig`. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/export-azconfig + + + Import-AzConfig + + + + + + + Get-AzAccessToken + Get + AzAccessToken + + Get raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. + + + + Get access token + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + IAzureContextContainer + + IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, AppConfiguration, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + String + + String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + String + + String + + + None + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + IAzureContextContainer + + IAzureContextContainer + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + String + + String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + String + + String + + + None + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + IAzureContextContainer + + IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, AppConfiguration, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + String + + String + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + String + + String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + String + + String + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + + + + + + + + ------- Example 1 Get the access token for ARM endpoint ------- + Get-AzAccessToken + + Get access token of current account for ResourceManager endpoint + + + + + + - Example 2 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceTypeName MSGraph + + Get access token of Microsoft Graph endpoint for current account + + + + + + - Example 3 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceUrl "https://graph.microsoft.com/" + + Get access token of Microsoft Graph endpoint for current account + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azaccesstoken + + + + + + Get-AzConfig + Get + AzConfig + + Gets the configs of Azure PowerShell. + + + + Gets the configs of Azure PowerShell. By default it lists all the configs. You can filter the result using various parameters. + > [!NOTE] > Configs have priorities. Generally speaking, Process scope has higher priority than CurrentUser scope; a config that applies to a certain cmdlet has higher priority than that applies to a module, again higher than Az. > To reduce confusion, the result of `Get-AzConfig` shows those configs that are taking effect. It is a combination of all the configs, but not literally all the configs. However, you could always view them by applying different filter parameters, such as `-Scope`. + + + + Get-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + + + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzConfig + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +EnableDataCollection False Az CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the custom… +DefaultSubscriptionForLogin Az Default Subscription name or GUID. Sets the default context for Azure PowerShell when logging in with… +DisplayBreakingChangeWarning True Az Default Controls if warning messages for breaking changes are displayed or suppressed. When enabled, … + + Gets all the configs. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzConfig -EnableDataCollection + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +EnableDataCollection False Az CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the custom… + + Gets the "EnableDataCollection" config. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azconfig + + + + + + Get-AzContext + Get + AzContext + + Gets the metadata used to authenticate Azure Resource Manager requests. + + + + The Get-AzContext cmdlet gets the current metadata used to authenticate Azure Resource Manager requests. This cmdlet gets the Active Directory account, Active Directory tenant, Azure subscription, and the targeted Azure environment. Azure Resource Manager cmdlets use these settings by default when making Azure Resource Manager requests. When the available amount of subscription exceeds the default limit of 25, some subscriptions may not show up in the results of `Get-AzContext -ListAvailable`. Please run `Connect-AzAccount -MaxContextPopulation <int>` to get more contexts. + + + + Get-AzContext + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + + System.Management.Automation.SwitchParameter + + + False + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + + System.Management.Automation.SwitchParameter + + + False + + + + Get-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + The name of the context + + System.String + + System.String + + + None + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------------ Example 1: Getting the current context ------------ + Connect-AzAccount +Get-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + In this example we are logging into our account with an Azure subscription using Connect-AzAccount, and then we are getting the context of the current session by calling Get-AzContext. + + + + + + ---------- Example 2: Listing all available contexts ---------- + Get-AzContext -ListAvailable + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... +Subscription2 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription2 AzureCloud xxxxxxxx-x... +Subscription3 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription3 AzureCloud xxxxxxxx-x... + + In this example, all currently available contexts are displayed. The user may select one of these contexts using Select-AzContext. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azcontext + + + Set-AzContext + + + + Connect-AzAccount + + + + + + + Get-AzContextAutosaveSetting + Get + AzContextAutosaveSetting + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Get-AzContextAutosaveSetting + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ------ Get context save metadata for the current session ------ + Get-AzContextAutosaveSetting + +Mode : Process +ContextDirectory : None +ContextFile : None +CacheDirectory : None +CacheFile : None +Settings : {} + + Get details about whether and where the context is saved. In the above example, the autosave feature has been disabled. + + + + + + -------- Get context save metadata for the current user -------- + Get-AzContextAutosaveSetting -Scope CurrentUser + +Mode : CurrentUser +ContextDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +ContextFile : AzureRmContext.json +CacheDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +CacheFile : TokenCache.dat +Settings : {} + + Get details about whether and where the context is saved by default for the current user. Note that this may be different than the settings that are active in the current session. In the above example, the autosave feature has been enabled, and data is saved to the default location. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azcontextautosavesetting + + + + + + Get-AzDefault + Get + AzDefault + + Get the defaults set by the user in the current context. + + + + The Get-AzDefault cmdlet gets the Resource Group that the user has set as default in the current context. + + + + Get-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzDefault + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current defaults if there are defaults set, or returns nothing if no default is set. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzDefault -ResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current default Resource Group if there is a default set, or returns nothing if no default is set. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azdefault + + + + + + Get-AzEnvironment + Get + AzEnvironment + + Get endpoints and metadata for an instance of Azure services. `GalleryUrl` will be removed from ArmMetadata and so Azure PowerShell will no longer provide for its value in `PSAzureEnvironment`. Currently `GalleryUrl` is not used in Azure PowerShell products. Please do not reply on `GalleryUrl` anymore. + + + + The Get-AzEnvironment cmdlet gets endpoints and metadata for an instance of Azure services. + + + + Get-AzEnvironment + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ---------- Example 1: Getting all Azure environments ---------- + Get-AzEnvironment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in +AzureChinaCloud https://management.chinacloudapi.cn/ https://login.chinacloudapi.cn/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + -------- Example 2: Getting the AzureCloud environment -------- + Get-AzEnvironment -Name AzureCloud + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + ------ Example 3: Getting the AzureChinaCloud environment ------ + Get-AzEnvironment -Name AzureChinaCloud | Format-List + +Name : AzureChinaCloud +Type : Built-in +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : https://management.core.chinacloudapi.cn/ +AdTenant : Common +GalleryUrl : https://gallery.azure.com/ +ManagementPortalUrl : https://go.microsoft.com/fwlink/?LinkId=301902 +ServiceManagementUrl : https://management.core.chinacloudapi.cn/ +PublishSettingsFileUrl : https://go.microsoft.com/fwlink/?LinkID=301776 +ResourceManagerUrl : https://management.chinacloudapi.cn/ +SqlDatabaseDnsSuffix : .database.chinacloudapi.cn +StorageEndpointSuffix : core.chinacloudapi.cn +ActiveDirectoryAuthority : https://login.chinacloudapi.cn/ +GraphUrl : https://graph.chinacloudapi.cn/ +GraphEndpointResourceId : https://graph.chinacloudapi.cn/ +TrafficManagerDnsSuffix : trafficmanager.cn +AzureKeyVaultDnsSuffix : vault.azure.cn +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : https://vault.azure.cn +ContainerRegistryEndpointSuffix : azurecr.cn +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : asazure.chinacloudapi.cn +AnalysisServicesEndpointResourceId : https://region.asazure.chinacloudapi.cn +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : dev.azuresynapse.azure.cn +AzureSynapseAnalyticsEndpointResourceId : https://dev.azuresynapse.azure.cn + + This example shows how to get the endpoints and metadata for the AzureChinaCloud environment. + + + + + + ----- Example 4: Getting the AzureUSGovernment environment ----- + Get-AzEnvironment -Name AzureUSGovernment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in + + This example shows how to get the endpoints and metadata for the AzureUSGovernment environment. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azenvironment + + + Add-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Get-AzSubscription + Get + AzSubscription + + Get subscriptions that the current account can access. + + + + The Get-AzSubscription cmdlet gets the subscription ID, subscription name, and home tenant for subscriptions that the current account can access. + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + + + + + ------- Example 1: Get all subscriptions in all tenants ------- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled +Subscription3 zzzz-zzzz-zzzz-zzzz bbbb-bbbb-bbbb-bbbb Enabled + + This command gets all subscriptions in all tenants that are authorized for the current account. + + + + + + ---- Example 2: Get all subscriptions for a specific tenant ---- + Get-AzSubscription -TenantId "aaaa-aaaa-aaaa-aaaa" + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + List all subscriptions in the given tenant that are authorized for the current account. + + + + + + ---- Example 3: Get all subscriptions in the current tenant ---- + Get-AzSubscription -TenantId (Get-AzContext).Tenant + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + This command gets all subscriptions in the current tenant that are authorized for the current user. + + + + + + Example 4: Change the current context to use a specific subscription + Get-AzSubscription -SubscriptionId "xxxx-xxxx-xxxx-xxxx" -TenantId "yyyy-yyyy-yyyy-yyyy" | Set-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxx-xxxx-xxxx-xxxx) azureuser@micros... Subscription1 AzureCloud yyyy-yyyy-yyyy-yyyy + + This command gets the specified subscription, and then sets the current context to use it. All subsequent cmdlets in this session use the new subscription (Contoso Subscription 1) by default. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-azsubscription + + + + + + Get-AzTenant + Get + AzTenant + + Gets tenants that are authorized for the current user. + + + + The Get-AzTenant cmdlet gets tenants authorized for the current user. + + + + Get-AzTenant + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + + + + + + + ---------------- Example 1: Getting all tenants ---------------- + Connect-AzAccount +Get-AzTenant + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} +yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Testhost Home testhost.onmicrosoft.com + + This example shows how to get all of the authorized tenants of an Azure account. + + + + + + ------------- Example 2: Getting a specific tenant ------------- + Connect-AzAccount +Get-AzTenant -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} + + This example shows how to get a specific authorized tenant of an Azure account. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/get-aztenant + + + + + + Import-AzConfig + Import + AzConfig + + Imports configs from a file that was previously exported by `Export-AzConfig`. + + + + The `Import-AzConfig` cmdlet imports all the configs from a file that was previously exported by `Export-AzConfig`. The imported configs will be set at the "CurrentUser" scope, so they are consistent across PowerShell sessions. + During importing, if a config that is to be imported has already been set, its value will be overwritten. + + + + Import-AzConfig + + Path + + Specifies the path to configuration saved by using Export-AzConfig. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Returns a boolean value indicating success or failure. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Returns a boolean value indicating success or failure. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path to configuration saved by using Export-AzConfig. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Import-AzConfig -Path ./config.json + + This example imports configs from file `./config.json`. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/import-azconfig + + + Export-AzConfig + + + + + + + Import-AzContext + Import + AzContext + + Loads Azure authentication information from a file. + + + + The Import-AzContext cmdlet loads authentication information from a file to set the Azure environment and context. Cmdlets that you run in the current session use this information to authenticate requests to Azure Resource Manager. + + + + Import-AzContext + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Import-AzContext + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ----- Example 1: Importing a context from a AzureRmProfile ----- + Import-AzContext -AzContext (Connect-AzAccount) + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example imports a context from a PSAzureProfile that is passed through to the cmdlet. + + + + + + ------- Example 2: Importing a context from a JSON file ------- + Import-AzContext -Path C:\test.json + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example selects a context from a JSON file that is passed through to the cmdlet. This JSON file can be created from Save-AzContext. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/import-azcontext + + + + + + Invoke-AzRestMethod + Invoke + AzRestMethod + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Invoke-AzRestMethod + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.string + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSHttpResponse + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Invoke-AzRestMethod -Path "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}?api-version={API}" -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [x-ms-request-id, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : { + "properties": { + "source": "Azure", + "customerId": "{customerId}", + "provisioningState": "Succeeded", + "sku": { + "name": "pergb2018", + "maxCapacityReservationLevel": 3000, + "lastSkuUpdate": "Mon, 25 May 2020 11:10:01 GMT" + }, + "retentionInDays": 30, + "features": { + "legacy": 0, + "searchVersion": 1, + "enableLogAccessUsingOnlyResourcePermissions": true + }, + "workspaceCapping": { + "dailyQuotaGb": -1.0, + "quotaNextResetTime": "Thu, 18 Jun 2020 05:00:00 GMT", + "dataIngestionStatus": "RespectQuota" + }, + "enableFailover": false, + "publicNetworkAccessForIngestion": "Enabled", + "publicNetworkAccessForQuery": "Enabled", + "createdDate": "Mon, 25 May 2020 11:10:01 GMT", + "modifiedDate": "Mon, 25 May 2020 11:10:02 GMT" + }, + "id": "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}", + "name": "{workspace}", + "type": "Microsoft.OperationalInsights/workspaces", + "location": "eastasia", + "tags": {} + } + + Get log analytics workspace by path. It only supports management plane API and Hostname of Azure Resource Manager is added according to Azure environment setting. + + + + + + + -------------------------- Example 2 -------------------------- + Invoke-AzRestMethod https://graph.microsoft.com/v1.0/me + +Headers : {[Date, System.String[]], [Cache-Control, System.String[]], [Transfer-Encoding, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":["......} + + Get current signed in user via MicrosoftGraph API. This example is equivalent to `Get-AzADUser -SignedIn`. + + + + + + -------------------------- Example 3 -------------------------- + $subscriptionId = (Get-AzContext).Subscription.ID +Invoke-AzRestMethod -SubscriptionId $subscriptionId -ResourceGroupName "test-group" -ResourceProviderName Microsoft.AppPlatform -ResourceType Spring,apps -Name "test-spring-service" -ApiVersion 2020-07-01 -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [Vary, System.String[]], [x-ms-request-id, + System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"value":[{"properties":{"public":true,"url":"https://test-spring-service-demo.azuremicroservices.io","provisioni + ngState":"Succeeded","activeDeploymentName":"default","fqdn":"test-spring-service.azuremicroservices.io","httpsOn + ly":false,"createdTime":"2022-06-22T02:57:13.272Z","temporaryDisk":{"sizeInGB":5,"mountPath":"/tmp"},"pers + istentDisk":{"sizeInGB":0,"mountPath":"/persistent"}},"type":"Microsoft.AppPlatform/Spring/apps","identity + ":null,"location":"eastus","id":"/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.AppPlatform/Spring/test-spring-service/apps/demo","name":"demo"},{"properties":{"publ + ic":false,"provisioningState":"Succeeded","activeDeploymentName":"deploy01","fqdn":"test-spring-service.azuremicr + oservices.io","httpsOnly":false,"createdTime":"2022-06-22T07:46:54.9Z","temporaryDisk":{"sizeInGB":5,"moun + tPath":"/tmp"},"persistentDisk":{"sizeInGB":0,"mountPath":"/persistent"}},"type":"Microsoft.AppPlatform/Sp + ring/apps","identity":null,"location":"eastus","id":"/subscriptions/$subscriptionId/r + esourceGroups/test-group/providers/Microsoft.AppPlatform/Spring/test-spring-service/apps/pwsh01","name":"pwsh0 + 1"}]} + + List apps under spring service "test-spring-service" + + + + + + -------------------------- Example 4 -------------------------- + $subscriptionId = (Get-AzContext).Subscription.ID +Invoke-AzRestMethod -SubscriptionId $subscriptionId -ResourceGroupName "test-group" -ResourceProviderName Microsoft.AppPlatform -ResourceType Spring -Name "test-spring-service","demo" -ApiVersion 2020-07-01 -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [Vary, System.String[]], [x-ms-request-id, + System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"properties":{"public":true,"url":"https://test-spring-service-demo.azuremicroservices.io","provisioningState":" + Succeeded","activeDeploymentName":"default","fqdn":"test-spring-service.azuremicroservices.io","httpsOnly":false, + "createdTime":"2022-06-22T02:57:13.272Z","temporaryDisk":{"sizeInGB":5,"mountPath":"/tmp"},"persistentDisk + ":{"sizeInGB":0,"mountPath":"/persistent"}},"type":"Microsoft.AppPlatform/Spring/apps","identity":null,"lo + cation":"eastus","id":"/subscriptions/$subscriptionId/resourceGroups/test-group/pr + oviders/Microsoft.AppPlatform/Spring/test-spring-service/apps/demo","name":"demo"} + + Get app "demo" under Spring cloud service "test-spring-service" + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/invoke-azrestmethod + + + + + + Open-AzSurveyLink + Open + AzSurveyLink + + Open survey link in default browser. + + + + Open survey link in default browser. + + + + Open-AzSurveyLink + + + + + + + None + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Open-AzSurveyLink + +Opening the default browser to https://aka.ms/azpssurvey?Q_CHL=INTERCEPT + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/open-azsurveylink + + + + + + Register-AzModule + Register + AzModule + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + Register-AzModule + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Register-AzModule + + Used Internally by AutoRest-generated cmdlets + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/register-azmodule + + + + + + Remove-AzContext + Remove + AzContext + + Remove a context from the set of available contexts + + + + Remove an azure context from the set of contexts + + + + Remove-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Remove-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + PassThru + + Return the removed context + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AzContext -Name Default + + Remove the context named default + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/remove-azcontext + + + + + + Remove-AzEnvironment + Remove + AzEnvironment + + Removes endpoints and metadata for connecting to a given Azure instance. + + + + The Remove-AzEnvironment cmdlet removes endpoints and metadata information for connecting to a given Azure instance. + + + + Remove-AzEnvironment + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and removing a test environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Remove-AzEnvironment -Name TestEnvironment + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + This example shows how to create an environment using Add-AzEnvironment, and then how to delete the environment using Remove-AzEnvironment. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/remove-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Rename-AzContext + Rename + AzContext + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename-AzContext + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Rename-AzContext + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------ Example 1: Rename a context using named parameters ------ + Rename-AzContext -SourceName "[user1@contoso.org; 12345-6789-2345-3567890]" -TargetName "Work" + + Rename the context for 'user1@contoso.org' with subscription '12345-6789-2345-3567890' to 'Work'. After this command, you will be able to target the context using 'Select-AzContext Work'. Note that you can tab through the values for 'SourceName' using tab completion. + + + + + + --- Example 2: Rename a context using positional parameters --- + Rename-AzContext "My context" "Work" + + Rename the context named "My context" to "Work". After this command, you will be able to target the context using Select-AzContext Work + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/rename-azcontext + + + + + + Resolve-AzError + Resolve + AzError + + Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors. + + + + Resolves and displays detailed information about errors in the current PowerShell session, including where the error occurred in script, stack trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides additional detail in debugging service issues, including complete detail about the request and server response that caused the error. + + + + Resolve-AzError + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + Resolve-AzError + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Last + + Resolve only the last error that occurred in the session. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + Last + + Resolve only the last error that occurred in the session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.ErrorRecord[] + + + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + + + + + + + + + -------------- Example 1: Resolve the Last Error -------------- + Resolve-AzError -Last + +HistoryId: 3 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in AzureRmCmdlet.cs:line 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() inAzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 3 + + Get details of the last error. + + + + + + --------- Example 2: Resolve all Errors in the Session --------- + Resolve-AzError + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + + HistoryId: 5 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in C:\zd\azur + e-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in + C:\zd\azure-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:lin + e 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in C:\zd\azure-p + owershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in C:\zd\azure- + powershell\src\ResourceManager\Profile\Commands.Profile\Subscription\GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 5 + + Get details of all errors that have occurred in the current session. + + + + + + ------------- Example 3: Resolve a Specific Error ------------- + Resolve-AzError $Error[0] + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + Get details of the specified error. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/resolve-azerror + + + + + + Save-AzContext + Save + AzContext + + Saves the current authentication information for use in other PowerShell sessions. + + + + The Save-AzContext cmdlet saves the current authentication information for use in other PowerShell sessions. + + + + Save-AzContext + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------- Example 1: Saving the current session's context ------- + Connect-AzAccount +Save-AzContext -Path C:\test.json + + This example saves the current session's Azure context to the JSON file provided. + + + + + + -------------- Example 2: Saving a given context -------------- + Save-AzContext -Profile (Connect-AzAccount) -Path C:\test.json + + This example saves the Azure context that is passed through to the cmdlet to the JSON file provided. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/save-azcontext + + + + + + Select-AzContext + Select + AzContext + + Select a subscription and account to target in Azure PowerShell cmdlets + + + + Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the selected context. + + + + Select-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Select-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------- Example 1: Target a named context -------------- + Select-AzContext "Work" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context. + + + + + + -------------------------- Example 2 -------------------------- + Select-AzContext -Name TestEnvironment -Scope Process + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/select-azcontext + + + + + + Send-Feedback + Send + Feedback + + Sends feedback to the Azure PowerShell team via a set of guided prompts. + + + + The Send-Feedback cmdlet sends feedback to the Azure PowerShell team. + + + + Send-Feedback + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -------------------------- Example 1: -------------------------- + Send-Feedback + +With zero (0) being the least and ten (10) being the most, how likely are you to recommend Azure PowerShell to a friend or colleague? + +10 + +What does Azure PowerShell do well? + +Response. + +Upon what could Azure PowerShell improve? + +Response. + +Please enter your email if you are interested in providing follow up information: + +your@email.com + + + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/send-feedback + + + + + + Set-AzContext + Set + AzContext + + Sets the tenant, subscription, and environment for cmdlets to use in the current session. + + + + The Set-AzContext cmdlet sets authentication information for cmdlets that you run in the current session. The context includes tenant, subscription, and environment information. + + + + Set-AzContext + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ----------- Example 1: Set the subscription context ----------- + Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + This command sets the context to use the specified subscription. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/set-azcontext + + + Get-AzContext + + + + + + + Set-AzDefault + Set + AzDefault + + Sets a default in the current context + + + + The Set-AzDefault cmdlet adds or changes the defaults in the current context. + + + + Set-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Set-AzDefault -ResourceGroupName myResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command sets the default resource group to the resource group specified by the user. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/set-azdefault + + + + + + Set-AzEnvironment + Set + AzEnvironment + + Sets properties for an Azure environment. + + + + The Set-AzEnvironment cmdlet sets endpoints and metadata for connecting to an instance of Azure. + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. The parameter is to set the value to `GalleryUrl` of `PSAzureEnvironment`. As `GalleryUrl` is removed from ArmMetadata, Azure PowerShell will no longer provide for the value and so it is not recommended to set `GalleryEndpoint` anymore. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +BatchEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureOperationalInsightsEndpointResourceId : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/set-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + + + + Uninstall-AzureRm + Uninstall + AzureRm + + Removes all AzureRm modules from a machine. + + + + Removes all AzureRm modules from a machine. + + + + Uninstall-AzureRm + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Uninstall-AzureRm + + Running this command will remove all AzureRm modules from the machine for the version of PowerShell in which the cmdlet is run. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/uninstall-azurerm + + + + + + Update-AzConfig + Update + AzConfig + + Updates the configs of Azure PowerShell. + + + + Updates the configs of Azure PowerShell. Depending on which config to update, you may specify the scope where the config is persisted and to which module or cmdlet it applies to. + > [!NOTE] > It is discouraged to update configs in multiple PowerShell processes. Either do it in one process, or make sure the updates are at Process scope (`-Scope Process`) to avoid unexpected side-effects. + + + + Update-AzConfig + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Boolean + + System.Boolean + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.String + + System.String + + + None + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Boolean + + System.Boolean + + + None + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Boolean + + System.Boolean + + + None + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Boolean + + System.Boolean + + + None + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Boolean + + System.Boolean + + + None + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Boolean + + System.Boolean + + + None + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Boolean + + System.Boolean + + + None + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + + CurrentUser + Process + Default + Environment + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AppliesTo + + Specifies what part of Azure PowerShell the config applies to. Possible values are: - "Az": the config applies to all modules and cmdlets of Azure PowerShell. + - Module name: the config applies to a certain module of Azure PowerShell. + For example, "Az.Storage". - Cmdlet name: the config applies to a certain cmdlet of Azure PowerShell. For example, "Get-AzKeyVault". If not specified, when getting or clearing configs, it defaults to all the above; when updating, it defaults to "Az". + + System.String + + System.String + + + None + + + CheckForUpgrade + + When enabled, Azure PowerShell will check for updates automatically and display a hint message when an update is available. The default value will be changed from false to true in Az version 11.0.0. + + System.Boolean + + System.Boolean + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + DefaultSubscriptionForLogin + + Subscription name or GUID. Sets the default context for Azure PowerShell when logging in without specifying a subscription. + + System.String + + System.String + + + None + + + DisableErrorRecordsPersistence + + When disabled, error records will not be written to ~/.Azure/ErrorRecords. This config will be replaced by "EnableErrorRecordsPersistence" as opt-in in the next major release of Az around November 2023. + + System.Boolean + + System.Boolean + + + None + + + DisplayBreakingChangeWarning + + Controls if warning messages for breaking changes are displayed or suppressed. When enabled, a breaking change warning is displayed when executing cmdlets with breaking changes in a future release. + + System.Boolean + + System.Boolean + + + None + + + DisplayRegionIdentified + + When enabled, Azure PowerShell displays recommendations on regions which may reduce your costs. + + System.Boolean + + System.Boolean + + + None + + + DisplaySurveyMessage + + When enabled, you are prompted infrequently to participate in user experience surveys for Azure PowerShell. + + System.Boolean + + System.Boolean + + + None + + + EnableDataCollection + + When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experience. For more information, see our privacy statement: https://aka.ms/privacy + + System.Boolean + + System.Boolean + + + None + + + EnableLoginByWam + + [Preview] When enabled, Web Account Manager (WAM) will be the default interactive login experience. It will fall back to using the browser if the platform does not support WAM. Note that this feature is under preview. Microsoft Account (MSA) is currently not supported. Feel free to reach out to Azure PowerShell team if you have any feedbacks: https://aka.ms/azpsissue + + System.Boolean + + System.Boolean + + + None + + + Scope + + Determines the scope of config changes, for example, whether changes apply only to the current process, or to all sessions started by this user. By default it is CurrentUser. + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + Microsoft.Azure.PowerShell.Common.Config.ConfigScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Boolean + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSConfig + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Update-AzConfig -DefaultSubscriptionForLogin "Name of subscription" + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +DefaultSubscriptionForLogin Name of subscription Az CurrentUser Subscription name or GUID. Sets the default context for Azure PowerShell when lo… + + Sets the "DefaultSubscriptionForLogin" config as "Name of subscription". When `Connect-AzAccount` the specified subscription will be selected as the default subscription. + + + + + + -------------------------- Example 2 -------------------------- + Update-AzConfig -DisplayBreakingChangeWarning $false -AppliesTo "Az.KeyVault" + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +DisplayBreakingChangeWarning False Az.KeyVault CurrentUser Controls if warning messages for breaking changes are displayed or suppressed. When enabled,… + + Sets the "DisplayBreakingChangeWarnings" config as "$false" for "Az.KeyVault" module. This prevents all the warning messages for upcoming breaking changes in Az.KeyVault module from prompting. + + + + + + -------------------------- Example 3 -------------------------- + Update-AzConfig -EnableDataCollection $true + +Key Value Applies To Scope Help Message +--- ----- ---------- ----- ------------ +EnableDataCollection True Az CurrentUser When enabled, Azure PowerShell cmdlets send telemetry data to Microsoft to improve the customer experi… + + Sets the "EnableDataCollection" config as "$true". This enables sending the telemetry data. Setting this config is equivalent to `Enable-AzDataCollection` and `Disable-AzDataCollection`. + + + + + + + + Online Version: + https://learn.microsoft.com/powershell/module/az.accounts/update-azconfig + + + + \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll new file mode 100644 index 000000000000..3d53eaa669dc Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll new file mode 100644 index 000000000000..2443eb5dd56a Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Storage.dll new file mode 100644 index 000000000000..a163f556b3f8 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Strategies.dll new file mode 100644 index 000000000000..0ccbb5ead102 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.Azure.dll new file mode 100644 index 000000000000..1d99c7015912 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll new file mode 100644 index 000000000000..a4fca7488baf Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 000000000000..6ac672abd486 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 000000000000..70c5ed6806c6 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..1a6de8a08d69 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/PostImportScripts/LoadAuthenticators.ps1 @@ -0,0 +1,222 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } catch {} +} +# SIG # Begin signature block +# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBn8ROze2QLH/c6 +# GtPhR/BPLgOtmjkNhcq+fFmu16VcrqCCDYUwggYDMIID66ADAgECAhMzAAADTU6R +# phoosHiPAAAAAANNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI4WhcNMjQwMzE0MTg0MzI4WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDUKPcKGVa6cboGQU03ONbUKyl4WpH6Q2Xo9cP3RhXTOa6C6THltd2RfnjlUQG+ +# Mwoy93iGmGKEMF/jyO2XdiwMP427j90C/PMY/d5vY31sx+udtbif7GCJ7jJ1vLzd +# j28zV4r0FGG6yEv+tUNelTIsFmmSb0FUiJtU4r5sfCThvg8dI/F9Hh6xMZoVti+k +# bVla+hlG8bf4s00VTw4uAZhjGTFCYFRytKJ3/mteg2qnwvHDOgV7QSdV5dWdd0+x +# zcuG0qgd3oCCAjH8ZmjmowkHUe4dUmbcZfXsgWlOfc6DG7JS+DeJak1DvabamYqH +# g1AUeZ0+skpkwrKwXTFwBRltAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUId2Img2Sp05U6XI04jli2KohL+8w +# VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMDUxNzAfBgNVHSMEGDAW +# gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw +# MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx +# XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +# ACMET8WuzLrDwexuTUZe9v2xrW8WGUPRQVmyJ1b/BzKYBZ5aU4Qvh5LzZe9jOExD +# YUlKb/Y73lqIIfUcEO/6W3b+7t1P9m9M1xPrZv5cfnSCguooPDq4rQe/iCdNDwHT +# 6XYW6yetxTJMOo4tUDbSS0YiZr7Mab2wkjgNFa0jRFheS9daTS1oJ/z5bNlGinxq +# 2v8azSP/GcH/t8eTrHQfcax3WbPELoGHIbryrSUaOCphsnCNUqUN5FbEMlat5MuY +# 94rGMJnq1IEd6S8ngK6C8E9SWpGEO3NDa0NlAViorpGfI0NYIbdynyOB846aWAjN +# fgThIcdzdWFvAl/6ktWXLETn8u/lYQyWGmul3yz+w06puIPD9p4KPiWBkCesKDHv +# XLrT3BbLZ8dKqSOV8DtzLFAfc9qAsNiG8EoathluJBsbyFbpebadKlErFidAX8KE +# usk8htHqiSkNxydamL/tKfx3V/vDAoQE59ysv4r3pE+zdyfMairvkFNNw7cPn1kH +# Gcww9dFSY2QwAxhMzmoM0G+M+YvBnBu5wjfxNrMRilRbxM6Cj9hKFh0YTwba6M7z +# ntHHpX3d+nabjFm/TnMRROOgIXJzYbzKKaO2g1kWeyG2QtvIR147zlrbQD4X10Ab +# rRg9CpwW7xYxywezj+iNAc+QmFzR94dzJkEPUSCJPsTFMIIHejCCBWKgAwIBAgIK +# YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm +# aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw +# OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD +# VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG +# 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la +# UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc +# 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D +# dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ +# lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk +# kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 +# A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd +# X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL +# 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd +# sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 +# T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS +# 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI +# bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL +# BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD +# uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv +# c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF +# BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h +# cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA +# YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn +# 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 +# v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b +# pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ +# KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy +# CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp +# mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi +# hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb +# BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS +# oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL +# gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX +# cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGg0wghoJAgEBMIGVMH4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p +# Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAANNTpGmGiiweI8AAAAA +# A00wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw +# HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIC8M +# Xy0xGn+XGeN5xhSUhsVdQGTLtuHOS5+U3UgQ1k53MEIGCisGAQQBgjcCAQwxNDAy +# oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20wDQYJKoZIhvcNAQEBBQAEggEAf/y9IwVq9QTOrbQE7i6AVISmUE6gxgH9PaqX +# D6xL8+9cpj9Y6/kfZ6Zw1Z04+XY4c5dhmIJuWcRjx+i5yXFmp0fyaDfNpalcQlJv +# 1yplKVfyAsVpod7RIH4YvrwP2c/gvYSLRF9k1a/QyIT4yTfPFGaR42tZ0MAyWHhz +# t5ZdXN3dPJt865YoEzv7pPZN29w4mjfr78s6XxeYYARLHPdw/rChVioeia9TyNl9 +# QCKfm9Kar9oDLel2pMgRuonn40KhF85e93XvVLO1PMGXzljlkGWY7PmHuXiOJeyS +# xOe/+p56sTLtL2yIjl/8SDLVGi7LJ7Y93hQGv9yd8U9Tio/mVqGCF5cwgheTBgor +# BgEEAYI3AwMBMYIXgzCCF38GCSqGSIb3DQEHAqCCF3AwghdsAgEDMQ8wDQYJYIZI +# AWUDBAIBBQAwggFSBgsqhkiG9w0BCRABBKCCAUEEggE9MIIBOQIBAQYKKwYBBAGE +# WQoDATAxMA0GCWCGSAFlAwQCAQUABCAkPO6Va7JVENY1DGO3Rgl+LBuXva2N4CJh +# CxPTspOx1QIGZQP2LMVBGBMyMDIzMDkyMDA1NTA0NC41MDZaMASAAgH0oIHRpIHO +# MIHLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQL +# ExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxk +# IFRTUyBFU046OEQwMC0wNUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFNlcnZpY2WgghHtMIIHIDCCBQigAwIBAgITMwAAAc1VByrnysGZHQAB +# AAABzTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz +# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv +# cnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAx +# MDAeFw0yMzA1MjUxOTEyMDVaFw0yNDAyMDExOTEyMDVaMIHLMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1l +# cmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046OEQwMC0w +# NUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2Uw +# ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDTOCLVS2jmEWOqxzygW7s6 +# YLmm29pjvA+Ch6VL7HlTL8yUt3Z0KIzTa2O/Hvr/aJza1qEVklq7NPiOrpBAIz65 +# 7LVxwEc4BxJiv6B68a8DQiF6WAFFNaK3WHi7TfxRnqLohgNz7vZPylZQX795r8MQ +# vX56uwjj/R4hXnR7Na4Llu4mWsml/wp6VJqCuxZnu9jX4qaUxngcrfFT7+zvlXCl +# wLah2n0eGKna1dOjOgyK00jYq5vtzr5NZ+qVxqaw9DmEsj9vfqYkfQZry2JO5wmg +# XX79Ox7PLMUfqT4+8w5JkdSMoX32b1D6cDKWRUv5qjiYh4o/a9ehE/KAkUWlSPbb +# DR/aGnPJLAGPy2qA97YCBeeIJjRKURgdPlhE5O46kOju8nYJnIvxbuC2Qp2jxwc6 +# rD9M6Pvc8sZIcQ10YKZVYKs94YPSlkhwXwttbRY+jZnQiDm2ZFjH8SPe1I6ERcfe +# YX1zCYjEzdwWcm+fFZmlJA9HQW7ZJAmOECONtfK28EREEE5yzq+T3QMVPhiEfEhg +# cYsh0DeoWiYGsDiKEuS+FElMMyT456+U2ZRa2hbRQ97QcbvaAd6OVQLp3TQqNEu0 +# es5Zq0wg2CADf+QKQR/Y6+fGgk9qJNJW3Mu771KthuPlNfKss0B1zh0xa1yN4qC3 +# zoE9Uq6T8r7G3/OtSFms4wIDAQABo4IBSTCCAUUwHQYDVR0OBBYEFKGT+aY2aZrB +# AJVIZh5kicokfNWaMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8G +# A1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMv +# Y3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBs +# BggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0 +# LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy +# MDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUH +# AwgwDgYDVR0PAQH/BAQDAgeAMA0GCSqGSIb3DQEBCwUAA4ICAQBSqG3ppKIU+i/E +# MwwtotoxnKfw0SX/3T16EPbjwsAImWOZ5nLAbatopl8zFY841gb5eiL1j81h4DiE +# iXt+BJgHIA2LIhKhSscd79oMbr631DiEqf9X5LZR3V3KIYstU3K7f5Dk7tbobuHu +# +6fYM/gOx44sgRU7YQ+YTYHvv8k4mMnuiahJRlU/F2vavcHU5uhXi078K4nSRAPn +# WyX7gVi6iVMBBUF4823oPFznEcHup7VNGRtGe1xvnlMd1CuyxctM8d/oqyTsxwlJ +# AM5F/lDxnEWoSzAkad1nWvkaAeMV7+39IpXhuf9G3xbffKiyBnj3cQeiA4SxSwCd +# nx00RBlXS6r9tGDa/o9RS01FOABzKkP5CBDpm4wpKdIU74KtBH2sE5QYYn7liYWZ +# r2f/U+ghTmdOEOPkXEcX81H4dRJU28Tj/gUZdwL81xah8Kn+cB7vM/Hs3/J8tF13 +# ZPP+8NtX3vu4NrchHDJYgjOi+1JuSf+4jpF/pEEPXp9AusizmSmkBK4iVT7NwVtR +# nS1ts8qAGHGPg2HPa4b2u9meueUoqNVtMhbumI1y+d9ZkThNXBXz2aItT2C99DM3 +# T3qYqAUmvKUryVSpMLVpse4je5WN6VVlCDFKWFRH202YxEVWsZ5baN9CaqCbCS0E +# a7s9OFLaEM5fNn9m5s69lD/ekcW2qTCCB3EwggVZoAMCAQICEzMAAAAVxedrngKb +# SZkAAAAAABUwDQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmlj +# YXRlIEF1dGhvcml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIy +# NVowfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXI +# yjVX9gF/bErg4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjo +# YH1qUoNEt6aORmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1y +# aa8dq6z2Nr41JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v +# 3byNpOORj7I5LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pG +# ve2krnopN6zL64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viS +# kR4dPf0gz3N9QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYr +# bqgSUei/BQOj0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlM +# jgK8QmguEOqEUUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSL +# W6CmgyFdXzB0kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AF +# emzFER1y7435UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIu +# rQIDAQABo4IB3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIE +# FgQUKqdS/mTEmr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMFwGA1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEW +# M2h0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5 +# Lmh0bTATBgNVHSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBi +# AEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV +# 9lbLj+iiXGJo0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3Js +# Lm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAx +# MC0wNi0yMy5jcmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2 +# LTIzLmNydDANBgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv +# 6lwUtj5OR2R4sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZn +# OlNN3Zi6th542DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1 +# bSNU5HhTdSRXud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4 +# rPf5KYnDvBewVIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU +# 6ZGyqVvfSaN0DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDF +# NLB62FD+CljdQDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/ +# HltEAY5aGZFrDZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdU +# CbFpAUR+fKFhbHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKi +# excdFYmNcP7ntdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTm +# dHRbatGePu1+oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZq +# ELQdVTNYs6FwZvKhggNQMIICOAIBATCB+aGB0aSBzjCByzELMAkGA1UEBhMCVVMx +# EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT +# FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJp +# Y2EgT3BlcmF0aW9uczEnMCUGA1UECxMeblNoaWVsZCBUU1MgRVNOOjhEMDAtMDVF +# MC1EOTQ3MSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMK +# AQEwBwYFKw4DAhoDFQBoqfem2KKzuRZjISYifGolVOdyBKCBgzCBgKR+MHwxCzAJ +# BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25k +# MR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jv +# c29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwMA0GCSqGSIb3DQEBCwUAAgUA6LRjDzAi +# GA8yMDIzMDkxOTE4MTIzMVoYDzIwMjMwOTIwMTgxMjMxWjB3MD0GCisGAQQBhFkK +# BAExLzAtMAoCBQDotGMPAgEAMAoCAQACAhpaAgH/MAcCAQACAhNWMAoCBQDotbSP +# AgEAMDYGCisGAQQBhFkKBAIxKDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSCh +# CjAIAgEAAgMBhqAwDQYJKoZIhvcNAQELBQADggEBALTbRIUnATvJxQER3PTF/m7f +# ea2mmC38vdy89JNDWbAETiN+HOhqZRgyGz1otnOANH++7NjRRSrh8byXARE8w1dN +# AVpbbjDea3JZt2zTkA6uRN/vjuifXHSz470WR6P8Mm3KhMtOK4AYLam5Xe1bnjAv +# JU02cI0r1MUOqkWJa/2Il+9Dm1raxizVGFUvgSLHDgxpFgfins0MBOg4RQTpRDIP +# arFUPTmbFhZfTBa2DAiHGcy9hPO1pNUY3FKdAMYkRxt9CAodlmkueGu6oiSxRd3M +# TPqGHQx9pJzJuE6yM0SZO/J0O5PnHIRc7RMdy0XikWk8D3SmDYFQOOxk7noeloYx +# ggQNMIIECQIBATCBkzB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv +# bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0 +# aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAA +# Ac1VByrnysGZHQABAAABzTANBglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkD +# MQ0GCyqGSIb3DQEJEAEEMC8GCSqGSIb3DQEJBDEiBCDMuF7QDQHme8LEs4NWCnOa +# 8jbgJtGZELxoEEYiDH+efzCB+gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIOJm +# pfitVr1PZGgvTEdTpStUc6GNh7LNroQBKwpURpkKMIGYMIGApH4wfDELMAkGA1UE +# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc +# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAHNVQcq58rBmR0AAQAAAc0wIgQgpXNo +# CR5udEHFtsK4vRweYQG6+tUY8EhPATlSEIELPDswDQYJKoZIhvcNAQELBQAEggIA +# iFTcLZ0vwFJzK+Rqanq7AynGwJuFJLGY6whQgWb+a8jLVtlCBrd5w36Xa3DfTbUO +# KSNVOq3JahGUSLZwnfm69YOiH8xujOMozBs7lgnTwoEfFchjFhGxMUxjC7YVuqph +# 82Q6e/qzSHMhNsbVoL7G/EA9lGIQ2rjxiREnh5IbiAvrrYyYrIHUGux7U/gXUE3W +# UzXMCNAuQrAXgC1I4CRfv8gRR1D1Zf27juawIsubcJ+X4NsHsrZlUChB4Jvcli5U +# +0BHtqXZl0jesLtdnxXcZQrZR8N5yMAr+J9ozW4F5l/Nw/K3JO/5XeR3tGjTpKWT +# qd9YPyvhJpn7WJGeOb60ahoyNkCPjdJXCfx7tMRYztCzlQVkqsbZmaWXAOPBpCJy +# KJW7TTHceNGuQxTbZ62LPX+3X+Li0I5QL+fN/CyvajxlbkONe6p7mEO1GwyEoBHK +# aK7p3pH45Fyn9pedZpWRnwNKFCtm7xIGrjD8dwh/SKnQQn0UZCOm6Z2MTA2dexh5 +# tckF0e9H6wsS2ty7bQjaxuIu7bRVIOv7N58yLZvZ/JpjuxTXTxJuxPmlAsBq4DPk +# 6oHV7zY0K9mbyoGUw0Hie5ZW+i15UGOQYjt9ORg38GLgv4mt3o4v78J0X1HTWDGt +# IKZzmt/ZsnE2gTde52Wujm56LnstUoCXuTKlLP5MTGA= +# SIG # End signature block diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..5379b99cf34a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/AzError.ps1 @@ -0,0 +1,281 @@ +function Write-InstallationCheckToFile +{ + Param($installationchecks) + if (Get-Module AzureRM.Profile -ListAvailable -ErrorAction Ignore) + { + Write-Warning ("Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide") + } + + $installationchecks.Add("AzSideBySideCheck","true") + try + { + if (Test-Path $pathToInstallationChecks -ErrorAction Ignore) + { + Remove-Item -Path $pathToInstallationChecks -ErrorAction Stop + } + + $pathToInstallDir = Split-Path -Path $pathToInstallationChecks -Parent -ErrorAction Stop + if (Test-Path $pathToInstallDir -ErrorAction Ignore) + { + New-Item -Path $pathToInstallationChecks -ErrorAction Stop -ItemType File -Value ($installationchecks | ConvertTo-Json -ErrorAction Stop) + } + } + catch + { + Write-Verbose "Installation checks failed to write to file." + } +} + +if (!($env:SkipAzInstallationChecks -eq "true")) +{ + $pathToInstallationChecks = Join-Path (Join-Path $HOME ".Azure") "AzInstallationChecks.json" + $installationchecks = @{} + if (!(Test-Path $pathToInstallationChecks -ErrorAction Ignore)) + { + Write-InstallationCheckToFile $installationchecks + } + else + { + try + { + ((Get-Content $pathToInstallationChecks -ErrorAction Stop) | ConvertFrom-Json -ErrorAction Stop).PSObject.Properties | Foreach { $installationchecks[$_.Name] = $_.Value } + } + catch + { + Write-InstallationCheckToFile $installationchecks + } + + if (!$installationchecks.ContainsKey("AzSideBySideCheck")) + { + Write-InstallationCheckToFile $installationchecks + } + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +Update-TypeData -AppendPath (Join-Path (Get-Item $PSScriptRoot).Parent.FullName Accounts.types.ps1xml) -ErrorAction Ignore +# SIG # Begin signature block +# MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDT3s8rOGw0kP8l +# AbYXJ7G9hr2fOKBRtW5xO6fWVEOZvqCCDYUwggYDMIID66ADAgECAhMzAAADTU6R +# phoosHiPAAAAAANNMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI4WhcNMjQwMzE0MTg0MzI4WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDUKPcKGVa6cboGQU03ONbUKyl4WpH6Q2Xo9cP3RhXTOa6C6THltd2RfnjlUQG+ +# Mwoy93iGmGKEMF/jyO2XdiwMP427j90C/PMY/d5vY31sx+udtbif7GCJ7jJ1vLzd +# j28zV4r0FGG6yEv+tUNelTIsFmmSb0FUiJtU4r5sfCThvg8dI/F9Hh6xMZoVti+k +# bVla+hlG8bf4s00VTw4uAZhjGTFCYFRytKJ3/mteg2qnwvHDOgV7QSdV5dWdd0+x +# zcuG0qgd3oCCAjH8ZmjmowkHUe4dUmbcZfXsgWlOfc6DG7JS+DeJak1DvabamYqH +# g1AUeZ0+skpkwrKwXTFwBRltAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUId2Img2Sp05U6XI04jli2KohL+8w +# VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMDUxNzAfBgNVHSMEGDAW +# gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw +# MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov +# L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx +# XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB +# ACMET8WuzLrDwexuTUZe9v2xrW8WGUPRQVmyJ1b/BzKYBZ5aU4Qvh5LzZe9jOExD +# YUlKb/Y73lqIIfUcEO/6W3b+7t1P9m9M1xPrZv5cfnSCguooPDq4rQe/iCdNDwHT +# 6XYW6yetxTJMOo4tUDbSS0YiZr7Mab2wkjgNFa0jRFheS9daTS1oJ/z5bNlGinxq +# 2v8azSP/GcH/t8eTrHQfcax3WbPELoGHIbryrSUaOCphsnCNUqUN5FbEMlat5MuY +# 94rGMJnq1IEd6S8ngK6C8E9SWpGEO3NDa0NlAViorpGfI0NYIbdynyOB846aWAjN +# fgThIcdzdWFvAl/6ktWXLETn8u/lYQyWGmul3yz+w06puIPD9p4KPiWBkCesKDHv +# XLrT3BbLZ8dKqSOV8DtzLFAfc9qAsNiG8EoathluJBsbyFbpebadKlErFidAX8KE +# usk8htHqiSkNxydamL/tKfx3V/vDAoQE59ysv4r3pE+zdyfMairvkFNNw7cPn1kH +# Gcww9dFSY2QwAxhMzmoM0G+M+YvBnBu5wjfxNrMRilRbxM6Cj9hKFh0YTwba6M7z +# ntHHpX3d+nabjFm/TnMRROOgIXJzYbzKKaO2g1kWeyG2QtvIR147zlrbQD4X10Ab +# rRg9CpwW7xYxywezj+iNAc+QmFzR94dzJkEPUSCJPsTFMIIHejCCBWKgAwIBAgIK +# YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm +# aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw +# OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD +# VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG +# 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la +# UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc +# 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D +# dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ +# lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk +# kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 +# A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd +# X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL +# 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd +# sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 +# T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS +# 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI +# bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL +# BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD +# uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv +# c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf +# MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF +# BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h +# cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA +# YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn +# 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 +# v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b +# pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ +# KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy +# CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp +# mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi +# hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb +# BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS +# oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL +# gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX +# cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGg0wghoJAgEBMIGVMH4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p +# Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAANNTpGmGiiweI8AAAAA +# A00wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw +# HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIKR+ +# w/DaLVp8ra2PXQQVXZI6DyW6fyW+fzmibTR/vTxzMEIGCisGAQQBgjcCAQwxNDAy +# oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20wDQYJKoZIhvcNAQEBBQAEggEAAJ/05iL6/mTJTdXlA3WMNU7DPdukKaJDMocn +# pzyB1C0hLB0o81xP7YSAsUBDAKzunfQ+oBNu6n/owxsHxw8C5aiDdeX87DkrwFEN +# 6Y0/kc3H3LpC+ll1Aq78ia85raDdogkMJNqAZOpaSs/+WPQGmTqATI3FTxjzviyB +# W2d09blFshgmPNB4IKNWZrf0xAZjugWcVe7WjbSnrf9C6Uap/yfFjAm1D+Am86Dy +# 9UYWjaxYSdiYj39a4rawSz2+47doMiSNWEdRzLBWQ3mhzG79emCceHwhCMof3KYZ +# WbXjXm+C738l48ZuzZ50X/w2B7jWQCLLiIdIY0Nczh9n7W+R8qGCF5cwgheTBgor +# BgEEAYI3AwMBMYIXgzCCF38GCSqGSIb3DQEHAqCCF3AwghdsAgEDMQ8wDQYJYIZI +# AWUDBAIBBQAwggFSBgsqhkiG9w0BCRABBKCCAUEEggE9MIIBOQIBAQYKKwYBBAGE +# WQoDATAxMA0GCWCGSAFlAwQCAQUABCDTxg5YDL/sFFSkwNmajR/hD+zpUa9/iONc +# c1T6Gn07AgIGZQPtxMFeGBMyMDIzMDkyMDA1NTA0My40MTNaMASAAgH0oIHRpIHO +# MIHLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH +# UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQL +# ExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxk +# IFRTUyBFU046QTAwMC0wNUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFNlcnZpY2WgghHtMIIHIDCCBQigAwIBAgITMwAAAdB3CKrvoxfG3QAB +# AAAB0DANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz +# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv +# cnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAx +# MDAeFw0yMzA1MjUxOTEyMTRaFw0yNDAyMDExOTEyMTRaMIHLMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1l +# cmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046QTAwMC0w +# NUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2Uw +# ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDfMlfn35fvM0XAUSmI5qiG +# 0UxPi25HkSyBgzk3zpYO311d1OEEFz0QpAK23s1dJFrjB5gD+SMw5z6EwxC4CrXU +# 9KaQ4WNHqHrhWftpgo3MkJex9frmO9MldUfjUG56sIW6YVF6YjX+9rT1JDdCDHbo +# 5nZiasMigGKawGb2HqD7/kjRR67RvVh7Q4natAVu46Zf5MLviR0xN5cNG20xwBwg +# ttaYEk5XlULaBH5OnXz2eWoIx+SjDO7Bt5BuABWY8SvmRQfByT2cppEzTjt/fs0x +# p4B1cAHVDwlGwZuv9Rfc3nddxgFrKA8MWHbJF0+aWUUYIBR8Fy2guFVHoHeOze7I +# sbyvRrax//83gYqo8c5Z/1/u7kjLcTgipiyZ8XERsLEECJ5ox1BBLY6AjmbgAzDd +# Nl2Leej+qIbdBr/SUvKEC+Xw4xjFMOTUVWKWemt2khwndUfBNR7Nzu1z9L0Wv7TA +# Y/v+v6pNhAeohPMCFJc+ak6uMD8TKSzWFjw5aADkmD9mGuC86yvSKkII4MayzoUd +# seT0nfk8Y0fPjtdw2Wnejl6zLHuYXwcDau2O1DMuoiedNVjTF37UEmYT+oxC/OFX +# UGPDEQt9tzgbR9g8HLtUfEeWOsOED5xgb5rwyfvIss7H/cdHFcIiIczzQgYnsLyE +# GepoZDkKhSMR5eCB6Kcv/QIDAQABo4IBSTCCAUUwHQYDVR0OBBYEFDPhAYWS0oA+ +# lOtITfjJtyl0knRRMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8G +# A1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMv +# Y3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBs +# BggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0 +# LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy +# MDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUH +# AwgwDgYDVR0PAQH/BAQDAgeAMA0GCSqGSIb3DQEBCwUAA4ICAQCXh+ckCkZaA06S +# NW+qxtS9gHQp4x7G+gdikngKItEr8otkXIrmWPYrarRWBlY91lqGiilHyIlZ3iNB +# UbaNEmaKAGMZ5YcS7IZUKPaq1jU0msyl+8og0t9C/Z26+atx3vshHrFQuSgwTHZV +# pzv7k8CYnBYoxdhI1uGhqH595mqLvtMsxEN/1so7U+b3U6LCry5uwwcz5+j8Oj0G +# UX3b+iZg+As0xTN6T0Qa8BNec/LwcyqYNEaMkW2VAKrmhvWH8OCDTcXgONnnABQH +# BfXK/fLAbHFGS1XNOtr62/iaHBGAkrCGl6Bi8Pfws6fs+w+sE9r3hX9Vg0gsRMoH +# RuMaiXsrGmGsuYnLn3AwTguMatw9R8U5vJtWSlu1CFO5P0LEvQQiMZ12sQSsQAkN +# DTs9rTjVNjjIUgoZ6XPMxlcPIDcjxw8bfeb4y4wAxM2RRoWcxpkx+6IIf2L+b7gL +# HtBxXCWJ5bMW7WwUC2LltburUwBv0SgjpDtbEqw/uDgWBerCT+Zty3Nc967iGaQj +# yYQH6H/h9Xc8smm2n6VjySRx2swnW3hr6Qx63U/xY9HL6FNhrGiFED7ZRKrnwvvX +# vMVQUIEkB7GUEeN6heY8gHLt0jLV3yzDiQA8R8p5YGgGAVt9MEwgAJNY1iHvH/8v +# zhJSZFNkH8svRztO/i3TvKrjb8ZxwjCCB3EwggVZoAMCAQICEzMAAAAVxedrngKb +# SZkAAAAAABUwDQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmlj +# YXRlIEF1dGhvcml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIy +# NVowfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXI +# yjVX9gF/bErg4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjo +# YH1qUoNEt6aORmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1y +# aa8dq6z2Nr41JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v +# 3byNpOORj7I5LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pG +# ve2krnopN6zL64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viS +# kR4dPf0gz3N9QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYr +# bqgSUei/BQOj0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlM +# jgK8QmguEOqEUUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSL +# W6CmgyFdXzB0kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AF +# emzFER1y7435UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIu +# rQIDAQABo4IB3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIE +# FgQUKqdS/mTEmr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMFwGA1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEW +# M2h0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5 +# Lmh0bTATBgNVHSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBi +# AEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV +# 9lbLj+iiXGJo0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3Js +# Lm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAx +# MC0wNi0yMy5jcmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8v +# d3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2 +# LTIzLmNydDANBgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv +# 6lwUtj5OR2R4sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZn +# OlNN3Zi6th542DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1 +# bSNU5HhTdSRXud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4 +# rPf5KYnDvBewVIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU +# 6ZGyqVvfSaN0DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDF +# NLB62FD+CljdQDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/ +# HltEAY5aGZFrDZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdU +# CbFpAUR+fKFhbHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKi +# excdFYmNcP7ntdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTm +# dHRbatGePu1+oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZq +# ELQdVTNYs6FwZvKhggNQMIICOAIBATCB+aGB0aSBzjCByzELMAkGA1UEBhMCVVMx +# EzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT +# FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJp +# Y2EgT3BlcmF0aW9uczEnMCUGA1UECxMeblNoaWVsZCBUU1MgRVNOOkEwMDAtMDVF +# MC1EOTQ3MSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMK +# AQEwBwYFKw4DAhoDFQC8t8hT8KKUX91lU5FqRP9Cfu9MiaCBgzCBgKR+MHwxCzAJ +# BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25k +# MR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jv +# c29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwMA0GCSqGSIb3DQEBCwUAAgUA6LUDNzAi +# GA8yMDIzMDkyMDA1MzU1MVoYDzIwMjMwOTIxMDUzNTUxWjB3MD0GCisGAQQBhFkK +# BAExLzAtMAoCBQDotQM3AgEAMAoCAQACAidSAgH/MAcCAQACAhN/MAoCBQDotlS3 +# AgEAMDYGCisGAQQBhFkKBAIxKDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSCh +# CjAIAgEAAgMBhqAwDQYJKoZIhvcNAQELBQADggEBAGtIWKlQ4xjkBGBgoktG9bqb +# W3uOsn29c3JcnP5Eq5RSCeHwCRLqC6bYPnrI0V6uJZGaSe/UiVRIjbQsr2Md6Liu +# 18E+/l27E3rd5NKZ4JapQ+nadT7roP/Q2NkZ+hK8kYvV+j0C2aCVDxM6KKvyfXN3 +# 9vIyVoMXXa4Htf6H6hiqbvBelUMohEcS20RXmTcQgBz/4JqhqXiIJBid/2SRudEp +# P4FKC/q7NZu0Kt9vaka5bpOjFkH8DSdsTmNhCnMsz3k60iD9L7fzqu6bIkCGeO9K +# urvs0V5kghKnZiJZ37Bwtng7KlequE58NxNKkuZrEiwepGU/NMZpgCsT31R2Qgwx +# ggQNMIIECQIBATCBkzB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv +# bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0 +# aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAA +# AdB3CKrvoxfG3QABAAAB0DANBglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkD +# MQ0GCyqGSIb3DQEJEAEEMC8GCSqGSIb3DQEJBDEiBCA5XwcAA1GbklJPMnjaBqpF +# NIgNrpeBP842Vo44Tv3PxTCB+gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIAiV +# QAZftNP/Md1E2Yw+fBXa9w6fjmTZ5WAerrTSPwnXMIGYMIGApH4wfDELMAkGA1UE +# BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc +# BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAHQdwiq76MXxt0AAQAAAdAwIgQgqB/y +# toAW0gc8cem4mHJrpEhQ7NI8Dpr/F6zncI8TlJUwDQYJKoZIhvcNAQELBQAEggIA +# q2johekNXCez3sHPgTENMweCsqyCVgtTV3YML+gpr56aV2vz+Iuy6Bt+8tatbyVW +# ANUYA8RkAftW+u/VvBBJUl0Y/83/DHph0XoaHq0MAZ9zbVWUqU5bcocF4IbZnik9 +# rA86SRXqOrPIK/i4J2vY7dWdPdhV6C8E2jBL0Lx/qiunv2BZy4DfptkRznVY5eRG +# jOcAhlr0s20DS1ylsIuGNf1bloA5Cldc+ObtGVglNPXLKD50YKsCIl4zshQEwubA +# 42PPlGpDcH8JfZAH/ckamL/wQhCi4UdZlVR7NVSMJ19oDlV3Y2ybLw7pVs6UJsqi +# DSzEdW+634lbvORxEWsOeok0J1tlgjjUGhPjMdFh/96qcqPnInvHqvYOcmVUFfYL +# HnquWfMQxvcHyLni96fLcsfGDGsUaNNjSx4vmaIYJknwCadjHIJyChjhYNQb00bz +# aHP6UJDZf2ZcRhuaKdMGV3lWH2Wens4zDgoYSW0iES9FkqIHGh3vy2knZ2CDrY7w +# BdB8PrTm9I7XVen1DEeXtoLusGLn08Jf9UnSXoBq6hptFUJi718OsfXPN26u9/3M +# IKxkdPyvj7pir1X9GaZMyz6eCGJGGtoaBPWAYrJHXoPq/zwpRiGcbK+PLkfI8PRb +# G5flQxQzxdP1hSzAqqE+VCto96sLhASeMZ7gpL87UoQ= +# SIG # End signature block diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..f03e9ec7eb08 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/StartupScripts/InitializeAssemblyResolver.ps1 @@ -0,0 +1,242 @@ +$assemblyRootPath = [System.IO.Path]::Combine($PSScriptRoot, "..", "lib") +Write-Debug "Initializing ConditionalAssemblyContext. PSEdition is [$($PSVersionTable.PSEdition)]. PSVersion is [$($PSVersionTable.PSVersion)]." +$conditionalAssemblyContext = [Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyContext]::new($PSVersionTable.PSEdition, $PSVersionTable.PSVersion) +Write-Debug "Initializing ConditionalAssemblyProvider. AssemblyRootPath is [$assemblyRootPath]." +[Microsoft.Azure.PowerShell.AssemblyLoading.ConditionalAssemblyProvider]::Initialize($assemblyRootPath, $conditionalAssemblyContext) + +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } + catch { + Write-Warning $_ + } +} +else { + try { + Add-Type -Path ([System.IO.Path]::Combine($PSScriptRoot, "..", "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll")) | Out-Null + Write-Debug "Registering Az shared AssemblyLoadContext." + [Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.AzAssemblyLoadContextInitializer]::RegisterAzSharedAssemblyLoadContext() + Write-Debug "AssemblyLoadContext registered." + } + catch { + Write-Warning $_ + } +} +# SIG # Begin signature block +# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCAe8RL2QVOwrz6 +# penupFKMe0U4FkbIX5RGfbRRPsEAcqCCDXYwggX0MIID3KADAgECAhMzAAADTrU8 +# esGEb+srAAAAAANOMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI5WhcNMjQwMzE0MTg0MzI5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDdCKiNI6IBFWuvJUmf6WdOJqZmIwYs5G7AJD5UbcL6tsC+EBPDbr36pFGo1bsU +# p53nRyFYnncoMg8FK0d8jLlw0lgexDDr7gicf2zOBFWqfv/nSLwzJFNP5W03DF/1 +# 1oZ12rSFqGlm+O46cRjTDFBpMRCZZGddZlRBjivby0eI1VgTD1TvAdfBYQe82fhm +# WQkYR/lWmAK+vW/1+bO7jHaxXTNCxLIBW07F8PBjUcwFxxyfbe2mHB4h1L4U0Ofa +# +HX/aREQ7SqYZz59sXM2ySOfvYyIjnqSO80NGBaz5DvzIG88J0+BNhOu2jl6Dfcq +# jYQs1H/PMSQIK6E7lXDXSpXzAgMBAAGjggFzMIIBbzAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUnMc7Zn/ukKBsBiWkwdNfsN5pdwAw +# RQYDVR0RBD4wPKQ6MDgxHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEW +# MBQGA1UEBRMNMjMwMDEyKzUwMDUxNjAfBgNVHSMEGDAWgBRIbmTlUAXTgqoXNzci +# tW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3JsMGEG +# CCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDovL3d3dy5taWNyb3NvZnQu +# Y29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDctMDguY3J0 +# MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIBAD21v9pHoLdBSNlFAjmk +# mx4XxOZAPsVxxXbDyQv1+kGDe9XpgBnT1lXnx7JDpFMKBwAyIwdInmvhK9pGBa31 +# TyeL3p7R2s0L8SABPPRJHAEk4NHpBXxHjm4TKjezAbSqqbgsy10Y7KApy+9UrKa2 +# kGmsuASsk95PVm5vem7OmTs42vm0BJUU+JPQLg8Y/sdj3TtSfLYYZAaJwTAIgi7d +# hzn5hatLo7Dhz+4T+MrFd+6LUa2U3zr97QwzDthx+RP9/RZnur4inzSQsG5DCVIM +# pA1l2NWEA3KAca0tI2l6hQNYsaKL1kefdfHCrPxEry8onJjyGGv9YKoLv6AOO7Oh +# JEmbQlz/xksYG2N/JSOJ+QqYpGTEuYFYVWain7He6jgb41JbpOGKDdE/b+V2q/gX +# UgFe2gdwTpCDsvh8SMRoq1/BNXcr7iTAU38Vgr83iVtPYmFhZOVM0ULp/kKTVoir +# IpP2KCxT4OekOctt8grYnhJ16QMjmMv5o53hjNFXOxigkQWYzUO+6w50g0FAeFa8 +# 5ugCCB6lXEk21FFB1FdIHpjSQf+LP/W2OV/HfhC3uTPgKbRtXo83TZYEudooyZ/A +# Vu08sibZ3MkGOJORLERNwKm2G7oqdOv4Qj8Z0JrGgMzj46NFKAxkLSpE5oHQYP1H +# tPx1lPfD7iNSbJsP6LiUHXH1MIIHejCCBWKgAwIBAgIKYQ6Q0gAAAAAAAzANBgkq +# hkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x +# EDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv +# bjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +# IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEwOTA5WjB+MQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQg +# Q29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +# CgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+laUKq4BjgaBEm6f8MMHt03 +# a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc6Whe0t+bU7IKLMOv2akr +# rnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4Ddato88tt8zpcoRb0Rrrg +# OGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+lD3v++MrWhAfTVYoonpy +# 4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nkkDstrjNYxbc+/jLTswM9 +# sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6A4aN91/w0FK/jJSHvMAh +# dCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmdX4jiJV3TIUs+UsS1Vz8k +# A/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL5zmhD+kjSbwYuER8ReTB +# w3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zdsGbiwZeBe+3W7UvnSSmn +# Eyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3T8HhhUSJxAlMxdSlQy90 +# lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS4NaIjAsCAwEAAaOCAe0w +# ggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRIbmTlUAXTgqoXNzcitW2o +# ynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYD +# VR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBDuRQFTuHqp8cx0SOJNDBa +# BgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2Ny +# bC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3JsMF4GCCsG +# AQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3J0MIGfBgNV +# HSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1hcnljcHMuaHRtMEAGCCsG +# AQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkAYwB5AF8AcwB0AGEAdABl +# AG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn8oalmOBUeRou09h0ZyKb +# C5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7v0epo/Np22O/IjWll11l +# hJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0bpdS1HXeUOeLpZMlEPXh6 +# I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/KmtYSWMfCWluWpiW5IP0 +# wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvyCInWH8MyGOLwxS3OW560 +# STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBpmLJZiWhub6e3dMNABQam +# ASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJihsMdYzaXht/a8/jyFqGa +# J+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYbBL7fQccOKO7eZS/sl/ah +# XJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbSoqKfenoi+kiVH6v7RyOA +# 9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sLgOppO6/8MO0ETI7f33Vt +# Y5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtXcVZOSEXAQsmbdlsKgEhr +# /Xmfwb1tbWrJUnMTDXpQzTGCGgowghoGAgEBMIGVMH4xCzAJBgNVBAYTAlVTMRMw +# EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN +# aWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNp +# Z25pbmcgUENBIDIwMTECEzMAAANOtTx6wYRv6ysAAAAAA04wDQYJYIZIAWUDBAIB +# BQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEO +# MAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIMHofDlPBqmVqK1okjwWVgBB +# tT7fuKbvz/K2Z2tehrjfMEIGCisGAQQBgjcCAQwxNDAyoBSAEgBNAGkAYwByAG8A +# cwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20wDQYJKoZIhvcNAQEB +# BQAEggEAh6WOd8mYDPLLkfaNOj1I07laB0TnfUoY3kPU8nRKXndoULPuXHTw+0TR +# ZwgvCjxyErXrV6Gpd03Xy2YcKFMOT5DHY8iV0olxkvZNHTt0oMmIUjYyCkblV3PA +# nrDZGbmmxw3FKRT/n2bQ9SNj7PNl29HgNxQxlDSEl6yJP+Bs11pyfW5uNYNVFPIj +# M5ddEr31Z9y/SwJ0oB892Anu6ZT2Cqy6Xt5XIacqNVpWG00UUVguvrHdelkLF4g4 +# dgI+UROhJfNfXgkmazGilBrufCC3LFe46BZgY3kJavyni3F3qsAujcb8+0QXczTu +# 9omGeP+6mHTHBR+9gPJW9pp+0x6O96GCF5QwgheQBgorBgEEAYI3AwMBMYIXgDCC +# F3wGCSqGSIb3DQEHAqCCF20wghdpAgEDMQ8wDQYJYIZIAWUDBAIBBQAwggFSBgsq +# hkiG9w0BCRABBKCCAUEEggE9MIIBOQIBAQYKKwYBBAGEWQoDATAxMA0GCWCGSAFl +# AwQCAQUABCDB/5pgJMSywQWzPV9JmKhJL6MoNIaXQMIgMZkbopcpUAIGZQQDsMbk +# GBMyMDIzMDkyMDA1NTA0NC4xNTJaMASAAgH0oIHRpIHOMIHLMQswCQYDVQQGEwJV +# UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE +# ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1l +# cmljYSBPcGVyYXRpb25zMScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046REMwMC0w +# NUUwLUQ5NDcxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2Wg +# ghHqMIIHIDCCBQigAwIBAgITMwAAAdIhJDFKWL8tEQABAAAB0jANBgkqhkiG9w0B +# AQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAeFw0yMzA1MjUxOTEy +# MjFaFw0yNDAyMDExOTEyMjFaMIHLMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz +# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv +# cnBvcmF0aW9uMSUwIwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25z +# MScwJQYDVQQLEx5uU2hpZWxkIFRTUyBFU046REMwMC0wNUUwLUQ5NDcxJTAjBgNV +# BAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQDcYIhC0QI/SPaT5+nYSBsSdhBPO2SXM40Vyyg8Fq1T +# PrMNDzxChxWUD7fbKwYGSsONgtjjVed5HSh5il75jNacb6TrZwuX+Q2++f2/8CCy +# u8TY0rxEInD3Tj52bWz5QRWVQejfdCA/n6ZzinhcZZ7+VelWgTfYC7rDrhX3TBX8 +# 9elqXmISOVIWeXiRK8h9hH6SXgjhQGGQbf2bSM7uGkKzJ/pZ2LvlTzq+mOW9iP2j +# cYEA4bpPeurpglLVUSnGGQLmjQp7Sdy1wE52WjPKdLnBF6JbmSREM/Dj9Z7okxRN +# UjYSdgyvZ1LWSilhV/wegYXVQ6P9MKjRnE8CI5KMHmq7EsHhIBK0B99dFQydL1vd +# uC7eWEjzz55Z/DyH6Hl2SPOf5KZ4lHf6MUwtgaf+MeZxkW0ixh/vL1mX8VsJTHa8 +# AH+0l/9dnWzFMFFJFG7g95nHJ6MmYPrfmoeKORoyEQRsSus2qCrpMjg/P3Z9WJAt +# FGoXYMD19NrzG4UFPpVbl3N1XvG4/uldo1+anBpDYhxQU7k1gfHn6QxdUU0TsrJ/ +# JCvLffS89b4VXlIaxnVF6QZh+J7xLUNGtEmj6dwPzoCfL7zqDZJvmsvYNk1lcbyV +# xMIgDFPoA2fZPXHF7dxahM2ZG7AAt3vZEiMtC6E/ciLRcIwzlJrBiHEenIPvxW15 +# qwIDAQABo4IBSTCCAUUwHQYDVR0OBBYEFCC2n7cnR3ToP/kbEZ2XJFFmZ1kkMB8G +# A1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8GA1UdHwRYMFYwVKBSoFCG +# Tmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY3Jvc29mdCUy +# MFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBsBggrBgEFBQcBAQRgMF4w +# XAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY2Vy +# dHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3J0MAwG +# A1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwgwDgYDVR0PAQH/BAQD +# AgeAMA0GCSqGSIb3DQEBCwUAA4ICAQCw5iq0Ey0LlAdz2PcqchRwW5d+fitNISCv +# qD0E6W/AyiTk+TM3WhYTaxQ2pP6Or4qOV+Du7/L+k18gYr1phshxVMVnXNcdjecM +# tTWUOVAwbJoeWHaAgknNIMzXK3+zguG5TVcLEh/CVMy1J7KPE8Q0Cz56NgWzd9ur +# G+shSDKkKdhOYPXF970Mr1GCFFpe1oXjEy6aS+Heavp2wmy65mbu0AcUOPEn+hYq +# ijgLXSPqvuFmOOo5UnSV66Dv5FdkqK7q5DReox9RPEZcHUa+2BUKPjp+dQ3D4c9I +# H8727KjMD8OXZomD9A8Mr/fcDn5FI7lfZc8ghYc7spYKTO/0Z9YRRamhVWxxrIsB +# N5LrWh+18soXJ++EeSjzSYdgGWYPg16hL/7Aydx4Kz/WBTUmbGiiVUcE/I0aQU2U +# /0NzUiIFIW80SvxeDWn6I+hyVg/sdFSALP5JT7wAe8zTvsrI2hMpEVLdStFAMqan +# FYqtwZU5FoAsoPZ7h1ElWmKLZkXk8ePuALztNY1yseO0TwdueIGcIwItrlBYg1Xp +# Pz1+pMhGMVble6KHunaKo5K/ldOM0mQQT4Vjg6ZbzRIVRoDcArQ5//0875jOUvJt +# Yyc7Hl04jcmvjEIXC3HjkUYvgHEWL0QF/4f7vLAchaEZ839/3GYOdqH5VVnZrUIB +# QB6DTaUILDCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUwDQYJKoZI +# hvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAw +# DgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24x +# MjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAy +# MDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkGA1UEBhMC +# VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNV +# BAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +# AQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg4r25Phdg +# M/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aORmsHFPPF +# dvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41JmTamDu6 +# GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5LFGc6XBp +# Dco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL64NF50Zu +# yjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9QZpGdc3E +# XzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj0XOmTTd0 +# lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqEUUbi0b1q +# GFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0kZSU2LlQ +# +QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435UsSFF5PA +# PBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB3TCCAdkw +# EgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTEmr6CkTxG +# NSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwGA1UdIARV +# MFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93d3cubWlj +# cm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNVHSUEDDAK +# BggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNVHQ8EBAMC +# AYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo0T2UkFvX +# zpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20v +# cGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcmwwWgYI +# KwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDANBgkqhkiG +# 9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4sQaTlz0x +# M7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th542DYunKmC +# VgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRXud2f8449 +# xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBewVIVCs/wM +# nosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0DLzskYDS +# PeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+CljdQDzHVG2d +# Y3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFrDZ+kKNxn +# GSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFhbHP+Crvs +# QWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7ntdAoGokL +# jzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+oDEzfbzL +# 6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6FwZvKhggNN +# MIICNQIBATCB+aGB0aSBzjCByzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hp +# bmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jw +# b3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2EgT3BlcmF0aW9uczEn +# MCUGA1UECxMeblNoaWVsZCBUU1MgRVNOOkRDMDAtMDVFMC1EOTQ3MSUwIwYDVQQD +# ExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMKAQEwBwYFKw4DAhoDFQCJ +# ptLCZsE06NtmHQzB5F1TroFSBqCBgzCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwMA0GCSqGSIb3DQEBCwUAAgUA6LRwyDAiGA8yMDIzMDkxOTE5MTEw +# NFoYDzIwMjMwOTIwMTkxMTA0WjB0MDoGCisGAQQBhFkKBAExLDAqMAoCBQDotHDI +# AgEAMAcCAQACAi5fMAcCAQACAhMzMAoCBQDotcJIAgEAMDYGCisGAQQBhFkKBAIx +# KDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSChCjAIAgEAAgMBhqAwDQYJKoZI +# hvcNAQELBQADggEBABSMhArCfMaUns9Ybi+bd7CrSqySoFW9FQHNYSc/7Z4kVIDH +# MOSWB04XzoJV+b5q9p40kFfOlc5b184s/ZuR0zXF8NOTag0yTpWUYZDo3OrdVa45 +# g1JiqIjXs1Mpilyf/r194uoB8G63Kyxv4tyQX01/UL1ohtT88bXEDl6pNb+Xyhu/ +# 3benlypP9gr5fXHU1AcSpR/fuLO2QX4Inqqsrn8073fZkUrFfXeHgYGscjH/6A8V +# xK3x86MVX85OKS7L48K64XMJmuNzDOPMz7fbFLtwrj3tXhnU179w/GuGdvFgRaPf +# VfxZcx4y31FR1J4hDsrSVj/eGul6ZvDhEP5llugxggQNMIIECQIBATCBkzB8MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNy +# b3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAdIhJDFKWL8tEQABAAAB0jAN +# BglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkDMQ0GCyqGSIb3DQEJEAEEMC8G +# CSqGSIb3DQEJBDEiBCDABiZtIILyalxFaNkpSNLPyB6dnqa8Og8PeO2M5QwQvjCB +# +gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIMeAIJPf30i9ZbOExU557GwWNaLH +# 0Z5s65JFga2DeaROMIGYMIGApH4wfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh +# c2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBD +# b3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIw +# MTACEzMAAAHSISQxSli/LREAAQAAAdIwIgQgxHcZpEl6iRNRIzFH1U59AFtiyMD5 +# cXN76GiPGy+kKMAwDQYJKoZIhvcNAQELBQAEggIA0Ev33yJgxJMIh75Ft6iuoxJH +# qmm0N6lliYKEIWF42TZBKU4ubpdr1tca9Wt8bL/AagZ4tEEb1fKBJTwmedSQQOey +# cWdkjeXRlHqBkHEpz/u+yIl9/4KojgmxT9P0ZNfHPjQxt9Zb7wubc2N9tgJ6ZwXr +# Kx/1DZkiKwXXRbNga7yyVM924J0/xokBiDkWtWKF4UOdEAtAoQmxwtVFWnJBVVQK +# BV8bAgi4+5lGrD1PoX1/uLd1hsnr0+/qu/Lz8f20DcFmPrp+gEXLdDCvws93b9fx +# 3hSuuVawfT8XFnXEut989RtYBlYkOPgDIrUbuHj5EqmB19UnhOeFkvhMHEqq+XKo +# kO9mHo8WZOnMFYM8FeSclxl3z/3jrAEibfoXBpVXFv1F3GGt5WH+2UWs7JXTK01R +# tnDr6DRsMEIr0yw2g1cb//u0BkmcEwBXr51dNX3E0WAxqVJk9yjV+YuGLjeD569E +# wDGANqkm83LIALMCBaBAzjVoG8jVnR0gLXrca7i+ez1h/jVDl5GmGcVfdgvxzDYk +# +uMpr/FsnoEFMGiBe/9l72gXY7pnoCipoNTx6q3GA3cfzfVDw27c8AzCny1DHUvj +# cUPCdId96d7eIR//lZo+DnJdQ+rsPlDuqpPdoldS/TzlCl+5Z8idTtxp9kSqzt8O +# aZYYi6hivyQoGN3avBU= +# SIG # End signature block diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/[Content_Types].xml b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/[Content_Types].xml new file mode 100644 index 000000000000..247435745a35 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/[Content_Types].xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/_rels/.rels b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/_rels/.rels new file mode 100644 index 000000000000..756a7cb14f58 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/en-US/about_az.help.txt b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/en-US/about_az.help.txt new file mode 100644 index 000000000000..fb4a5e9becd1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/en-US/about_az.help.txt @@ -0,0 +1,50 @@ +About topic for Azure PowerShell - about_az + +TOPIC + +about_Az + +SHORT DESCRIPTION + +The Azure Az PowerShell module is a set of cmdlets for managing Azure +resources directly from the PowerShell command line and in PowerShell +scripts. + +LONG DESCRIPTION + +Azure PowerShell provides cross-platform cmdlets for managing Azure +services. All Azure PowerShell cmdlets work on Windows PowerShell 5.1 and +supported versions of PowerShell 7. + +The Azure PowerShell cmdlets follow the naming convention {verb}-Az{noun}. + +- {verb} is an approved PowerShell verb reflecting the corresponding HTTP + operation. + +- {noun} matches or has a close equivalent to the name of the resource. + +The cmdlets produce .NET objects that can be piped between commands +simplifying the sequencing of commands making Azure PowerShell a powerful +solution for scripting and automation purposes. + +A PowerShell module is available for each Azure service. For convenience, +we provide a wrapper module named "Az" that comprises the stable modules. +Modules in preview must be installed independently or via the "AzPreview" +wrapper module. + +Azure PowerShell is frequently updated to include bug fixes and service +updates. It is recommended to plan to update to the most recent version +regularly (a minimum of twice a year). + +GETTING STARTED + +1. Connect to Azure using Connect-AzAccount + +2. Run your first command. For example, create a resource group in the + east US region. + + New-AzResourceGroup -Name "MyResoureGroup" -location "eastus" + +SEE ALSO + +Azure PowerShell documentation: https://learn.microsoft.com/powershell/azure diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll new file mode 100644 index 000000000000..66f3d3165b86 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Azure.Core.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..7e98f30fc54a Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp2.1/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..02168e3b1856 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netcoreapp3.1/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll new file mode 100644 index 000000000000..2593da6045ce Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Azure.Core.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..87f0bdfe02f2 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..2a1b17bc86a4 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll new file mode 100644 index 000000000000..9f13f1f8a4fd Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/Newtonsoft.Json.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 000000000000..92419a27e0c2 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Numerics.Vectors.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Numerics.Vectors.dll new file mode 100644 index 000000000000..08659724d4f8 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Numerics.Vectors.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll new file mode 100644 index 000000000000..674ced0460de Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 000000000000..c5ba4e4047a1 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Security.Cryptography.Cng.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Security.Cryptography.Cng.dll new file mode 100644 index 000000000000..4f4c30e080bd Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Text.Encodings.Web.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Text.Encodings.Web.dll new file mode 100644 index 000000000000..6d2b207854ac Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Xml.ReaderWriter.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Xml.ReaderWriter.dll new file mode 100644 index 000000000000..022e63a21a86 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netfx/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll new file mode 100644 index 000000000000..4b4b2f2b663d Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.BrokeredAuthentication.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll new file mode 100644 index 000000000000..5662a76ad958 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Azure.Identity.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..f2955edfecb7 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll new file mode 100644 index 000000000000..3e0a147d4bcb Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll new file mode 100644 index 000000000000..a7d555909366 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.Identity.Client.NativeInterop.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll new file mode 100644 index 000000000000..f793fd89bece Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/Microsoft.IdentityModel.Abstractions.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Buffers.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Buffers.dll new file mode 100644 index 000000000000..c517a3b62cc7 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Buffers.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.Data.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.Data.dll new file mode 100644 index 000000000000..6f2a3e0ad07f Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.Data.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.dll new file mode 100644 index 000000000000..bdfc501e9647 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Memory.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Net.Http.WinHttpHandler.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Net.Http.WinHttpHandler.dll new file mode 100644 index 000000000000..8bd471e74c6e Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Private.ServiceModel.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Private.ServiceModel.dll new file mode 100644 index 000000000000..3f9f84edf0ed Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Private.ServiceModel.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll new file mode 100644 index 000000000000..36fb33af4590 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.AccessControl.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll new file mode 100644 index 000000000000..2a353ee22eec Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Permissions.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll new file mode 100644 index 000000000000..19d0fc0e971c Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.ServiceModel.Primitives.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.ServiceModel.Primitives.dll new file mode 100644 index 000000000000..c1aa0a64f8f9 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Text.Json.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Text.Json.dll new file mode 100644 index 000000000000..fe2154a3bf3a Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Text.Json.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll new file mode 100644 index 000000000000..dfab23478ab4 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll new file mode 100644 index 000000000000..70162a8713a2 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll new file mode 100644 index 000000000000..aca4cb32691f Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_arm64.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll new file mode 100644 index 000000000000..24735b8531b8 Binary files /dev/null and b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/lib/netstandard2.0/msalruntime_x86.dll differ diff --git a/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp new file mode 100644 index 000000000000..d07e7bb54153 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/modules/Az.Accounts/2.13.1/package/services/metadata/core-properties/f9ac9c2e40914e78a646a7b0b997403b.psmdcp @@ -0,0 +1,11 @@ + + + Microsoft Corporation + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://learn.microsoft.com/powershell/azure/authenticate-azureps + Az.Accounts + 2.13.1 + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCmdlet_Get-AzConfig PSCmdlet_Update-AzConfig PSCmdlet_Clear-AzConfig PSCmdlet_Export-AzConfig PSCmdlet_Import-AzConfig PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Get-AzConfig PSCommand_Update-AzConfig PSCommand_Clear-AzConfig PSCommand_Export-AzConfig PSCommand_Import-AzConfig PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest PSCommand_Set-AzConfig + NuGet, Version=6.6.1.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35;Microsoft Windows NT 10.0.17763.0;.NET Framework 4.7.2 + \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..0d5de78eded4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/AsyncCommandRuntime.cs @@ -0,0 +1,832 @@ +/*--------------------------------------------------------------------------------------------- + * 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.ContainerService.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + using System.Linq; + + internal interface IAsyncCommandRuntimeExtensions + { + Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep func); + System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs); + + T ExecuteSync(System.Func step); + } + + public class AsyncCommandRuntime : System.Management.Automation.ICommandRuntime2, IAsyncCommandRuntimeExtensions, System.IDisposable + { + private ICommandRuntime2 originalCommandRuntime; + private System.Threading.Thread originalThread; + public bool AllowInteractive { get; set; } = false; + + public CancellationToken cancellationToken; + SemaphoreSlim semaphore = new SemaphoreSlim(1, 1); + ManualResetEventSlim readyToRun = new ManualResetEventSlim(false); + ManualResetEventSlim completed = new ManualResetEventSlim(false); + + System.Action runOnMainThread; + + private System.Management.Automation.PSCmdlet cmdlet; + + internal AsyncCommandRuntime(System.Management.Automation.PSCmdlet cmdlet, CancellationToken cancellationToken) + { + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + this.cancellationToken = cancellationToken; + this.cmdlet = cmdlet; + if (cmdlet.PagingParameters != null) + { + WriteDebug("Client side pagination is enabled for this cmdlet"); + } + cmdlet.CommandRuntime = this; + } + + public PSHost Host => this.originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => this.originalCommandRuntime.CurrentPSTransaction; + + private void CheckForInteractive() + { + // This is an interactive call -- if we are not on the original thread, this will only work if this was done at ACR creation time; + if (!AllowInteractive) + { + throw new System.Exception("AsyncCommandRuntime is not configured for interactive calls"); + } + } + private void WaitOurTurn() + { + // wait for our turn to play + semaphore?.Wait(cancellationToken); + + // ensure that completed is not set + completed.Reset(); + } + + private void WaitForCompletion() + { + // wait for the result (or cancellation!) + WaitHandle.WaitAny(new[] { cancellationToken.WaitHandle, completed?.WaitHandle }); + + // let go of the semaphore + semaphore?.Release(); + + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target, string action) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target, action); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target, action); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out shouldProcessReason); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + ShouldProcessReason reason = ShouldProcessReason.None; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out reason); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + shouldProcessReason = reason; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.ThrowTerminatingError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.ThrowTerminatingError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool TransactionAvailable() + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.TransactionAvailable(); + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.TransactionAvailable(); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteCommandDetail(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteCommandDetail(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteCommandDetail(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteDebug(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteDebug(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteDebug(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteInformation(informationRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteInformation(informationRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(sourceId, progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(sourceId, progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteVerbose(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteVerbose(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteVerbose(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteWarning(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteWarning(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteWarning(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Wait(System.Threading.Tasks.Task ProcessRecordAsyncTask, System.Threading.CancellationToken cancellationToken) + { + do + { + WaitHandle.WaitAny(new[] { readyToRun.WaitHandle, ((System.IAsyncResult)ProcessRecordAsyncTask).AsyncWaitHandle }); + if (readyToRun.IsSet) + { + // reset the request for the next time + readyToRun.Reset(); + + // run the delegate on this thread + runOnMainThread(); + + // tell the originator everything is complete + completed.Set(); + } + } + while (!ProcessRecordAsyncTask.IsCompleted); + if (ProcessRecordAsyncTask.IsFaulted) + { + // don't unwrap a Aggregate Exception -- we'll lose the stack trace of the actual exception. + // if( ProcessRecordAsyncTask.Exception is System.AggregateException aggregate ) { + // throw aggregate.InnerException; + // } + throw ProcessRecordAsyncTask.Exception; + } + } + public Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep func) => func.Target.GetType().Name != "Closure" ? func : (p1, p2, p3) => ExecuteSync>(() => func(p1, p2, p3)); + public System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs) => funcs?.Select(Wrap); + + public T ExecuteSync(System.Func step) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return step(); + } + + T result = default(T); + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + // set the function to run + runOnMainThread = () => { result = step(); }; + // tell the main thread to go ahead + readyToRun.Set(); + // wait for the result (or cancellation!) + WaitForCompletion(); + // return + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Dispose() + { + if (cmdlet != null) + { + cmdlet.CommandRuntime = this.originalCommandRuntime; + cmdlet = null; + } + + semaphore?.Dispose(); + semaphore = null; + readyToRun?.Dispose(); + readyToRun = null; + completed?.Dispose(); + completed = null; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/AsyncJob.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..f4d8da60a0d1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/AsyncJob.cs @@ -0,0 +1,270 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + + using System.Threading.Tasks; + + public class LongRunningJobCancelledException : System.Exception + { + public LongRunningJobCancelledException(string message) : base(message) + { + + } + } + + public class AsyncJob : Job, System.Management.Automation.ICommandRuntime2 + { + const int MaxRecords = 1000; + + private string _statusMessage = string.Empty; + + public override string StatusMessage => _statusMessage; + + public override bool HasMoreData => Output.Count > 0 || Progress.Count > 0 || Error.Count > 0 || Warning.Count > 0 || Verbose.Count > 0 || Debug.Count > 0; + + public override string Location => "localhost"; + + public PSHost Host => originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => originalCommandRuntime.CurrentPSTransaction; + + public override void StopJob() + { + Cancel(); + } + + private readonly PSCmdlet cmdlet; + private readonly ICommandRuntime2 originalCommandRuntime; + private readonly System.Threading.Thread originalThread; + + private void CheckForInteractive() + { + // This is an interactive call -- We should never allow interactivity in AsnycJob cmdlets. + throw new System.Exception("Cmdlets in AsyncJob; interactive calls are not permitted."); + } + private bool IsJobDone => CancellationToken.IsCancellationRequested || this.JobStateInfo.State == JobState.Failed || this.JobStateInfo.State == JobState.Stopped || this.JobStateInfo.State == JobState.Stopping || this.JobStateInfo.State == JobState.Completed; + + private readonly System.Action Cancel; + private readonly CancellationToken CancellationToken; + + internal AsyncJob(PSCmdlet cmdlet, string line, string name, CancellationToken cancellationToken, System.Action cancelMethod) : base(line, name) + { + SetJobState(JobState.NotStarted); + // know how to cancel/check for cancelation + this.CancellationToken = cancellationToken; + this.Cancel = cancelMethod; + + // we might need these. + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + + // the instance of the cmdlet we're going to run + this.cmdlet = cmdlet; + + // set the command runtime to the AsyncJob + cmdlet.CommandRuntime = this; + } + + /// + /// Monitors the task (which should be ProcessRecordAsync) to control + /// the lifetime of the job itself + /// + /// + public void Monitor(Task task) + { + SetJobState(JobState.Running); + task.ContinueWith(antecedent => + { + if (antecedent.IsCanceled) + { + // if the task was canceled, we're just going to call it completed. + SetJobState(JobState.Completed); + } + else if (antecedent.IsFaulted) + { + foreach (var innerException in antecedent.Exception.Flatten().InnerExceptions) + { + WriteError(new System.Management.Automation.ErrorRecord(innerException, string.Empty, System.Management.Automation.ErrorCategory.NotSpecified, null)); + } + + // a fault indicates an actual failure + SetJobState(JobState.Failed); + } + else + { + // otherwiser it's a completed state. + SetJobState(JobState.Completed); + } + }, CancellationToken); + } + + private void CheckForCancellation() + { + if (IsJobDone) + { + throw new LongRunningJobCancelledException("Long running job is canceled or stopping, continuation of the cmdlet is not permitted."); + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + CheckForCancellation(); + + this.Information.Add(informationRecord); + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public void WriteDebug(string text) + { + _statusMessage = text; + CheckForCancellation(); + + if (Debug.IsOpen && Debug.Count < MaxRecords) + { + Debug.Add(new DebugRecord(text)); + } + } + + public void WriteError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + + public void WriteObject(object sendToPipeline) + { + CheckForCancellation(); + + if (Output.IsOpen) + { + Output.Add(new PSObject(sendToPipeline)); + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + CheckForCancellation(); + + if (enumerateCollection && sendToPipeline is System.Collections.IEnumerable enumerable) + { + foreach (var item in enumerable) + { + WriteObject(item); + } + } + else + { + WriteObject(sendToPipeline); + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteVerbose(string text) + { + CheckForCancellation(); + + if (Verbose.IsOpen && Verbose.Count < MaxRecords) + { + Verbose.Add(new VerboseRecord(text)); + } + } + + public void WriteWarning(string text) + { + CheckForCancellation(); + + if (Warning.IsOpen && Warning.Count < MaxRecords) + { + Warning.Add(new WarningRecord(text)); + } + } + + public void WriteCommandDetail(string text) + { + WriteVerbose(text); + } + + public bool ShouldProcess(string target) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string target, string action) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + CheckForInteractive(); + shouldProcessReason = ShouldProcessReason.None; + return false; + } + + public bool ShouldContinue(string query, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public bool TransactionAvailable() + { + // interactivity required? + return false; + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/AsyncOperationResponse.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..c7add32025c1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/AsyncOperationResponse.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. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + [System.ComponentModel.TypeConverter(typeof(AsyncOperationResponseTypeConverter))] + public class AsyncOperationResponse + { + private string _target; + public string Target { get => _target; set => _target = value; } + public AsyncOperationResponse() + { + } + internal AsyncOperationResponse(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json) + { + // pull target + { Target = If(json?.PropertyT("target"), out var _v) ? (string)_v : (string)Target; } + } + public string ToJsonString() + { + return $"{{ \"target\" : \"{this.Target}\" }}"; + } + + public static AsyncOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject json ? new AsyncOperationResponse(json) : null; + } + + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static AsyncOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(jsonText)); + + } + + public partial class AsyncOperationResponseTypeConverter : 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 a type + /// parameter. + /// + /// 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(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.ContainerService.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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 object ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(AsyncOperationResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AsyncOperationResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()); ; + } + catch + { + // Unable to use JSON pattern + } + + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as System.Management.Automation.PSObject).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as global::System.Collections.IDictionary).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + 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/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..87ea4ba0d2e4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "CmdletSurface")] + [DoNotExport] + public class ExportCmdletSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CmdletFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool IncludeGeneralParameters { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetScriptCmdlets(this, CmdletFolder) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + foreach (var profileGroup in profileGroups) + { + var variantGroups = profileGroup.Variants + .GroupBy(v => new { v.CmdletName }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), String.Empty, profileGroup.ProfileName)); + var sb = UseExpandedFormat ? ExpandedFormat(variantGroups) : CondensedFormat(variantGroups); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, $"CmdletSurface-{profileGroup.ProfileName}.md"), sb.ToString()); + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private StringBuilder ExpandedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + foreach (var variantGroup in variantGroups.OrderBy(vg => vg.CmdletName)) + { + sb.Append($"### {variantGroup.CmdletName}{Environment.NewLine}"); + var parameterGroups = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private StringBuilder CondensedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + var condensedGroups = variantGroups + .GroupBy(vg => vg.CmdletNoun) + .Select(vgg => ( + CmdletNoun: vgg.Key, + CmdletVerbs: vgg.Select(vg => vg.CmdletVerb).OrderBy(cv => cv).ToArray(), + ParameterGroups: vgg.SelectMany(vg => vg.ParameterGroups).DistinctBy(p => p.ParameterName).ToArray(), + OutputTypes: vgg.SelectMany(vg => vg.OutputTypes).Select(ot => ot.Type).DistinctBy(t => t.Name).Select(t => t.ToSyntaxTypeName()).ToArray())) + .OrderBy(vg => vg.CmdletNoun); + foreach (var condensedGroup in condensedGroups) + { + sb.Append($"### {condensedGroup.CmdletNoun} [{String.Join(", ", condensedGroup.CmdletVerbs)}] `{String.Join(", ", condensedGroup.OutputTypes)}`{Environment.NewLine}"); + var parameterGroups = condensedGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..00bf87872558 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ExampleStub")] + [DoNotExport] + public class ExportExampleStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + protected override void ProcessRecord() + { + 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 exampleText = String.Join(String.Empty, DefaultExampleHelpInfos.Select(ehi => ehi.ToHelpExampleOutput())); + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var cmdletFilePaths = GetScriptCmdlets(exportDirectory).Select(fi => Path.Combine(outputFolder, $"{fi.Name}.md")).ToArray(); + var currentExamplesFilePaths = Directory.GetFiles(outputFolder).ToArray(); + // Remove examples of non-existing cmdlets + var removedCmdletFilePaths = currentExamplesFilePaths.Except(cmdletFilePaths); + foreach (var removedCmdletFilePath in removedCmdletFilePaths) + { + File.Delete(removedCmdletFilePath); + } + + // Only create example stubs if they don't exist + foreach (var cmdletFilePath in cmdletFilePaths.Except(currentExamplesFilePaths)) + { + File.WriteAllText(cmdletFilePath, exampleText); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..863cdc936af3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -0,0 +1,101 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "FormatPs1xml")] + [DoNotExport] + public class ExportFormatPs1xml : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FilePath { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support"; + private const string PropertiesExcludedForTableview = @""; + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + + protected override void ProcessRecord() + { + try + { + var viewModels = GetFilteredViewParameters().Select(CreateViewModel).ToList(); + var ps1xml = new Configuration + { + ViewDefinitions = new ViewDefinitions + { + Views = viewModels + } + }; + File.WriteAllText(FilePath, ps1xml.ToXmlString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static IEnumerable GetFilteredViewParameters() + { + //https://stackoverflow.com/a/79738/294804 + //https://stackoverflow.com/a/949285/294804 + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass + && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace)) + && !t.GetCustomAttributes().Any()); + return types.Select(t => new ViewParameters(t, t.GetProperties() + .Select(p => new PropertyFormat(p)) + .Where(pf => !pf.Property.GetCustomAttributes().Any() + && (!PropertiesExcludedForTableview.Split(',').Contains(pf.Property.Name)) + && (pf.FormatTable != null || (pf.Origin != PropertyOrigin.Inlined && pf.Property.PropertyType.IsPsSimple()))) + .OrderByDescending(pf => pf.Index.HasValue) + .ThenBy(pf => pf.Index) + .ThenByDescending(pf => pf.Origin.HasValue) + .ThenBy(pf => pf.Origin))).Where(vp => vp.Properties.Any()); + } + + private static View CreateViewModel(ViewParameters viewParameters) + { + var entries = viewParameters.Properties.Select(pf => + (TableColumnHeader: new TableColumnHeader { Label = pf.Label, Width = pf.Width }, + TableColumnItem: new TableColumnItem { PropertyName = pf.Property.Name })).ToArray(); + + return new View + { + Name = viewParameters.Type.FullName, + ViewSelectedBy = new ViewSelectedBy + { + TypeName = viewParameters.Type.FullName + }, + TableControl = new TableControl + { + TableHeaders = new TableHeaders + { + TableColumnHeaders = entries.Select(e => e.TableColumnHeader).ToList() + }, + TableRowEntries = new TableRowEntries + { + TableRowEntry = new TableRowEntry + { + TableColumnItems = new TableColumnItems + { + TableItems = entries.Select(e => e.TableColumnItem).ToList() + } + } + } + } + }; + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..a78d7b415095 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.MarkdownRenderer; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "HelpMarkdown")] + [DoNotExport] + public class ExportHelpMarkdown : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSModuleInfo ModuleInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] FunctionInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] HelpInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + [Parameter()] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var helpInfos = HelpInfo.Select(hi => hi.ToPsHelpInfo()); + var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() + .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) + .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder, AddComplexInterfaceInfo.IsPresent); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..d275399af6ce --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ModelSurface")] + [DoNotExport] + public class ExportModelSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Support"; + + protected override void ProcessRecord() + { + try + { + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace))); + var typeInfos = types.Select(t => new ModelTypeInfo + { + Type = t, + TypeName = t.Name, + Properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => !p.GetIndexParameters().Any()).OrderBy(p => p.Name).ToArray(), + NamespaceGroup = t.Namespace.Split('.').LastOrDefault().EmptyIfNull() + }).Where(mti => mti.Properties.Any()); + var sb = UseExpandedFormat ? ExpandedFormat(typeInfos) : CondensedFormat(typeInfos); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, "ModelSurface.md"), sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static StringBuilder ExpandedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + foreach (var typeInfo in typeInfos.OrderBy(mti => mti.TypeName).ThenBy(mti => mti.NamespaceGroup)) + { + sb.Append($"### {typeInfo.TypeName} [{typeInfo.NamespaceGroup}]{Environment.NewLine}"); + foreach (var property in typeInfo.Properties) + { + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private static StringBuilder CondensedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + var typeGroups = typeInfos + .GroupBy(mti => mti.TypeName) + .Select(tig => ( + Types: tig.Select(mti => mti.Type).ToArray(), + TypeName: tig.Key, + Properties: tig.SelectMany(mti => mti.Properties).DistinctBy(p => p.Name).OrderBy(p => p.Name).ToArray(), + NamespaceGroups: tig.Select(mti => mti.NamespaceGroup).OrderBy(ng => ng).ToArray() + )) + .OrderBy(tg => tg.TypeName); + foreach (var typeGroup in typeGroups) + { + var aType = typeGroup.Types.Select(GetAssociativeType).FirstOrDefault(t => t != null); + var aText = aType != null ? $@" \<{aType.ToSyntaxTypeName()}\>" : String.Empty; + sb.Append($"### {typeGroup.TypeName}{aText} [{String.Join(", ", typeGroup.NamespaceGroups)}]{Environment.NewLine}"); + foreach (var property in typeGroup.Properties) + { + var propertyAType = GetAssociativeType(property.PropertyType); + var propertyAText = propertyAType != null ? $" <{propertyAType.ToSyntaxTypeName()}>" : String.Empty; + var enumNames = GetEnumFieldNames(property.PropertyType.Unwrap()); + var enumNamesText = enumNames.Any() ? $" **{{{String.Join(", ", enumNames)}}}**" : String.Empty; + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}{propertyAText}`{enumNamesText}{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + //https://stackoverflow.com/a/4963190/294804 + private static Type GetAssociativeType(Type type) => + type.GetInterfaces().FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>))?.GetGenericArguments().First(); + + private static string[] GetEnumFieldNames(Type type) => + type.IsValueType && !type.IsPrimitive && type != typeof(decimal) && type != typeof(DateTime) + ? type.GetFields(BindingFlags.Public | BindingFlags.Static).Where(f => f.FieldType == type).Select(p => p.Name).ToArray() + : new string[] { }; + + private class ModelTypeInfo + { + public Type Type { get; set; } + public string TypeName { get; set; } + public PropertyInfo[] Properties { get; set; } + public string NamespaceGroup { get; set; } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..57f6b3fc3680 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsHelpers; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.MarkdownRenderer; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsProxyTypeExtensions; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ProxyCmdlet", DefaultParameterSetName = "Docs")] + [DoNotExport] + public class ExportProxyCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string[] ModulePath { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string InternalFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [AllowEmptyString] + public string ModuleDescription { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + public Guid ModuleGuid { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] + public SwitchParameter ExcludeDocs { get; set; } + + [Parameter(ParameterSetName = "Docs")] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetModuleCmdletsAndHelpInfo(this, ModulePath).SelectMany(ci => ci.ToVariants()).Where(v => !v.IsDoNotExport).ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + 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))) + .ToArray(); + + var license = new StringBuilder(); + license.Append(@" +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +"); + HashSet LicenseSet = new HashSet(); + foreach (var variantGroup in variantGroups) + { + var parameterGroups = variantGroup.ParameterGroups.ToList(); + var isValidProfile = !String.IsNullOrEmpty(variantGroup.ProfileName) && variantGroup.ProfileName != NoProfiles; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, variantGroup.ProfileName) : ExamplesFolder; + var markdownInfo = new MarkdownHelpInfo(variantGroup, examplesFolder); + List examples = new List(); + foreach (var it in markdownInfo.Examples) + { + examples.Add(it); + } + variantGroup.HelpInfo.Examples = examples.ToArray(); + var sb = new StringBuilder(); + sb.Append($"{Environment.NewLine}"); + sb.Append(variantGroup.ToHelpCommentOutput()); + sb.Append($"function {variantGroup.CmdletName} {{{Environment.NewLine}"); + sb.Append(variantGroup.Aliases.ToAliasOutput()); + sb.Append(variantGroup.OutputTypes.ToOutputTypeOutput()); + sb.Append(variantGroup.ToCmdletBindingOutput()); + sb.Append(variantGroup.ProfileName.ToProfileOutput()); + + 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; + parameters = parameters.Where(p => !p.IsHidden()); + if (!parameters.Any()) + { + continue; + } + foreach (var parameter in parameters) + { + sb.Append(parameter.ToParameterOutput(variantGroup.HasMultipleVariants, parameterGroup.HasAllVariants)); + } + sb.Append(parameterGroup.Aliases.ToAliasOutput(true)); + sb.Append(parameterGroup.HasValidateNotNull.ToValidateNotNullOutput()); + sb.Append(parameterGroup.HasAllowEmptyArray.ToAllowEmptyArray()); + sb.Append(parameterGroup.CompleterInfo.ToArgumentCompleterOutput()); + sb.Append(parameterGroup.OrderCategory.ToParameterCategoryOutput()); + sb.Append(parameterGroup.InfoAttribute.ToInfoOutput(parameterGroup.ParameterType)); + sb.Append(parameterGroup.ToDefaultInfoOutput()); + sb.Append(parameterGroup.ParameterType.ToParameterTypeOutput()); + sb.Append(parameterGroup.Description.ToParameterDescriptionOutput()); + sb.Append(parameterGroup.ParameterName.ToParameterNameOutput(parameterGroups.IndexOf(parameterGroup) == parameterGroups.Count - 1)); + } + sb.Append($"){Environment.NewLine}{Environment.NewLine}"); + + sb.Append(variantGroup.ToBeginOutput()); + sb.Append(variantGroup.ToProcessOutput()); + sb.Append(variantGroup.ToEndOutput()); + + sb.Append($"}}{Environment.NewLine}"); + + Directory.CreateDirectory(variantGroup.OutputFolder); + File.WriteAllText(variantGroup.FilePath, license.ToString()); + File.AppendAllText(variantGroup.FilePath, sb.ToString()); + if (!LicenseSet.Contains(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"))) + { + // only add license in the header + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), license.ToString()); + LicenseSet.Add(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1")); + } + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), sb.ToString()); + } + + if (!ExcludeDocs) + { + var moduleInfo = new PsModuleHelpInfo(ModuleName, ModuleGuid, ModuleDescription); + foreach (var variantGroupsByProfile in variantGroups.GroupBy(vg => vg.ProfileName)) + { + var profileName = variantGroupsByProfile.Key; + var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; + var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder, AddComplexInterfaceInfo.IsPresent); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..bd13fe4954a5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -0,0 +1,191 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "Psd1")] + [DoNotExport] + public class ExportPsd1 : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CustomFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + [Parameter(Mandatory = true)] + public Guid ModuleGuid { get; set; } + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private const string CustomFolderRelative = "./custom"; + private const string Indent = Psd1Indent; + private const string Undefined = "undefined"; + private bool IsUndefined(string value) => string.Equals(Undefined, value, StringComparison.OrdinalIgnoreCase); + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + if (!Directory.Exists(CustomFolder)) + { + throw new ArgumentException($"Custom folder '{CustomFolder}' does not exist"); + } + + string version = Convert.ToString(@"0.1.0"); + // Validate the module version should be semantic version + // Following regex is official from https://semver.org/ + Regex rx = new Regex(@"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", RegexOptions.Compiled); + if (rx.Matches(version).Count != 1) + { + throw new ArgumentException("Module-version is not a valid Semantic Version"); + } + + string previewVersion = null; + if (version.Contains('-')) + { + string[] versions = version.Split("-".ToCharArray(), 2); + version = versions[0]; + previewVersion = versions[1]; + } + + var sb = new StringBuilder(); + sb.AppendLine("@{"); + sb.AppendLine($@"{GuidStart} = '{ModuleGuid}'"); + sb.AppendLine($@"{Indent}RootModule = '{"./Az.ContainerService.psm1"}'"); + sb.AppendLine($@"{Indent}ModuleVersion = '{version}'"); + sb.AppendLine($@"{Indent}CompatiblePSEditions = 'Core', 'Desktop'"); + sb.AppendLine($@"{Indent}Author = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}CompanyName = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}Copyright = '{"Microsoft Corporation. All rights reserved."}'"); + sb.AppendLine($@"{Indent}Description = '{"Microsoft Azure PowerShell: ContainerService cmdlets"}'"); + sb.AppendLine($@"{Indent}PowerShellVersion = '5.1'"); + sb.AppendLine($@"{Indent}DotNetFrameworkVersion = '4.7.2'"); + + // RequiredModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredModules = @({"undefined"})"); + } + + // RequiredAssemblies + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredAssemblies = @({"undefined"})"); + } + else + { + sb.AppendLine($@"{Indent}RequiredAssemblies = '{"./bin/Az.ContainerService.private.dll"}'"); + } + + // NestedModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}NestedModules = @({"undefined"})"); + } + + // FormatsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FormatsToProcess = @({"undefined"})"); + } + else + { + var customFormatPs1xmlFiles = Directory.GetFiles(CustomFolder) + .Where(f => f.EndsWith(".format.ps1xml")) + .Select(f => $"{CustomFolderRelative}/{Path.GetFileName(f)}"); + var formatList = customFormatPs1xmlFiles.Prepend("./Az.ContainerService.format.ps1xml").ToPsList(); + sb.AppendLine($@"{Indent}FormatsToProcess = {formatList}"); + } + + // TypesToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}TypesToProcess = @({"undefined"})"); + } + + // ScriptsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}ScriptsToProcess = @({"undefined"})"); + } + + var functionInfos = GetScriptCmdlets(ExportsFolder).ToArray(); + // FunctionsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FunctionsToExport = @({"undefined"})"); + } + else + { + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); + } + + // AliasesToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}AliasesToExport = @({"undefined"})"); + } + else + { + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } + + // CmdletsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}CmdletsToExport = @({"undefined"})"); + } + + sb.AppendLine($@"{Indent}PrivateData = @{{"); + sb.AppendLine($@"{Indent}{Indent}PSData = @{{"); + + if (previewVersion != null) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = '{previewVersion}'"); + } + sb.AppendLine($@"{Indent}{Indent}{Indent}Tags = {"Azure ResourceManager ARM PSModule ContainerService".Split(' ').ToPsList().NullIfEmpty() ?? "''"}"); + sb.AppendLine($@"{Indent}{Indent}{Indent}LicenseUri = '{"https://aka.ms/azps-license"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ProjectUri = '{"https://github.com/Azure/azure-powershell"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ReleaseNotes = ''"); + var profilesList = ""; + if (IsAzure && !String.IsNullOrEmpty(profilesList)) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Profiles = {profilesList}"); + } + + sb.AppendLine($@"{Indent}{Indent}}}"); + sb.AppendLine($@"{Indent}}}"); + sb.AppendLine(@"}"); + + File.WriteAllText(Psd1Path, sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..53508a7c44f6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/ExportTestStub.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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() + { + 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 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]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +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(@"{ + $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 + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} +"); + + + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); + + 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) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..30675c946d22 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "CommonParameter")] + [OutputType(typeof(Dictionary))] + [DoNotExport] + public class GetCommonParameter : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSCmdlet PSCmdlet { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public Dictionary PSBoundParameter { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = PSCmdlet.MyInvocation.MyCommand.ToVariants(); + var commonParameterNames = variants.ToParameterGroups() + .Where(pg => pg.OrderCategory == ParameterCategory.Azure || pg.OrderCategory == ParameterCategory.Runtime) + .Select(pg => pg.ParameterName); + if (variants.Any(v => v.SupportsShouldProcess)) + { + commonParameterNames = commonParameterNames.Append("Confirm").Append("WhatIf"); + } + if (variants.Any(v => v.SupportsPaging)) + { + commonParameterNames = commonParameterNames.Append("First").Append("Skip").Append("IncludeTotalCount"); + } + + var names = commonParameterNames.ToArray(); + var keys = PSBoundParameter.Keys.Where(k => names.Contains(k)); + WriteObject(keys.ToDictionary(key => key, key => PSBoundParameter[key]), true); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..ec484304b9d4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ModuleGuid")] + [DoNotExport] + public class GetModuleGuid : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + protected override void ProcessRecord() + { + try + { + WriteObject(ReadGuidFromPsd1(Psd1Path)); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..872521418891 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.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. + *--------------------------------------------------------------------------------------------*/ +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ScriptCmdlet")] + [OutputType(typeof(string[]))] + [DoNotExport] + public class GetScriptCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ScriptFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeDoNotExport { get; set; } + + [Parameter] + public SwitchParameter AsAlias { get; set; } + + [Parameter] + public SwitchParameter AsFunctionInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var functionInfos = GetScriptCmdlets(this, ScriptFolder) + .Where(fi => IncludeDoNotExport || !fi.ScriptBlock.Attributes.OfType().Any()) + .ToArray(); + if (AsFunctionInfo) + { + WriteObject(functionInfos, true); + return; + } + var aliases = functionInfos.SelectMany(i => i.ScriptBlock.Attributes).ToAliasNames(); + var names = functionInfos.Select(fi => fi.Name).Distinct(); + var output = (AsAlias ? aliases : names).DefaultIfEmpty("''").ToArray(); + WriteObject(output, true); + } + catch (System.Exception ee) + { + System.Console.Error.WriteLine($"{ee.GetType().Name}: {ee.Message}"); + System.Console.Error.WriteLine(ee.StackTrace); + throw ee; + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..ed6ac16e27eb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/CollectionExtensions.cs @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal static class CollectionExtensions + { + public static T[] NullIfEmpty(this T[] collection) => (collection?.Any() ?? false) ? collection : null; + public static IEnumerable EmptyIfNull(this IEnumerable collection) => collection ?? Enumerable.Empty(); + + // https://stackoverflow.com/a/4158364/294804 + public static IEnumerable DistinctBy(this IEnumerable collection, Func selector) => + collection.GroupBy(selector).Select(group => group.First()); + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..3ad59269a971 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/MarkdownRenderer.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsProxyOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal static class MarkdownRenderer + { + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder, bool AddComplexInterfaceInfo = true) + { + Directory.CreateDirectory(docsFolder); + var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); + + foreach (var markdownInfo in markdownInfos) + { + var sb = new StringBuilder(); + sb.Append(markdownInfo.ToHelpMetadataOutput()); + sb.Append($"# {markdownInfo.CmdletName}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"## SYNOPSIS{Environment.NewLine}{markdownInfo.Synopsis.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## SYNTAX{Environment.NewLine}{Environment.NewLine}"); + var hasMultipleParameterSets = markdownInfo.SyntaxInfos.Length > 1; + foreach (var syntaxInfo in markdownInfo.SyntaxInfos) + { + sb.Append(syntaxInfo.ToHelpSyntaxOutput(hasMultipleParameterSets)); + } + + sb.Append($"## DESCRIPTION{Environment.NewLine}{markdownInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## EXAMPLES{Environment.NewLine}{Environment.NewLine}"); + foreach (var exampleInfo in markdownInfo.Examples) + { + sb.Append(exampleInfo.ToHelpExampleOutput()); + } + + sb.Append($"## PARAMETERS{Environment.NewLine}{Environment.NewLine}"); + foreach (var parameter in markdownInfo.Parameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + if (markdownInfo.SupportsShouldProcess) + { + foreach (var parameter in SupportsShouldProcessParameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + } + + sb.Append($"### CommonParameters{Environment.NewLine}This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## INPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var input in markdownInfo.Inputs) + { + sb.Append($"### {input}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## OUTPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var output in markdownInfo.Outputs) + { + sb.Append($"### {output}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); + if (markdownInfo.Aliases.Any()) + { + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); + } + foreach (var alias in markdownInfo.Aliases) + { + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + } + + if (AddComplexInterfaceInfo) + { + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + + } + + sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); + foreach (var relatedLink in markdownInfo.RelatedLinks) + { + sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); + } + + WriteModulePage(moduleHelpInfo, markdownInfos, docsFolder); + } + + private static void WriteModulePage(PsModuleHelpInfo moduleInfo, MarkdownHelpInfo[] markdownInfos, string docsFolder) + { + var sb = new StringBuilder(); + sb.Append(moduleInfo.ToModulePageMetadataOutput()); + sb.Append($"# {moduleInfo.Name} Module{Environment.NewLine}"); + sb.Append($"## Description{Environment.NewLine}{moduleInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## {moduleInfo.Name} Cmdlets{Environment.NewLine}"); + foreach (var markdownInfo in markdownInfos) + { + sb.Append(markdownInfo.ToModulePageCmdletOutput()); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{moduleInfo.Name}.md"), sb.ToString()); + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..5321007fc2fc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsFormatTypes.cs @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal class ViewParameters + { + public Type Type { get; } + public IEnumerable Properties { get; } + + public ViewParameters(Type type, IEnumerable properties) + { + Type = type; + Properties = properties; + } + } + + internal class PropertyFormat + { + public PropertyInfo Property { get; } + public FormatTableAttribute FormatTable { get; } + + public int? Index { get; } + public string Label { get; } + public int? Width { get; } + public PropertyOrigin? Origin { get; } + + public PropertyFormat(PropertyInfo propertyInfo) + { + Property = propertyInfo; + FormatTable = Property.GetCustomAttributes().FirstOrDefault(); + var origin = Property.GetCustomAttributes().FirstOrDefault(); + + Index = FormatTable?.HasIndex ?? false ? (int?)FormatTable.Index : null; + Label = FormatTable?.Label ?? propertyInfo.Name; + Width = FormatTable?.HasWidth ?? false ? (int?)FormatTable.Width : null; + // If we have an index, we don't want to use Origin. + Origin = FormatTable?.HasIndex ?? false ? null : origin?.Origin; + } + } + + [Serializable] + [XmlRoot(nameof(Configuration))] + public class Configuration + { + [XmlElement("ViewDefinitions")] + public ViewDefinitions ViewDefinitions { get; set; } + } + + [Serializable] + public class ViewDefinitions + { + //https://stackoverflow.com/a/10518657/294804 + [XmlElement("View")] + public List Views { get; set; } + } + + [Serializable] + public class View + { + [XmlElement(nameof(Name))] + public string Name { get; set; } + [XmlElement(nameof(ViewSelectedBy))] + public ViewSelectedBy ViewSelectedBy { get; set; } + [XmlElement(nameof(TableControl))] + public TableControl TableControl { get; set; } + } + + [Serializable] + public class ViewSelectedBy + { + [XmlElement(nameof(TypeName))] + public string TypeName { get; set; } + } + + [Serializable] + public class TableControl + { + [XmlElement(nameof(TableHeaders))] + public TableHeaders TableHeaders { get; set; } + [XmlElement(nameof(TableRowEntries))] + public TableRowEntries TableRowEntries { get; set; } + } + + [Serializable] + public class TableHeaders + { + [XmlElement("TableColumnHeader")] + public List TableColumnHeaders { get; set; } + } + + [Serializable] + public class TableColumnHeader + { + [XmlElement(nameof(Label))] + public string Label { get; set; } + [XmlElement(nameof(Width))] + public int? Width { get; set; } + + //https://stackoverflow.com/a/4095225/294804 + public bool ShouldSerializeWidth() => Width.HasValue; + } + + [Serializable] + public class TableRowEntries + { + [XmlElement(nameof(TableRowEntry))] + public TableRowEntry TableRowEntry { get; set; } + } + + [Serializable] + public class TableRowEntry + { + [XmlElement(nameof(TableColumnItems))] + public TableColumnItems TableColumnItems { get; set; } + } + + [Serializable] + public class TableColumnItems + { + [XmlElement("TableColumnItem")] + public List TableItems { get; set; } + } + + [Serializable] + public class TableColumnItem + { + [XmlElement(nameof(PropertyName))] + public string PropertyName { get; set; } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..b949257fc199 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs @@ -0,0 +1,199 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal class HelpMetadataOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public HelpMetadataOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"--- +external help file:{(!String.IsNullOrEmpty(HelpInfo.ExternalHelpFilename) ? $" {HelpInfo.ExternalHelpFilename}" : String.Empty)} +Module Name: {HelpInfo.ModuleName} +online version: {HelpInfo.OnlineVersion} +schema: {HelpInfo.Schema.ToString(3)} +--- + +"; + } + + internal class HelpSyntaxOutput + { + public MarkdownSyntaxHelpInfo SyntaxInfo { get; } + public bool HasMultipleParameterSets { get; } + + public HelpSyntaxOutput(MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) + { + SyntaxInfo = syntaxInfo; + HasMultipleParameterSets = hasMultipleParameterSets; + } + + public override string ToString() + { + var psnText = HasMultipleParameterSets ? $"### {SyntaxInfo.ParameterSetName}{(SyntaxInfo.IsDefault ? " (Default)" : String.Empty)}{Environment.NewLine}" : String.Empty; + return $@"{psnText}``` +{SyntaxInfo.SyntaxText} +``` + +"; + } + } + + internal class HelpExampleOutput + { + private string ExampleTemplate = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + Environment.NewLine; + + private string ExampleTemplateWithOutput = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine + + "{8}" + Environment.NewLine + Environment.NewLine; + + public MarkdownExampleHelpInfo ExampleInfo { get; } + + public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) + { + ExampleInfo = exampleInfo; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(ExampleInfo.Output)) + { + return string.Format(ExampleTemplate, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleInfo.Description.ToDescriptionFormat()); + } + else + { + return string.Format(ExampleTemplateWithOutput, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter, + ExampleInfo.Description.ToDescriptionFormat()); ; + } + } + } + + internal class HelpParameterOutput + { + public MarkdownParameterHelpInfo ParameterInfo { get; } + + public HelpParameterOutput(MarkdownParameterHelpInfo parameterInfo) + { + ParameterInfo = parameterInfo; + } + + public override string ToString() + { + var pipelineInputTypes = new[] + { + ParameterInfo.AcceptsPipelineByValue ? "ByValue" : String.Empty, + ParameterInfo.AcceptsPipelineByPropertyName ? "ByPropertyName" : String.Empty + }.JoinIgnoreEmpty(", "); + var pipelineInput = ParameterInfo.AcceptsPipelineByValue || ParameterInfo.AcceptsPipelineByPropertyName + ? $@"{true} ({pipelineInputTypes})" + : false.ToString(); + + return $@"### -{ParameterInfo.Name} +{ParameterInfo.Description.ToDescriptionFormat()} + +```yaml +Type: {ParameterInfo.Type.FullName} +Parameter Sets: {(ParameterInfo.HasAllParameterSets ? "(All)" : ParameterInfo.ParameterSetNames.JoinIgnoreEmpty(", "))} +Aliases:{(ParameterInfo.Aliases.Any() ? $" {ParameterInfo.Aliases.JoinIgnoreEmpty(", ")}" : String.Empty)} + +Required: {ParameterInfo.IsRequired} +Position: {ParameterInfo.Position} +Default value: {ParameterInfo.DefaultValue} +Accept pipeline input: {pipelineInput} +Accept wildcard characters: {ParameterInfo.AcceptsWildcardCharacters} +``` + +"; + } + } + + internal class ModulePageMetadataOutput + { + public PsModuleHelpInfo ModuleInfo { get; } + + private static string HelpLinkPrefix { get; } = @"https://learn.microsoft.com/powershell/module/"; + + public ModulePageMetadataOutput(PsModuleHelpInfo moduleInfo) + { + ModuleInfo = moduleInfo; + } + + public override string ToString() => $@"--- +Module Name: {ModuleInfo.Name} +Module Guid: {ModuleInfo.Guid} +Download Help Link: {HelpLinkPrefix}{ModuleInfo.Name.ToLowerInvariant()} +Help Version: 1.0.0.0 +Locale: en-US +--- + +"; + } + + internal class ModulePageCmdletOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public ModulePageCmdletOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"### [{HelpInfo.CmdletName}]({HelpInfo.CmdletName}.md) +{HelpInfo.Synopsis.ToDescriptionFormat()} + +"; + } + + internal static class PsHelpOutputExtensions + { + public static string EscapeAngleBrackets(this string text) => text?.Replace("<", @"\<").Replace(">", @"\>"); + public static string ReplaceSentenceEndWithNewline(this string text) => text?.Replace(". ", $".{Environment.NewLine}").Replace(". ", $".{Environment.NewLine}"); + public static string ReplaceBrWithNewline(this string text) => text?.Replace("
", $"{Environment.NewLine}"); + public static string ToDescriptionFormat(this string text, bool escapeAngleBrackets = true) + { + var description = text?.ReplaceBrWithNewline(); + description = escapeAngleBrackets ? description?.EscapeAngleBrackets() : description; + return description?.ReplaceSentenceEndWithNewline().Trim(); + } + + public const string ExampleNameHeader = "### "; + public const string ExampleCodeHeader = "```powershell"; + public const string ExampleCodeFooter = "```"; + public const string ExampleOutputHeader = "```output"; + public const string ExampleOutputFooter = "```"; + + public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo); + + public static HelpSyntaxOutput ToHelpSyntaxOutput(this MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) => new HelpSyntaxOutput(syntaxInfo, hasMultipleParameterSets); + + public static HelpExampleOutput ToHelpExampleOutput(this MarkdownExampleHelpInfo exampleInfo) => new HelpExampleOutput(exampleInfo); + + public static HelpParameterOutput ToHelpParameterOutput(this MarkdownParameterHelpInfo parameterInfo) => new HelpParameterOutput(parameterInfo); + + public static ModulePageMetadataOutput ToModulePageMetadataOutput(this PsModuleHelpInfo moduleInfo) => new ModulePageMetadataOutput(moduleInfo); + + public static ModulePageCmdletOutput ToModulePageCmdletOutput(this MarkdownHelpInfo helpInfo) => new ModulePageCmdletOutput(helpInfo); + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..56d75a176542 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsHelpTypes.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal class PsHelpInfo + { + public string CmdletName { get; } + public string ModuleName { get; } + public string Synopsis { get; } + public string Description { get; } + public string AlertText { get; } + public string Category { get; } + public PsHelpLinkInfo OnlineVersion { get; } + public PsHelpLinkInfo[] RelatedLinks { get; } + public bool? HasCommonParameters { get; } + public bool? HasWorkflowCommonParameters { get; } + + public PsHelpTypeInfo[] InputTypes { get; } + public PsHelpTypeInfo[] OutputTypes { get; } + public PsHelpExampleInfo[] Examples { get; set; } + public string[] Aliases { get; } + + public PsParameterHelpInfo[] Parameters { get; } + public PsHelpSyntaxInfo[] Syntax { get; } + + public object Component { get; } + public object Functionality { get; } + public object PsSnapIn { get; } + public object Role { get; } + public string NonTerminatingErrors { get; } + + 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"); + Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? + helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); + Category = helpObject.GetProperty("Category"); + HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); + HasWorkflowCommonParameters = helpObject.GetProperty("WorkflowCommonParameters").ToNullableBool(); + + var links = helpObject.GetNestedProperty("relatedLinks", "navigationLink").EmptyIfNull().Select(nl => nl.ToLinkInfo()).ToArray(); + OnlineVersion = links.FirstOrDefault(l => l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length == 1); + RelatedLinks = links.Where(l => !l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length != 1).ToArray(); + + InputTypes = helpObject.GetNestedProperty("inputTypes", "inputType").EmptyIfNull().Select(it => it.ToTypeInfo()).ToArray(); + OutputTypes = helpObject.GetNestedProperty("returnValues", "returnValue").EmptyIfNull().Select(rv => rv.ToTypeInfo()).ToArray(); + Examples = helpObject.GetNestedProperty("examples", "example").EmptyIfNull().Select(e => e.ToExampleInfo()).ToArray(); + Aliases = helpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); + + Parameters = helpObject.GetNestedProperty("parameters", "parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + Syntax = helpObject.GetNestedProperty("syntax", "syntaxItem").EmptyIfNull().Select(si => si.ToSyntaxInfo()).ToArray(); + + Component = helpObject.GetProperty("Component"); + Functionality = helpObject.GetProperty("Functionality"); + PsSnapIn = helpObject.GetProperty("PSSnapIn"); + Role = helpObject.GetProperty("Role"); + NonTerminatingErrors = helpObject.GetProperty("nonTerminatingErrors"); + } + } + + internal class PsHelpTypeInfo + { + public string Name { get; } + public string Description { get; } + + public PsHelpTypeInfo(PSObject typeObject) + { + Name = typeObject.GetNestedProperty("type", "name").EmptyIfNull().Trim(); + Description = typeObject.GetProperty("description").EmptyIfNull().ToDescriptionText(); + } + } + + internal class PsHelpLinkInfo + { + public string Uri { get; } + public string Text { get; } + + public PsHelpLinkInfo(PSObject linkObject) + { + Uri = linkObject.GetProperty("uri"); + Text = linkObject.GetProperty("linkText"); + } + } + + internal class PsHelpSyntaxInfo + { + public string CmdletName { get; } + public PsParameterHelpInfo[] Parameters { get; } + + public PsHelpSyntaxInfo(PSObject syntaxObject) + { + CmdletName = syntaxObject.GetProperty("name"); + Parameters = syntaxObject.GetProperty("parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + } + } + + internal class PsHelpExampleInfo + { + public string Title { get; } + public string Code { get; } + public string Output { get; } + public string Remarks { get; } + + public PsHelpExampleInfo(PSObject exampleObject) + { + Title = exampleObject.GetProperty("title"); + Code = exampleObject.GetProperty("code"); + Output = exampleObject.GetProperty("output"); + Remarks = exampleObject.GetProperty("remarks").EmptyIfNull().ToDescriptionText(); + } + public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) + { + Title = markdownExample.Name; + Code = markdownExample.Code; + Output = markdownExample.Output; + Remarks = markdownExample.Description; + } + + public static implicit operator PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) => new PsHelpExampleInfo(markdownExample); + } + + internal class PsParameterHelpInfo + { + public string DefaultValueAsString { get; } + + public string Name { get; } + public string TypeName { get; } + public string Description { get; } + public string SupportsPipelineInput { get; } + public string PositionText { get; } + public string[] ParameterSetNames { get; } + public string[] Aliases { get; } + + public bool? SupportsGlobbing { get; } + public bool? IsRequired { get; } + public bool? IsVariableLength { get; } + public bool? IsDynamic { get; } + + public PsParameterHelpInfo(PSObject parameterHelpObject = null) + { + parameterHelpObject = parameterHelpObject ?? new PSObject(); + DefaultValueAsString = parameterHelpObject.GetProperty("defaultValue"); + Name = parameterHelpObject.GetProperty("name"); + TypeName = parameterHelpObject.GetProperty("parameterValue").NullIfEmpty() ?? parameterHelpObject.GetNestedProperty("type", "name"); + Description = parameterHelpObject.GetProperty("Description").EmptyIfNull().ToDescriptionText(); + SupportsPipelineInput = parameterHelpObject.GetProperty("pipelineInput"); + PositionText = parameterHelpObject.GetProperty("position"); + ParameterSetNames = parameterHelpObject.GetProperty("parameterSetName").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + Aliases = parameterHelpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + + SupportsGlobbing = parameterHelpObject.GetProperty("globbing").ToNullableBool(); + IsRequired = parameterHelpObject.GetProperty("required").ToNullableBool(); + IsVariableLength = parameterHelpObject.GetProperty("variableLength").ToNullableBool(); + IsDynamic = parameterHelpObject.GetProperty("isDynamic").ToNullableBool(); + } + } + + internal class PsModuleHelpInfo + { + public string Name { get; } + public Guid Guid { get; } + public string Description { get; } + + public PsModuleHelpInfo(PSModuleInfo moduleInfo) + : this(moduleInfo?.Name ?? String.Empty, moduleInfo?.Guid ?? Guid.NewGuid(), moduleInfo?.Description ?? String.Empty) + { + } + + public PsModuleHelpInfo(string name, Guid guid, string description) + { + Name = name; + Guid = guid; + Description = description; + } + } + + internal static class HelpTypesExtensions + { + public static PsHelpInfo ToPsHelpInfo(this PSObject helpObject) => new PsHelpInfo(helpObject); + public static PsParameterHelpInfo ToPsParameterHelpInfo(this PSObject parameterHelpObject) => new PsParameterHelpInfo(parameterHelpObject); + + public static string ToDescriptionText(this IEnumerable descriptionObject) => descriptionObject != null + ? String.Join(Environment.NewLine, descriptionObject.Select(dl => dl.GetProperty("Text").EmptyIfNull())).NullIfWhiteSpace() + : null; + public static PsHelpTypeInfo ToTypeInfo(this PSObject typeObject) => new PsHelpTypeInfo(typeObject); + public static PsHelpExampleInfo ToExampleInfo(this PSObject exampleObject) => new PsHelpExampleInfo(exampleObject); + public static PsHelpLinkInfo ToLinkInfo(this PSObject linkObject) => new PsHelpLinkInfo(linkObject); + public static PsHelpSyntaxInfo ToSyntaxInfo(this PSObject syntaxObject) => new PsHelpSyntaxInfo(syntaxObject); + public static PsModuleHelpInfo ToModuleInfo(this PSModuleInfo moduleInfo) => new PsModuleHelpInfo(moduleInfo); + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..30388d27ce78 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -0,0 +1,294 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal class MarkdownHelpInfo + { + public string ExternalHelpFilename { get; } + public string ModuleName { get; } + public string OnlineVersion { get; } + public Version Schema { get; } + + public string CmdletName { get; } + public string[] Aliases { get; } + public string Synopsis { get; } + public string Description { get; } + + public MarkdownSyntaxHelpInfo[] SyntaxInfos { get; } + public MarkdownExampleHelpInfo[] Examples { get; } + public MarkdownParameterHelpInfo[] Parameters { get; } + + public string[] Inputs { get; } + public string[] Outputs { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + public string[] RelatedLinks { get; } + + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "") + { + ExternalHelpFilename = externalHelpFilename; + ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName; + var helpInfo = variantGroup.HelpInfo; + var commentInfo = variantGroup.CommentInfo; + Schema = Version.Parse("2.0.0"); + + CmdletName = variantGroup.CmdletName; + Aliases = (variantGroup.Aliases.NullIfEmpty() ?? helpInfo.Aliases).Where(a => a != "None").ToArray(); + Synopsis = commentInfo.Synopsis; + Description = commentInfo.Description; + + SyntaxInfos = variantGroup.Variants + .Select(v => new MarkdownSyntaxHelpInfo(v, variantGroup.ParameterGroups, v.VariantName == variantGroup.DefaultParameterSetName)) + .OrderByDescending(v => v.IsDefault).ThenBy(v => v.ParameterSetName).ToArray(); + Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty() + ?? helpInfo.Examples.Select(e => e.ToExampleHelpInfo()).ToArray().NullIfEmpty() + ?? DefaultExampleHelpInfos; + + Parameters = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && !pg.Parameters.All(p => p.IsHidden())) + .Select(pg => new MarkdownParameterHelpInfo( + variantGroup.Variants.SelectMany(v => v.HelpInfo.Parameters).Where(phi => phi.Name == pg.ParameterName).ToArray(), pg)) + .OrderBy(phi => phi.Name).ToArray(); + + Inputs = commentInfo.Inputs; + Outputs = commentInfo.Outputs; + + ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; + OnlineVersion = commentInfo.OnlineVersion; + RelatedLinks = commentInfo.RelatedLinks; + + SupportsShouldProcess = variantGroup.SupportsShouldProcess; + SupportsPaging = variantGroup.SupportsPaging; + } + + private MarkdownExampleHelpInfo[] GetExamplesFromMarkdown(string examplesFolder) + { + var filePath = Path.Combine(examplesFolder, $"{CmdletName}.md"); + if (!Directory.Exists(examplesFolder) || !File.Exists(filePath)) return null; + + var lines = File.ReadAllLines(filePath); + var nameIndices = lines.Select((l, i) => l.StartsWith(ExampleNameHeader) ? i : -1).Where(i => i != -1).ToArray(); + //https://codereview.stackexchange.com/a/187148/68772 + var indexCountGroups = nameIndices.Skip(1).Append(lines.Length).Zip(nameIndices, (next, current) => (NameIndex: current, LineCount: next - current)); + var exampleGroups = indexCountGroups.Select(icg => lines.Skip(icg.NameIndex).Take(icg.LineCount).ToArray()); + return exampleGroups.Select(eg => + { + var name = eg.First().Replace(ExampleNameHeader, String.Empty); + var codeStartIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var codeEndIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i != codeStartIndex); + var code = codeStartIndex.HasValue && codeEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1))) + : String.Empty; + var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex); + var output = outputStartIndex.HasValue && outputEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1))) + : String.Empty; + var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1; + descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex; + var descriptionEndIndex = eg.Length - 1; + descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex; + var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex)); + return new MarkdownExampleHelpInfo(name, code, output, description); + }).ToArray(); + } + } + + internal class MarkdownSyntaxHelpInfo + { + public Variant Variant { get; } + public bool IsDefault { get; } + public string ParameterSetName { get; } + public Parameter[] Parameters { get; } + public string SyntaxText { get; } + + public MarkdownSyntaxHelpInfo(Variant variant, ParameterGroup[] parameterGroups, bool isDefault) + { + Variant = variant; + IsDefault = isDefault; + ParameterSetName = Variant.VariantName; + Parameters = Variant.Parameters + .Where(p => !p.DontShow && !p.IsHidden()).OrderByDescending(p => p.IsMandatory) + //https://stackoverflow.com/a/6461526/294804 + .ThenByDescending(p => p.Position.HasValue).ThenBy(p => p.Position) + // Use the OrderCategory of the parameter group because the final order category is the highest of the group, and not the order category of the individual parameters from the variants. + .ThenBy(p => parameterGroups.First(pg => pg.ParameterName == p.ParameterName).OrderCategory).ThenBy(p => p.ParameterName).ToArray(); + SyntaxText = CreateSyntaxFormat(); + } + + //https://github.com/PowerShell/platyPS/blob/a607a926bfffe1e1a1e53c19e0057eddd0c07611/src/Markdown.MAML/Renderer/Markdownv2Renderer.cs#L29-L32 + private const int SyntaxLineWidth = 110; + private string CreateSyntaxFormat() + { + var parameterStrings = Parameters.Select(p => p.ToPropertySyntaxOutput().ToString()); + if (Variant.SupportsShouldProcess) + { + parameterStrings = parameterStrings.Append(" [-Confirm]").Append(" [-WhatIf]"); + } + parameterStrings = parameterStrings.Append(" []"); + + var lines = new List(20); + return parameterStrings.Aggregate(Variant.CmdletName, (current, ps) => + { + var combined = current + ps; + if (combined.Length <= SyntaxLineWidth) return combined; + + lines.Add(current); + return ps; + }, last => + { + lines.Add(last); + return String.Join(Environment.NewLine, lines); + }); + } + } + + internal class MarkdownExampleHelpInfo + { + public string Name { get; } + public string Code { get; } + public string Output { get; } + public string Description { get; } + + public MarkdownExampleHelpInfo(string name, string code, string output, string description) + { + Name = name; + Code = code; + Output = output; + Description = description; + } + } + + internal class MarkdownParameterHelpInfo + { + public string Name { get; set; } + public string Description { get; set; } + public Type Type { get; set; } + public string Position { get; set; } + public string DefaultValue { get; set; } + + public bool HasAllParameterSets { get; set; } + public string[] ParameterSetNames { get; set; } + public string[] Aliases { get; set; } + + public bool IsRequired { get; set; } + public bool IsDynamic { get; set; } + public bool AcceptsPipelineByValue { get; set; } + public bool AcceptsPipelineByPropertyName { get; set; } + public bool AcceptsWildcardCharacters { get; set; } + + // For use by common parameters that have no backing data in the objects themselves. + public MarkdownParameterHelpInfo() { } + + public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, ParameterGroup parameterGroup) + { + Name = parameterGroup.ParameterName; + Description = parameterGroup.Description.NullIfEmpty() + ?? parameterHelpInfos.Select(phi => phi.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + Type = parameterGroup.ParameterType; + Position = parameterGroup.FirstPosition?.ToString() + ?? parameterHelpInfos.Select(phi => phi.PositionText).FirstOrDefault(d => !String.IsNullOrEmpty(d)).ToUpperFirstCharacter().NullIfEmpty() + ?? "Named"; + // This no longer uses firstHelpInfo.DefaultValueAsString since it seems to be broken. For example, it has a value of 0 for Int32, but no default value was declared. + DefaultValue = parameterGroup.DefaultInfo?.Script ?? "None"; + + HasAllParameterSets = parameterGroup.HasAllVariants; + ParameterSetNames = (parameterGroup.Parameters.Select(p => p.VariantName).ToArray().NullIfEmpty() + ?? parameterHelpInfos.SelectMany(phi => phi.ParameterSetNames).Distinct()) + .OrderBy(psn => psn).ToArray(); + Aliases = parameterGroup.Aliases.NullIfEmpty() ?? parameterHelpInfos.SelectMany(phi => phi.Aliases).ToArray(); + + IsRequired = parameterHelpInfos.Select(phi => phi.IsRequired).FirstOrDefault(r => r == true) ?? parameterGroup.Parameters.Any(p => p.IsMandatory); + IsDynamic = parameterHelpInfos.Select(phi => phi.IsDynamic).FirstOrDefault(d => d == true) ?? false; + AcceptsPipelineByValue = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByValue")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipeline; + AcceptsPipelineByPropertyName = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByPropertyName")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipelineByPropertyName; + AcceptsWildcardCharacters = parameterGroup.SupportsWildcards; + } + } + + 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 }}"), + }; + + public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = + { + new MarkdownParameterHelpInfo + { + Name = "Confirm", + Description ="Prompts you for confirmation before running the cmdlet.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "cf" } + }, + new MarkdownParameterHelpInfo + { + Name = "WhatIf", + Description ="Shows what would happen if the cmdlet runs. The cmdlet is not run.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "wi" } + } + }; + + public static MarkdownParameterHelpInfo[] SupportsPagingParameters = + { + new MarkdownParameterHelpInfo + { + Name = "First", + Description ="Gets only the first 'n' objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "IncludeTotalCount", + Description ="Reports the number of objects in the data set (an integer) followed by the objects. If the cmdlet cannot determine the total count, it returns \"Unknown total count\".", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "Skip", + Description ="Ignores the first 'n' objects and then gets the remaining objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + } + }; + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..2f417b5b995f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -0,0 +1,635 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal class OutputTypeOutput + { + public PSTypeName[] OutputTypes { get; } + + public OutputTypeOutput(IEnumerable outputTypes) + { + OutputTypes = outputTypes.ToArray(); + } + + public override string ToString() => OutputTypes != null && OutputTypes.Any() ? $"[OutputType({OutputTypes.Select(ot => $"[{ot}]").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class CmdletBindingOutput + { + public VariantGroup VariantGroup { get; } + + public CmdletBindingOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + + public override string ToString() + { + var dpsText = VariantGroup.DefaultParameterSetName.IsValidDefaultParameterSetName() ? $"DefaultParameterSetName='{VariantGroup.DefaultParameterSetName}'" : String.Empty; + var sspText = VariantGroup.SupportsShouldProcess ? $"SupportsShouldProcess{ItemSeparator}ConfirmImpact='Medium'" : String.Empty; + var pbText = $"PositionalBinding={false.ToPsBool()}"; + var propertyText = new[] { dpsText, pbText, sspText }.JoinIgnoreEmpty(ItemSeparator); + return $"[CmdletBinding({propertyText})]{Environment.NewLine}"; + } + } + + internal class ParameterOutput + { + public Parameter Parameter { get; } + public bool HasMultipleVariantsInVariantGroup { get; } + public bool HasAllVariantsInParameterGroup { get; } + + public ParameterOutput(Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) + { + Parameter = parameter; + HasMultipleVariantsInVariantGroup = hasMultipleVariantsInVariantGroup; + HasAllVariantsInParameterGroup = hasAllVariantsInParameterGroup; + } + + public override string ToString() + { + var psnText = HasMultipleVariantsInVariantGroup && !HasAllVariantsInParameterGroup ? $"ParameterSetName='{Parameter.VariantName}'" : String.Empty; + var positionText = Parameter.Position != null ? $"Position={Parameter.Position}" : String.Empty; + var mandatoryText = Parameter.IsMandatory ? "Mandatory" : String.Empty; + var dontShowText = Parameter.DontShow ? "DontShow" : String.Empty; + var vfpText = Parameter.ValueFromPipeline ? "ValueFromPipeline" : String.Empty; + var vfpbpnText = Parameter.ValueFromPipelineByPropertyName ? "ValueFromPipelineByPropertyName" : String.Empty; + var propertyText = new[] { psnText, positionText, mandatoryText, dontShowText, vfpText, vfpbpnText }.JoinIgnoreEmpty(ItemSeparator); + return $"{Indent}[Parameter({propertyText})]{Environment.NewLine}"; + } + } + + internal class AliasOutput + { + public string[] Aliases { get; } + public bool IncludeIndent { get; } + + public AliasOutput(string[] aliases, bool includeIndent = false) + { + Aliases = aliases; + IncludeIndent = includeIndent; + } + + public override string ToString() => Aliases?.Any() ?? false ? $"{(IncludeIndent ? Indent : String.Empty)}[Alias({Aliases.Select(an => $"'{an}'").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class ValidateNotNullOutput + { + public bool HasValidateNotNull { get; } + + public ValidateNotNullOutput(bool hasValidateNotNull) + { + HasValidateNotNull = hasValidateNotNull; + } + + public override string ToString() => HasValidateNotNull ? $"{Indent}[ValidateNotNull()]{Environment.NewLine}" : String.Empty; + } + + internal class AllowEmptyArrayOutput + { + public bool HasAllowEmptyArray { get; } + + public AllowEmptyArrayOutput(bool hasAllowEmptyArray) + { + HasAllowEmptyArray = hasAllowEmptyArray; + } + + public override string ToString() => HasAllowEmptyArray ? $"{Indent}[AllowEmptyCollection()]{Environment.NewLine}" : String.Empty; + } + internal class ArgumentCompleterOutput + { + public CompleterInfo CompleterInfo { get; } + + public ArgumentCompleterOutput(CompleterInfo completerInfo) + { + CompleterInfo = completerInfo; + } + + public override string ToString() => CompleterInfo != null + ? $"{Indent}[ArgumentCompleter({(CompleterInfo.IsTypeCompleter ? $"[{CompleterInfo.Type.Unwrap().ToPsType()}]" : $"{{{CompleterInfo.Script.ToPsSingleLine("; ")}}}")})]{Environment.NewLine}" + : String.Empty; + } + + internal class DefaultInfoOutput + { + public bool HasDefaultInfo { get; } + public DefaultInfo DefaultInfo { get; } + + public DefaultInfoOutput(ParameterGroup parameterGroup) + { + HasDefaultInfo = parameterGroup.HasDefaultInfo; + DefaultInfo = parameterGroup.DefaultInfo; + } + + public override string ToString() + { + var nameText = !String.IsNullOrEmpty(DefaultInfo?.Name) ? $"Name='{DefaultInfo?.Name}'" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(DefaultInfo?.Description) ? $"Description='{DefaultInfo?.Description.ToPsStringLiteral()}'" : String.Empty; + var scriptText = !String.IsNullOrEmpty(DefaultInfo?.Script) ? $"Script='{DefaultInfo?.Script.ToPsSingleLine("; ")}'" : String.Empty; + var propertyText = new[] { nameText, descriptionText, scriptText }.JoinIgnoreEmpty(ItemSeparator); + return HasDefaultInfo ? $"{Indent}[{typeof(DefaultInfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class ParameterTypeOutput + { + public Type ParameterType { get; } + + public ParameterTypeOutput(Type parameterType) + { + ParameterType = parameterType; + } + + public override string ToString() => $"{Indent}[{ParameterType.ToPsType()}]{Environment.NewLine}"; + } + + internal class ParameterNameOutput + { + public string ParameterName { get; } + public bool IsLast { get; } + + public ParameterNameOutput(string parameterName, bool isLast) + { + ParameterName = parameterName; + IsLast = isLast; + } + + public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}"; + } + + internal class BaseOutput + { + public VariantGroup VariantGroup { get; } + + protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + public string ClearTelemetryContext() + { + return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : ""; + } + } + + internal class BeginOutput : BaseOutput + { + public BeginOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + public string GetProcessCustomAttributesAtRuntime() + { + return VariantGroup.IsInternal ? "" : IsAzure ? $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet] +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) +{Indent}{Indent}}}" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() +{Indent}{Indent}}} +{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' +{Indent}{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"begin {{ +{Indent}try {{ +{Indent}{Indent}$outBuffer = $null +{Indent}{Indent}if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {{ +{Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 +{Indent}{Indent}}} +{Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName +{GetTelemetry()} +{GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} +{GetProcessCustomAttributesAtRuntime()} +{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} +{Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) +{Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} + +"; + + private string GetParameterSetToCmdletMapping() + { + var sb = new StringBuilder(); + sb.AppendLine($"{Indent}{Indent}$mapping = @{{"); + foreach (var variant in VariantGroup.Variants) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}{variant.VariantName} = '{variant.PrivateModuleName}\{variant.PrivateCmdletName}';"); + } + sb.Append($"{Indent}{Indent}}}"); + return sb.ToString(); + } + + private string GetDefaultValuesStatements() + { + var defaultInfos = VariantGroup.ParameterGroups.Where(pg => pg.HasDefaultInfo).Select(pg => pg.DefaultInfo).ToArray(); + var sb = new StringBuilder(); + + foreach (var defaultInfo in defaultInfos) + { + var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); + var parameterName = defaultInfo.ParameterGroup.ParameterName; + sb.AppendLine(); + //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.ContainerService.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + 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 {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.AppendLine($"{Indent}{Indent}{Indent}}}"); + sb.Append($"{Indent}{Indent}}}"); + } + else + { + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } + } + return sb.ToString(); + } + } + + internal class ProcessOutput : BaseOutput + { + public ProcessOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetFinally() + { + if (IsAzure && !VariantGroup.IsInternal) + { + return $@" +{Indent}finally {{ +{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"process {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.Process($_) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +{GetFinally()} +}} +"; + } + + internal class EndOutput : BaseOutput + { + public EndOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ContainerService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}{Indent}}} +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId +"; + } + return ""; + } + public override string ToString() => $@"end {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.End() +{GetTelemetry()} +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} +"; + } + + internal class HelpCommentOutput + { + public VariantGroup VariantGroup { get; } + public CommentInfo CommentInfo { get; } + + public HelpCommentOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + CommentInfo = variantGroup.CommentInfo; + } + + public override string ToString() + { + var inputs = String.Join(Environment.NewLine, CommentInfo.Inputs.Select(i => $".Inputs{Environment.NewLine}{i}")); + var inputsText = !String.IsNullOrEmpty(inputs) ? $"{Environment.NewLine}{inputs}" : String.Empty; + var outputs = String.Join(Environment.NewLine, CommentInfo.Outputs.Select(o => $".Outputs{Environment.NewLine}{o}")); + var outputsText = !String.IsNullOrEmpty(outputs) ? $"{Environment.NewLine}{outputs}" : String.Empty; + var notes = String.Join($"{Environment.NewLine}{Environment.NewLine}", VariantGroup.ComplexInterfaceInfos.Select(cii => cii.ToNoteOutput())); + 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 examples = ""; + foreach (var example in VariantGroup.HelpInfo.Examples) + { + examples = examples + ".Example" + "\r\n" + example.Code + "\r\n"; + } + return $@"<# +.Synopsis +{CommentInfo.Synopsis.ToDescriptionFormat(false)} +.Description +{CommentInfo.Description.ToDescriptionFormat(false)} +{examples}{inputsText}{outputsText}{notesText} +.Link +{CommentInfo.OnlineVersion}{relatedLinksText} +#> +"; + } + } + + internal class ParameterDescriptionOutput + { + public string Description { get; } + + public ParameterDescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) + ? Description.ToDescriptionFormat(false).NormalizeNewLines() + .Split(new[] { Environment.NewLine }, StringSplitOptions.None) + .Aggregate(String.Empty, (c, n) => c + $"{Indent}# {n}{Environment.NewLine}") + : String.Empty; + } + + internal class ProfileOutput + { + public string ProfileName { get; } + + public ProfileOutput(string profileName) + { + ProfileName = profileName; + } + + public override string ToString() => ProfileName != NoProfiles ? $"[{typeof(ProfileAttribute).ToPsAttributeType()}('{ProfileName}')]{Environment.NewLine}" : String.Empty; + } + + internal class DescriptionOutput + { + public string Description { get; } + + public DescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) ? $"[{typeof(DescriptionAttribute).ToPsAttributeType()}('{Description.ToPsStringLiteral()}')]{Environment.NewLine}" : String.Empty; + } + + internal class ParameterCategoryOutput + { + public ParameterCategory Category { get; } + + public ParameterCategoryOutput(ParameterCategory category) + { + Category = category; + } + + public override string ToString() => $"{Indent}[{typeof(CategoryAttribute).ToPsAttributeType()}('{Category}')]{Environment.NewLine}"; + } + + internal class InfoOutput + { + public InfoAttribute Info { get; } + public Type ParameterType { get; } + + public InfoOutput(InfoAttribute info, Type parameterType) + { + Info = info; + ParameterType = parameterType; + } + + public override string ToString() + { + // Rendering of InfoAttribute members that are not used currently + /*var serializedNameText = Info.SerializedName != null ? $"SerializedName='{Info.SerializedName}'" : String.Empty; + var readOnlyText = Info.ReadOnly ? "ReadOnly" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(Info.Description) ? $"Description='{Info.Description.ToPsStringLiteral()}'" : String.Empty;*/ + + var requiredText = Info.Required ? "Required" : String.Empty; + var unwrappedType = ParameterType.Unwrap(); + var hasValidPossibleTypes = Info.PossibleTypes.Any(pt => pt != unwrappedType); + var possibleTypesText = hasValidPossibleTypes + ? $"PossibleTypes=({Info.PossibleTypes.Select(pt => $"[{pt.ToPsType()}]").JoinIgnoreEmpty(ItemSeparator)})" + : String.Empty; + var propertyText = new[] { /*serializedNameText, */requiredText,/* readOnlyText,*/ possibleTypesText/*, descriptionText*/ }.JoinIgnoreEmpty(ItemSeparator); + return hasValidPossibleTypes ? $"{Indent}[{typeof(InfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class PropertySyntaxOutput + { + public string ParameterName { get; } + public Type ParameterType { get; } + public bool IsMandatory { get; } + public int? Position { get; } + + public bool IncludeSpace { get; } + public bool IncludeDash { get; } + + public PropertySyntaxOutput(Parameter parameter) + { + ParameterName = parameter.ParameterName; + ParameterType = parameter.ParameterType; + IsMandatory = parameter.IsMandatory; + Position = parameter.Position; + IncludeSpace = true; + IncludeDash = true; + } + + public PropertySyntaxOutput(ComplexInterfaceInfo complexInterfaceInfo) + { + ParameterName = complexInterfaceInfo.Name; + ParameterType = complexInterfaceInfo.Type; + IsMandatory = complexInterfaceInfo.Required; + Position = null; + IncludeSpace = false; + IncludeDash = false; + } + + public override string ToString() + { + var leftOptional = !IsMandatory ? "[" : String.Empty; + var leftPositional = Position != null ? "[" : String.Empty; + var rightPositional = Position != null ? "]" : String.Empty; + var type = ParameterType != typeof(SwitchParameter) ? $" <{ParameterType.ToSyntaxTypeName()}>" : String.Empty; + var rightOptional = !IsMandatory ? "]" : String.Empty; + var space = IncludeSpace ? " " : String.Empty; + var dash = IncludeDash ? "-" : String.Empty; + return $"{space}{leftOptional}{leftPositional}{dash}{ParameterName}{rightPositional}{type}{rightOptional}"; + } + } + + internal static class PsProxyOutputExtensions + { + public const string NoParameters = "__NoParameters"; + + public const string AllParameterSets = "__AllParameterSets"; + + public const string HalfIndent = " "; + + public const string Indent = HalfIndent + HalfIndent; + + public const string ItemSeparator = ", "; + + public static readonly string ComplexParameterHeader = $"COMPLEX PARAMETER PROPERTIES{Environment.NewLine}{Environment.NewLine}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.{Environment.NewLine}{Environment.NewLine}"; + + public static string ToPsBool(this bool value) => $"${value.ToString().ToLowerInvariant()}"; + + public static string ToPsType(this Type type) + { + var regex = new Regex(@"^(.*)`{1}\d+(.*)$"); + var typeText = type.ToString(); + var match = regex.Match(typeText); + return match.Success ? $"{match.Groups[1]}{match.Groups[2]}" : typeText; + } + + public static string ToPsAttributeType(this Type type) => type.ToPsType().RemoveEnd("Attribute"); + + // https://stackoverflow.com/a/5284606/294804 + private static string RemoveEnd(this string text, string suffix) => text.EndsWith(suffix) ? text.Substring(0, text.Length - suffix.Length) : text; + + public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new[] { "
", "\r\n", "\n" }); + + public static string ToPsStringLiteral(this string value) => value?.Replace("'", "''").Replace("‘", "''").Replace("’", "''").ToPsSingleLine().Trim() ?? String.Empty; + + public static string JoinIgnoreEmpty(this IEnumerable values, string separator) => String.Join(separator, values?.Where(v => !String.IsNullOrEmpty(v))); + + // https://stackoverflow.com/a/41961738/294804 + public static string ToSyntaxTypeName(this Type type) + { + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return $"{type.GetGenericArguments().First().ToSyntaxTypeName()}?"; + } + + if (type.IsGenericType) + { + var genericTypes = String.Join(ItemSeparator, type.GetGenericArguments().Select(ToSyntaxTypeName)); + return $"{type.Name.Split('`').First()}<{genericTypes}>"; + } + + return type.Name; + } + + public static OutputTypeOutput ToOutputTypeOutput(this IEnumerable outputTypes) => new OutputTypeOutput(outputTypes); + + public static CmdletBindingOutput ToCmdletBindingOutput(this VariantGroup variantGroup) => new CmdletBindingOutput(variantGroup); + + public static ParameterOutput ToParameterOutput(this Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) => new ParameterOutput(parameter, hasMultipleVariantsInVariantGroup, hasAllVariantsInParameterGroup); + + public static AliasOutput ToAliasOutput(this string[] aliases, bool includeIndent = false) => new AliasOutput(aliases, includeIndent); + + public static ValidateNotNullOutput ToValidateNotNullOutput(this bool hasValidateNotNull) => new ValidateNotNullOutput(hasValidateNotNull); + + public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); + + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + + public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); + + public static ParameterTypeOutput ToParameterTypeOutput(this Type parameterType) => new ParameterTypeOutput(parameterType); + + public static ParameterNameOutput ToParameterNameOutput(this string parameterName, bool isLast) => new ParameterNameOutput(parameterName, isLast); + + public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup); + + public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup); + + public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup); + + public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup); + + public static ParameterDescriptionOutput ToParameterDescriptionOutput(this string description) => new ParameterDescriptionOutput(description); + + public static ProfileOutput ToProfileOutput(this string profileName) => new ProfileOutput(profileName); + + public static DescriptionOutput ToDescriptionOutput(this string description) => new DescriptionOutput(description); + + public static ParameterCategoryOutput ToParameterCategoryOutput(this ParameterCategory category) => new ParameterCategoryOutput(category); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this Parameter parameter) => new PropertySyntaxOutput(parameter); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this ComplexInterfaceInfo complexInterfaceInfo) => new PropertySyntaxOutput(complexInterfaceInfo); + + public static InfoOutput ToInfoOutput(this InfoAttribute info, Type parameterType) => new InfoOutput(info, parameterType); + + public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true) + { + string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) => + $"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}"; + + var nested = complexInterfaceInfo.NestedInfos.Select(ni => + { + var nestedIndent = $"{currentIndent}{HalfIndent}"; + return ni.IsComplexInterface + ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false) + : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks); + }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, includeBackticks)); + return String.Join(Environment.NewLine, nested); + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..7c55f15f6a9f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -0,0 +1,514 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal class ProfileGroup + { + public string ProfileName { get; } + public Variant[] Variants { get; } + public string ProfileFolder { get; } + + public ProfileGroup(Variant[] variants, string profileName = NoProfiles) + { + ProfileName = profileName; + Variants = variants; + ProfileFolder = ProfileName != NoProfiles ? ProfileName : String.Empty; + } + } + + internal class VariantGroup + { + public string ModuleName { get; } + + public string RootModuleName {get => @"";} + public string CmdletName { get; } + public string CmdletVerb { get; } + public string CmdletNoun { get; } + public string ProfileName { get; } + public Variant[] Variants { get; } + public ParameterGroup[] ParameterGroups { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + + public string[] Aliases { get; } + public PSTypeName[] OutputTypes { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + public string DefaultParameterSetName { get; } + public bool HasMultipleVariants { get; } + public PsHelpInfo HelpInfo { get; } + public bool IsGenerated { get; } + public bool IsInternal { get; } + + public string OutputFolder { get; } + public string FileName { get; } + public string FilePath { get; } + + public CommentInfo CommentInfo { get; } + + public VariantGroup(string moduleName, string cmdletName, Variant[] variants, string outputFolder, string profileName = NoProfiles, bool isTest = false, bool isInternal = false) + { + ModuleName = moduleName; + CmdletName = cmdletName; + var cmdletNameParts = CmdletName.Split('-'); + CmdletVerb = cmdletNameParts.First(); + CmdletNoun = cmdletNameParts.Last(); + ProfileName = profileName; + Variants = variants; + ParameterGroups = Variants.ToParameterGroups().OrderBy(pg => pg.OrderCategory).ThenByDescending(pg => pg.IsMandatory).ToArray(); + var aliasDuplicates = ParameterGroups.SelectMany(pg => pg.Aliases) + //https://stackoverflow.com/a/18547390/294804 + .GroupBy(a => a).Where(g => g.Count() > 1).Select(g => g.Key).ToArray(); + if (aliasDuplicates.Any()) + { + throw new ParsingMetadataException($"The alias(es) [{String.Join(", ", aliasDuplicates)}] are defined on multiple parameters for cmdlet '{CmdletName}', which is not supported."); + } + ComplexInterfaceInfos = ParameterGroups.Where(pg => !pg.DontShow && pg.IsComplexInterface).OrderBy(pg => pg.ParameterName).Select(pg => pg.ComplexInterfaceInfo).ToArray(); + + Aliases = Variants.SelectMany(v => v.Attributes).ToAliasNames().ToArray(); + OutputTypes = Variants.SelectMany(v => v.Info.OutputType).Where(ot => ot.Type != null).GroupBy(ot => ot.Type).Select(otg => otg.First()).ToArray(); + SupportsShouldProcess = Variants.Any(v => v.SupportsShouldProcess); + SupportsPaging = Variants.Any(v => v.SupportsPaging); + DefaultParameterSetName = DetermineDefaultParameterSetName(); + HasMultipleVariants = Variants.Length > 1; + HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); + IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); + IsInternal = isInternal; + + OutputFolder = outputFolder; + FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; + FilePath = Path.Combine(OutputFolder, FileName); + + CommentInfo = new CommentInfo(this); + } + + private string DetermineDefaultParameterSetName() + { + var defaultParameterSet = Variants + .Select(v => v.Metadata.DefaultParameterSetName) + .LastOrDefault(dpsn => dpsn.IsValidDefaultParameterSetName()); + + if (String.IsNullOrEmpty(defaultParameterSet)) + { + var 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; + } + + return defaultParameterSet; + } + } + + internal class Variant + { + public string CmdletName { get; } + public string VariantName { get; } + public CommandInfo Info { get; } + public CommandMetadata Metadata { get; } + public PsHelpInfo HelpInfo { get; } + public bool HasParameterSets { get; } + public bool IsFunction { get; } + public string PrivateModuleName { get; } + public string PrivateCmdletName { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public Attribute[] Attributes { get; } + public Parameter[] Parameters { get; } + public Parameter[] CmdletOnlyParameters { get; } + public bool IsInternal { get; } + public bool IsDoNotExport { get; } + public string[] Profiles { get; } + + public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) + { + CmdletName = cmdletName; + VariantName = variantName; + Info = info; + HelpInfo = helpInfo ?? new PsHelpInfo(); + Metadata = metadata; + HasParameterSets = hasParameterSets; + IsFunction = Info.CommandType == CommandTypes.Function; + PrivateModuleName = Info.Source; + PrivateCmdletName = Metadata.Name; + SupportsShouldProcess = Metadata.SupportsShouldProcess; + SupportsPaging = Metadata.SupportsPaging; + + Attributes = this.ToAttributes(); + Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); + IsInternal = Attributes.OfType().Any(); + IsDoNotExport = 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(); + } + } + + internal class ParameterGroup + { + public string ParameterName { get; } + public Parameter[] Parameters { get; } + + public string[] VariantNames { get; } + public string[] AllVariantNames { get; } + public bool HasAllVariants { get; } + public Type ParameterType { get; } + public string Description { get; } + + public string[] Aliases { get; } + public bool HasValidateNotNull { get; } + public bool HasAllowEmptyArray { get; } + public CompleterInfo CompleterInfo { get; } + public DefaultInfo DefaultInfo { get; } + public bool HasDefaultInfo { get; } + public ParameterCategory OrderCategory { get; } + public bool DontShow { get; } + public bool IsMandatory { get; } + public bool SupportsWildcards { get; } + public bool IsComplexInterface { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public InfoAttribute InfoAttribute { get; } + + public int? FirstPosition { get; } + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public bool IsInputType { get; } + + public ParameterGroup(string parameterName, Parameter[] parameters, string[] allVariantNames) + { + ParameterName = parameterName; + Parameters = parameters; + + VariantNames = Parameters.Select(p => p.VariantName).ToArray(); + AllVariantNames = allVariantNames; + HasAllVariants = VariantNames.Any(vn => vn == AllParameterSets) || !AllVariantNames.Except(VariantNames).Any(); + var types = Parameters.Select(p => p.ParameterType).Distinct().ToArray(); + if (types.Length > 1) + { + throw new ParsingMetadataException($"The parameter '{ParameterName}' has multiple parameter types [{String.Join(", ", types.Select(t => t.Name))}] defined, which is not supported."); + } + ParameterType = types.First(); + Description = Parameters.Select(p => p.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + + Aliases = Parameters.SelectMany(p => p.Attributes).ToAliasNames().ToArray(); + 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.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); + DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) + ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); + HasDefaultInfo = DefaultInfo != null && !String.IsNullOrEmpty(DefaultInfo.Script); + // When DefaultInfo is present, force all parameters from this group to be optional. + if (HasDefaultInfo) + { + foreach (var parameter in Parameters) + { + parameter.IsMandatory = false; + } + } + OrderCategory = Parameters.Select(p => p.OrderCategory).Distinct().DefaultIfEmpty(ParameterCategory.Body).Min(); + DontShow = Parameters.All(p => p.DontShow); + IsMandatory = HasAllVariants && Parameters.Any(p => p.IsMandatory); + SupportsWildcards = Parameters.Any(p => p.SupportsWildcards); + IsComplexInterface = Parameters.Any(p => p.IsComplexInterface); + ComplexInterfaceInfo = Parameters.Where(p => p.IsComplexInterface).Select(p => p.ComplexInterfaceInfo).FirstOrDefault(); + InfoAttribute = Parameters.Select(p => p.InfoAttribute).First(); + + FirstPosition = Parameters.Select(p => p.Position).FirstOrDefault(p => p != null); + ValueFromPipeline = Parameters.Any(p => p.ValueFromPipeline); + ValueFromPipelineByPropertyName = Parameters.Any(p => p.ValueFromPipelineByPropertyName); + IsInputType = ValueFromPipeline || ValueFromPipelineByPropertyName; + } + } + + internal class Parameter + { + public string VariantName { get; } + public string ParameterName { get; } + public ParameterMetadata Metadata { get; } + public PsParameterHelpInfo HelpInfo { get; } + public Type ParameterType { get; } + + public Attribute[] Attributes { get; } + public ParameterCategory[] Categories { get; } + public ParameterCategory OrderCategory { get; } + public PSDefaultValueAttribute DefaultValueAttribute { get; } + public DefaultInfoAttribute DefaultInfoAttribute { get; } + public ParameterAttribute ParameterAttribute { get; } + public bool SupportsWildcards { get; } + public CompleterInfoAttribute CompleterInfoAttribute { get; } + public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public int? Position { get; } + public bool DontShow { get; } + public bool IsMandatory { get; set; } + + public InfoAttribute InfoAttribute { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public bool IsComplexInterface { get; } + public string Description { get; } + + public Parameter(string variantName, string parameterName, ParameterMetadata metadata, PsParameterHelpInfo helpInfo = null) + { + VariantName = variantName; + ParameterName = parameterName; + Metadata = metadata; + HelpInfo = helpInfo ?? new PsParameterHelpInfo(); + + Attributes = Metadata.Attributes.ToArray(); + ParameterType = Attributes.OfType().FirstOrDefault()?.Type ?? Metadata.ParameterType; + Categories = Attributes.OfType().SelectMany(ca => ca.Categories).Distinct().ToArray(); + OrderCategory = Categories.DefaultIfEmpty(ParameterCategory.Body).Min(); + DefaultValueAttribute = Attributes.OfType().FirstOrDefault(); + DefaultInfoAttribute = Attributes.OfType().FirstOrDefault(); + ParameterAttribute = Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == VariantName || pa.ParameterSetName == AllParameterSets); + if (ParameterAttribute == null) + { + throw new ParsingMetadataException($"The variant '{VariantName}' has multiple parameter sets defined, which is not supported."); + } + SupportsWildcards = Attributes.OfType().Any(); + CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + + ValueFromPipeline = ParameterAttribute.ValueFromPipeline; + ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; + Position = ParameterAttribute.Position == Int32.MinValue ? (int?)null : ParameterAttribute.Position; + DontShow = ParameterAttribute.DontShow; + 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 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); + // 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 + InfoAttribute.Description = String.IsNullOrEmpty(InfoAttribute.Description) ? description : InfoAttribute.Description; + ComplexInterfaceInfo = InfoAttribute.ToComplexInterfaceInfo(complexParameterName, ParameterType, true); + IsComplexInterface = ComplexInterfaceInfo.IsComplexInterface; + Description = $"{description}{(IsComplexInterface ? complexMessage : String.Empty)}"; + } + } + + internal class ComplexInterfaceInfo + { + public InfoAttribute InfoAttribute { get; } + + public string Name { get; } + public Type Type { get; } + public bool Required { get; } + public bool ReadOnly { get; } + public string Description { get; } + + public ComplexInterfaceInfo[] NestedInfos { get; } + public bool IsComplexInterface { get; } + + public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, bool? required, List seenTypes) + { + Name = name; + Type = type; + InfoAttribute = infoAttribute; + + Required = required ?? InfoAttribute.Required; + ReadOnly = InfoAttribute.ReadOnly; + Description = InfoAttribute.Description.ToPsSingleLine(); + + var unwrappedType = Type.Unwrap(); + var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; + (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + unwrappedType.GetInterfaces() + .Concat(InfoAttribute.PossibleTypes) + .SelectMany(pt => pt.GetProperties() + .SelectMany(pi => pi.GetCustomAttributes(true).OfType() + .Select(ia => ia.ToComplexInterfaceInfo(pi.Name, pi.PropertyType, seenTypes: seenTypes)))) + .Where(cii => !cii.ReadOnly).OrderByDescending(cii => cii.Required).ToArray(); + // https://stackoverflow.com/a/503359/294804 + var associativeArrayInnerType = Type.GetInterfaces() + .FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>)) + ?.GetTypeInfo().GetGenericArguments().First(); + if (!hasBeenSeen && associativeArrayInnerType != null) + { + var anyInfo = new InfoAttribute { Description = "This indicates any property can be added to this object." }; + NestedInfos = NestedInfos.Prepend(anyInfo.ToComplexInterfaceInfo("(Any)", associativeArrayInnerType)).ToArray(); + } + IsComplexInterface = NestedInfos.Any(); + } + } + + internal class CommentInfo + { + public string Description { get; } + public string Synopsis { get; } + + public string[] Examples { get; } + public string[] Inputs { get; } + public string[] Outputs { get; } + + public string OnlineVersion { get; } + public string[] RelatedLinks { get; } + + private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; + + public CommentInfo(VariantGroup variantGroup) + { + var helpInfo = variantGroup.HelpInfo; + Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() + ?? helpInfo.Description.EmptyIfNull(); + // 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; + + Examples = helpInfo.Examples.Select(rl => rl.Code).ToArray(); + + Inputs = (variantGroup.ParameterGroups.Where(pg => pg.IsInputType).Select(pg => pg.ParameterType.FullName).ToArray().NullIfEmpty() ?? + helpInfo.InputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(it => it.Name).ToArray()) + .Where(i => i != "None").Distinct().OrderBy(i => i).ToArray(); + Outputs = (variantGroup.OutputTypes.Select(ot => ot.Type.FullName).ToArray().NullIfEmpty() ?? + helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray()) + .Where(o => o != "None").Distinct().OrderBy(o => o).ToArray(); + + // Use root module name in the help link + var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); + OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; + RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + } + } + + internal class CompleterInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public Type Type { get; } + public bool IsTypeCompleter { get; } + + public CompleterInfo(CompleterInfoAttribute infoAttribute) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + } + + public CompleterInfo(ArgumentCompleterAttribute completerAttribute) + { + Script = completerAttribute.ScriptBlock?.ToString(); + if (completerAttribute.Type != null) + { + Type = completerAttribute.Type; + IsTypeCompleter = true; + } + } + } + + internal class DefaultInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public ParameterGroup ParameterGroup { get; } + + public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + ParameterGroup = parameterGroup; + } + + public DefaultInfo(PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) + { + Description = defaultValueAttribute.Help; + ParameterGroup = parameterGroup; + if (defaultValueAttribute.Value != null) + { + Script = defaultValueAttribute.Value.ToString(); + } + } + } + + internal static class PsProxyTypeExtensions + { + public const string NoProfiles = "__NoProfiles"; + + public static bool IsValidDefaultParameterSetName(this string parameterSetName) => + !String.IsNullOrEmpty(parameterSetName) && parameterSetName != AllParameterSets; + + public static Variant[] ToVariants(this CommandInfo info, PsHelpInfo helpInfo) + { + var metadata = new CommandMetadata(info); + var privateCmdletName = metadata.Name.Split('!').First(); + var parts = privateCmdletName.Split('_'); + return parts.Length > 1 + ? new[] { new Variant(parts[0], parts[1], info, metadata, helpInfo: helpInfo) } + // Process multiple parameter sets, so we declare a variant per parameter set. + : info.ParameterSets.Select(ps => new Variant(privateCmdletName, ps.Name, info, metadata, true, helpInfo)).ToArray(); + } + + public static Variant[] ToVariants(this CmdletAndHelpInfo info) => info.CommandInfo.ToVariants(info.HelpInfo); + + public static Variant[] ToVariants(this CommandInfo info, PSObject helpInfo = null) => info.ToVariants(helpInfo?.ToPsHelpInfo()); + + public static Parameter[] ToParameters(this Variant variant) + { + var parameters = variant.Metadata.Parameters.AsEnumerable(); + var parameterHelp = variant.HelpInfo.Parameters.AsEnumerable(); + + if (variant.HasParameterSets) + { + parameters = parameters.Where(p => p.Value.ParameterSets.Keys.Any(k => k == variant.VariantName || k == AllParameterSets)); + 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 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."; + result = result.Append(new Parameter(variant.VariantName, "First", variant.Info.Parameters["First"], parameterHelp.FirstOrDefault(ph => ph.Name == "First"))); + result = result.Append(new Parameter(variant.VariantName, "Skip", variant.Info.Parameters["Skip"], parameterHelp.FirstOrDefault(ph => ph.Name == "Skip"))); + } + return result.ToArray(); + } + + public static Attribute[] ToAttributes(this Variant variant) => variant.IsFunction + ? ((FunctionInfo)variant.Info).ScriptBlock.Attributes.ToArray() + : variant.Metadata.CommandType.GetCustomAttributes(false).Cast().ToArray(); + + public static IEnumerable ToParameterGroups(this Variant[] variants) + { + var allVariantNames = variants.Select(vg => vg.VariantName).ToArray(); + return variants + .SelectMany(v => v.Parameters) + .GroupBy(p => p.ParameterName, StringComparer.InvariantCultureIgnoreCase) + .Select(pg => new ParameterGroup(pg.Key, pg.Select(p => p).ToArray(), allVariantNames)); + } + + public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute infoAttribute, string name, Type type, bool? required = null, List seenTypes = null) + => new ComplexInterfaceInfo(name, type, infoAttribute, required, seenTypes); + + public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); + public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(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/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..a6275130ac16 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/PsAttributes.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. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService +{ + [AttributeUsage(AttributeTargets.Class)] + public class DescriptionAttribute : Attribute + { + public string Description { get; } + + public DescriptionAttribute(string description) + { + Description = description; + } + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class InternalExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class GeneratedAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotFormatAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class ProfileAttribute : Attribute + { + public string[] Profiles { get; } + + public ProfileAttribute(params string[] profiles) + { + Profiles = profiles; + } + } + + [AttributeUsage(AttributeTargets.Class)] + public class HttpPathAttribute : Attribute + { + public string Path { get; set; } + public string ApiVersion { get; set; } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class CategoryAttribute : Attribute + { + public ParameterCategory[] Categories { get; } + + public CategoryAttribute(params ParameterCategory[] categories) + { + Categories = categories; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class ExportAsAttribute : Attribute + { + public Type Type { get; set; } + + public ExportAsAttribute(Type type) + { + Type = type; + } + } + + public enum ParameterCategory + { + // Note: Order is significant + Uri = 0, + Path, + Query, + Header, + Cookie, + Body, + Azure, + Runtime + } + + [AttributeUsage(AttributeTargets.Property)] + public class OriginAttribute : Attribute + { + public PropertyOrigin Origin { get; } + + public OriginAttribute(PropertyOrigin origin) + { + Origin = origin; + } + } + + public enum PropertyOrigin + { + // Note: Order is significant + Inherited = 0, + Owned, + Inlined + } + + [AttributeUsage(AttributeTargets.Property)] + public class FormatTableAttribute : Attribute + { + public int Index { get; set; } = -1; + public bool HasIndex => Index != -1; + public string Label { get; set; } + public int Width { get; set; } = -1; + public bool HasWidth => Width != -1; + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..060cbfeed2fa --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/PsExtensions.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. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal static class PsExtensions + { + // https://stackoverflow.com/a/863944/294804 + // https://stackoverflow.com/a/4452598/294804 + // https://stackoverflow.com/a/28701974/294804 + // Note: This will unwrap nested collections, but we don't generate nested collections. + public static Type Unwrap(this Type type) + { + if (type.IsArray) + { + return type.GetElementType().Unwrap(); + } + + var typeInfo = type.GetTypeInfo(); + if (typeInfo.IsGenericType + && (typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>) || typeof(IEnumerable<>).IsAssignableFrom(type))) + { + return typeInfo.GetGenericArguments().First().Unwrap(); + } + + return type; + } + + // https://stackoverflow.com/a/863944/294804 + private static bool IsSimple(this Type type) + { + var typeInfo = type.GetTypeInfo(); + return typeInfo.IsPrimitive + || typeInfo.IsEnum + || type == typeof(string) + || type == typeof(decimal); + } + + // https://stackoverflow.com/a/32025393/294804 + private static bool HasImplicitConversion(this Type baseType, Type targetType) => + baseType.GetMethods(BindingFlags.Public | BindingFlags.Static) + .Where(mi => mi.Name == "op_Implicit" && mi.ReturnType == targetType) + .Any(mi => mi.GetParameters().FirstOrDefault()?.ParameterType == baseType); + + public static bool IsPsSimple(this Type type) + { + var unwrappedType = type.Unwrap(); + return unwrappedType.IsSimple() + || unwrappedType == typeof(SwitchParameter) + || unwrappedType == typeof(Hashtable) + || unwrappedType == typeof(PSCredential) + || unwrappedType == typeof(ScriptBlock) + || unwrappedType == typeof(DateTime) + || unwrappedType == typeof(Uri) + || unwrappedType.HasImplicitConversion(typeof(string)); + } + + public static string ToPsList(this IEnumerable items) => String.Join(", ", items.Select(i => $"'{i}'")); + + public static IEnumerable ToAliasNames(this IEnumerable attributes) => attributes.OfType().SelectMany(aa => aa.AliasNames).Distinct(); + + public static bool IsArrayAndElementTypeIsT(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return itemType.IsArray && !tType.IsArray && tType.IsAssignableFrom(itemType.GetElementType()); + } + + public static bool IsTArrayAndElementTypeIsItem(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return !itemType.IsArray && tType.IsArray && (tType.GetElementType()?.IsAssignableFrom(itemType) ?? false); + } + + public static bool IsTypeOrArrayOfType(this object item) => item is T || item.IsArrayAndElementTypeIsT() || item.IsTArrayAndElementTypeIsItem(); + + public static T NormalizeArrayType(this object item) + { + if (item is T result) + { + return result; + } + + if (item.IsArrayAndElementTypeIsT()) + { + var array = (T[])Convert.ChangeType(item, typeof(T[])); + return array.FirstOrDefault(); + } + + if (item.IsTArrayAndElementTypeIsItem()) + { + var tType = typeof(T); + var array = Array.CreateInstance(tType.GetElementType(), 1); + array.SetValue(item, 0); + return (T)Convert.ChangeType(array, tType); + } + + return default(T); + } + + public static T GetNestedProperty(this PSObject psObject, params string[] names) => psObject.Properties.GetNestedProperty(names); + + public static T GetNestedProperty(this PSMemberInfoCollection properties, params string[] names) + { + var lastName = names.Last(); + var nestedProperties = names.Take(names.Length - 1).Aggregate(properties, (p, n) => p?.GetProperty(n)?.Properties); + return nestedProperties != null ? nestedProperties.GetProperty(lastName) : default(T); + } + + public static T GetProperty(this PSObject psObject, string name) => psObject.Properties.GetProperty(name); + + public static T GetProperty(this PSMemberInfoCollection properties, string name) + { + switch (properties[name]?.Value) + { + case PSObject psObject when psObject.BaseObject is PSCustomObject && psObject.ImmediateBaseObject.IsTypeOrArrayOfType(): + return psObject.ImmediateBaseObject.NormalizeArrayType(); + case PSObject psObject when psObject.BaseObject.IsTypeOrArrayOfType(): + return psObject.BaseObject.NormalizeArrayType(); + case object value when value.IsTypeOrArrayOfType(): + return value.NormalizeArrayType(); + default: + return default(T); + } + } + + public static IEnumerable RunScript(this PSCmdlet cmdlet, string script) + => PsHelpers.RunScript(cmdlet.InvokeCommand, script); + + public static void RunScript(this PSCmdlet cmdlet, string script) + => cmdlet.RunScript(script); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, string script) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, script); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, string script) + => engineIntrinsics.RunScript(script); + + public static IEnumerable RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => PsHelpers.RunScript(cmdlet.InvokeCommand, block.ToString()); + + public static void RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => cmdlet.RunScript(block.ToString()); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, block.ToString()); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => engineIntrinsics.RunScript(block.ToString()); + + /// + /// Returns if a parameter should be hidden by checking for . + /// + /// A PowerShell parameter. + public static bool IsHidden(this Parameter parameter) + { + return parameter.Attributes.Any(attr => attr is DoNotExportAttribute); + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..817dbd2a8f0c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/PsHelpers.cs @@ -0,0 +1,105 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using Pwsh = System.Management.Automation.PowerShell; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal static class PsHelpers + { + public static IEnumerable RunScript(string script) + => Pwsh.Create().AddScript(script).Invoke(); + + public static void RunScript(string script) + => RunScript(script); + + public static IEnumerable RunScript(CommandInvocationIntrinsics cii, string script) + => cii.InvokeScript(script).Select(o => o?.BaseObject).Where(o => o != null).OfType(); + + public static void RunScript(CommandInvocationIntrinsics cii, string script) + => RunScript(cii, script); + + public static IEnumerable GetModuleCmdlets(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletsCommand = String.Join(" + ", modulePaths.Select(mp => $"(Get-Command -Module (Import-Module '{mp}' -PassThru))")); + return (cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand)) + .Where(ci => ci.CommandType != CommandTypes.Alias); + } + + public static IEnumerable GetModuleCmdlets(params string[] modulePaths) + => GetModuleCmdlets(null, modulePaths); + + public static IEnumerable GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder) + { + // https://stackoverflow.com/a/40969712/294804 + var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'"; + var getCmdletsCommand = $@" +$currentFunctions = Get-ChildItem function: +Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} +"; + return cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand); + } + + public static IEnumerable GetScriptCmdlets(string scriptFolder) + => GetScriptCmdlets(null, scriptFolder); + + public static IEnumerable GetScriptHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var importModules = String.Join(Environment.NewLine, modulePaths.Select(mp => $"Import-Module '{mp}'")); + var getHelpCommand = $@" +$currentFunctions = Get-ChildItem function: +{importModules} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} | ForEach-Object {{ Get-Help -Name $_.Name -Full }} +"; + return cmdlet?.RunScript(getHelpCommand) ?? RunScript(getHelpCommand); + } + + public static IEnumerable GetScriptHelpInfo(params string[] modulePaths) + => GetScriptHelpInfo(null, modulePaths); + + public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + 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)) + .Select(h => new CmdletAndHelpInfo { CommandInfo = (h["CommandInfo"] as PSObject)?.BaseObject as CommandInfo, HelpInfo = h["HelpInfo"] as PSObject }); + } + + public static IEnumerable GetModuleCmdletsAndHelpInfo(params string[] modulePaths) + => GetModuleCmdletsAndHelpInfo(null, modulePaths); + + public static CmdletAndHelpInfo ToCmdletAndHelpInfo(this CommandInfo commandInfo, PSObject helpInfo) => new CmdletAndHelpInfo { CommandInfo = commandInfo, HelpInfo = helpInfo }; + + public const string Psd1Indent = " "; + public const string GuidStart = Psd1Indent + "GUID"; + + public static Guid ReadGuidFromPsd1(string psd1Path) + { + var guid = Guid.NewGuid(); + if (File.Exists(psd1Path)) + { + var currentGuid = File.ReadAllLines(psd1Path) + .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .LastOrDefault()?.Replace("'", String.Empty); + guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; + } + + return guid; + } + } + + internal class CmdletAndHelpInfo + { + public CommandInfo CommandInfo { get; set; } + public PSObject HelpInfo { get; set; } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..562e4ca3b4d7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/StringExtensions.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal static class StringExtensions + { + public static string NullIfEmpty(this string text) => String.IsNullOrEmpty(text) ? null : text; + public static string NullIfWhiteSpace(this string text) => String.IsNullOrWhiteSpace(text) ? null : text; + public static string EmptyIfNull(this string text) => text ?? String.Empty; + + public static bool? ToNullableBool(this string text) => String.IsNullOrEmpty(text) ? (bool?)null : Convert.ToBoolean(text.ToLowerInvariant()); + + public static string ToUpperFirstCharacter(this string text) => String.IsNullOrEmpty(text) ? text : $"{text[0].ToString().ToUpperInvariant()}{text.Remove(0, 1)}"; + + public static string ReplaceNewLines(this string value, string replacer = " ", string[] newLineSymbols = null) + => (newLineSymbols ?? new []{ "\r\n", "\n" }).Aggregate(value.EmptyIfNull(), (current, symbol) => current.Replace(symbol, replacer)); + public static string NormalizeNewLines(this string value) => value.ReplaceNewLines("\u00A0").Replace("\u00A0", Environment.NewLine); + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..f7d1e7f352c3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/BuildTime/XmlExtensions.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal static class XmlExtensions + { + public static string ToXmlString(this T inputObject, bool excludeDeclaration = false) + { + var serializer = new XmlSerializer(typeof(T)); + //https://stackoverflow.com/a/760290/294804 + //https://stackoverflow.com/a/3732234/294804 + var namespaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty }); + var xmlSettings = new XmlWriterSettings { OmitXmlDeclaration = excludeDeclaration, Indent = true }; + using (var stringWriter = new StringWriter()) + using (var xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + serializer.Serialize(xmlWriter, inputObject, namespaces); + return stringWriter.ToString(); + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/CmdInfoHandler.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..61be22742556 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/CmdInfoHandler.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Management.Automation; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using NextDelegate = Func, Task>, Task>; + using SignalDelegate = Func, Task>; + + public class CmdInfoHandler + { + private readonly string processRecordId; + private readonly string parameterSetName; + private readonly InvocationInfo invocationInfo; + + public CmdInfoHandler(string processRecordId, InvocationInfo invocationInfo, string parameterSetName) + { + this.processRecordId = processRecordId; + this.parameterSetName = parameterSetName; + this.invocationInfo = invocationInfo; + } + + public Task SendAsync(HttpRequestMessage request, CancellationToken token, Action cancel, SignalDelegate signal, NextDelegate next) + { + request.Headers.Add("x-ms-client-request-id", processRecordId); + request.Headers.Add("CommandName", invocationInfo?.InvocationName); + request.Headers.Add("FullCommandName", invocationInfo?.MyCommand?.Name); + request.Headers.Add("ParameterSetName", parameterSetName); + + // continue with pipeline. + return next(request, token, cancel, signal); + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/ConversionException.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..35b8e410c15e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/ConversionException.cs @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal class ConversionException : Exception + { + internal ConversionException(string message) + : base(message) { } + + internal ConversionException(JsonNode node, Type targetType) + : base($"Cannot convert '{node.Type}' to a {targetType.Name}") { } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..342f49ad8f8e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/IJsonConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..b866e1e3481f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/BinaryConverter.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class BinaryConverter : JsonConverter + { + internal override JsonNode ToJson(byte[] value) => new XBinary(value); + + internal override byte[] FromJson(JsonNode node) + { + switch (node.Type) + { + case JsonType.String : return Convert.FromBase64String(node.ToString()); // Base64 Encoded + case JsonType.Binary : return ((XBinary)node).Value; + } + + throw new ConversionException(node, typeof(byte[])); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..1352743f98f3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/BooleanConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class BooleanConverter : JsonConverter + { + internal override JsonNode ToJson(bool value) => new JsonBoolean(value); + + internal override bool FromJson(JsonNode node) => (bool)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..82d423ea7b19 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DateTimeConverter.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class DateTimeConverter : JsonConverter + { + internal override JsonNode ToJson(DateTime value) + { + return new JsonDate(value); + } + + internal override DateTime FromJson(JsonNode node) => (DateTime)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..819ee49d96a2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class DateTimeOffsetConverter : JsonConverter + { + internal override JsonNode ToJson(DateTimeOffset value) => new JsonDate(value); + + internal override DateTimeOffset FromJson(JsonNode node) => (DateTimeOffset)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..b8c959eaa4cd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DecimalConverter.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class DecimalConverter : JsonConverter + { + internal override JsonNode ToJson(decimal value) => new JsonNumber(value.ToString()); + + internal override decimal FromJson(JsonNode node) + { + return (decimal)node; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..107c61423ae3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/DoubleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class DoubleConverter : JsonConverter + { + internal override JsonNode ToJson(double value) => new JsonNumber(value); + + internal override double FromJson(JsonNode node) => (double)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..bf92bd3f1cb0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/EnumConverter.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class EnumConverter : IJsonConverter + { + private readonly Type type; + + internal EnumConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + } + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + + public object FromJson(JsonNode node) + { + if (node.Type == JsonType.Number) + { + return Enum.ToObject(type, (int)node); + } + + return Enum.Parse(type, node.ToString(), ignoreCase: true); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..3ae66005dd0a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/GuidConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class GuidConverter : JsonConverter + { + internal override JsonNode ToJson(Guid value) => new JsonString(value.ToString()); + + internal override Guid FromJson(JsonNode node) => (Guid)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..84c710e1f41c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/HashSet'1Converter.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class HashSetConverter : JsonConverter> + { + internal override JsonNode ToJson(HashSet value) + { + return new XSet(value); + } + + internal override HashSet FromJson(JsonNode node) + { + var collection = node as ICollection; + + if (collection.Count == 0) return null; + + // TODO: Remove Linq depedency + return new HashSet(collection.Cast()); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..d625f6fe0978 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/Int16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class Int16Converter : JsonConverter + { + internal override JsonNode ToJson(short value) => new JsonNumber(value); + + internal override short FromJson(JsonNode node) => (short)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..da880dd26411 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/Int32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class Int32Converter : JsonConverter + { + internal override JsonNode ToJson(int value) => new JsonNumber(value); + + internal override int FromJson(JsonNode node) => (int)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..36d7d7f8bddf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/Int64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class Int64Converter : JsonConverter + { + internal override JsonNode ToJson(long value) => new JsonNumber(value); + + internal override long FromJson(JsonNode node) => (long)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..6719d6fe5c31 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/JsonArrayConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class JsonArrayConverter : JsonConverter + { + internal override JsonNode ToJson(JsonArray value) => value; + + internal override JsonArray FromJson(JsonNode node) => (JsonArray)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..d6d84874aab4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/JsonObjectConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class JsonObjectConverter : JsonConverter + { + internal override JsonNode ToJson(JsonObject value) => value; + + internal override JsonObject FromJson(JsonNode node) => (JsonObject)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..63eb5056e812 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/SingleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class SingleConverter : JsonConverter + { + internal override JsonNode ToJson(float value) => new JsonNumber(value.ToString()); + + internal override float FromJson(JsonNode node) => (float)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..a50b9b7fa3a3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/StringConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class StringConverter : JsonConverter + { + internal override JsonNode ToJson(string value) => new JsonString(value); + + internal override string FromJson(JsonNode node) => node.ToString(); + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..ba51d6338ced --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/TimeSpanConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class TimeSpanConverter : JsonConverter + { + internal override JsonNode ToJson(TimeSpan value) => new JsonString(value.ToString()); + + internal override TimeSpan FromJson(JsonNode node) => (TimeSpan)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..a91c5f045a87 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UInt16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class UInt16Converter : JsonConverter + { + internal override JsonNode ToJson(ushort value) => new JsonNumber(value); + + internal override ushort FromJson(JsonNode node) => (ushort)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..3549104ba74d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UInt32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class UInt32Converter : JsonConverter + { + internal override JsonNode ToJson(uint value) => new JsonNumber(value); + + internal override uint FromJson(JsonNode node) => (uint)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..27e781b2e971 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UInt64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class UInt64Converter : JsonConverter + { + internal override JsonNode ToJson(ulong value) => new JsonNumber(value.ToString()); + + internal override ulong FromJson(JsonNode node) => (ulong)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..f5e0269c8706 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/Instances/UriConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class UriConverter : JsonConverter + { + internal override JsonNode ToJson(Uri value) => new JsonString(value.AbsoluteUri); + + internal override Uri FromJson(JsonNode node) => (Uri)node; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..8729fe01d78c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/JsonConverter.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public abstract class JsonConverter : IJsonConverter + { + internal abstract T FromJson(JsonNode node); + + internal abstract JsonNode ToJson(T value); + + #region IConverter + + object IJsonConverter.FromJson(JsonNode node) => FromJson(node); + + JsonNode IJsonConverter.ToJson(object value) => ToJson((T)value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..18bc6d52dcf8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/JsonConverterAttribute.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class JsonConverterAttribute : Attribute + { + internal JsonConverterAttribute(Type type) + { + Converter = (IJsonConverter)Activator.CreateInstance(type); + } + + internal IJsonConverter Converter { get; } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..22837e610d3f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/JsonConverterFactory.cs @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class JsonConverterFactory + { + private static readonly Dictionary converters = new Dictionary(); + + static JsonConverterFactory() + { + AddInternal(new BooleanConverter()); + AddInternal(new DateTimeConverter()); + AddInternal(new DateTimeOffsetConverter()); + AddInternal(new BinaryConverter()); + AddInternal(new DecimalConverter()); + AddInternal(new DoubleConverter()); + AddInternal(new GuidConverter()); + AddInternal(new Int16Converter()); + AddInternal(new Int32Converter()); + AddInternal(new Int64Converter()); + AddInternal(new SingleConverter()); + AddInternal(new StringConverter()); + AddInternal(new TimeSpanConverter()); + AddInternal(new UInt16Converter()); + AddInternal(new UInt32Converter()); + AddInternal(new UInt64Converter()); + AddInternal(new UriConverter()); + + // Hash sets + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + + // JSON + + AddInternal(new JsonObjectConverter()); + AddInternal(new JsonArrayConverter()); + } + + internal static Dictionary Instances => converters; + + internal static IJsonConverter Get(Type type) + { + var details = TypeDetails.Get(type); + + if (details.JsonConverter == null) + { + throw new ConversionException($"No converter found for '{type.Name}'."); + } + + return details.JsonConverter; + } + + internal static bool TryGet(Type type, out IJsonConverter converter) + { + var typeDetails = TypeDetails.Get(type); + + converter = typeDetails.JsonConverter; + + return converter != null; + } + + private static void AddInternal(JsonConverter converter) + => converters.Add(typeof(T), converter); + + private static void AddInternal(IJsonConverter converter) + => converters.Add(typeof(T), converter); + + internal static void Add(JsonConverter converter) + { + if (converter == null) + { + throw new ArgumentNullException(nameof(converter)); + } + + AddInternal(converter); + + var type = TypeDetails.Get(); + + type.JsonConverter = converter; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..aab4432fce84 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Conversions/StringLikeConverter.cs @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class StringLikeConverter : IJsonConverter + { + private readonly Type type; + private readonly MethodInfo parseMethod; + + internal StringLikeConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + this.parseMethod = StringLikeHelper.GetParseMethod(type); + } + + public object FromJson(JsonNode node) => + parseMethod.Invoke(null, new[] { node.ToString() }); + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + } + + internal static class StringLikeHelper + { + private static readonly Type[] parseMethodParamaterTypes = new[] { typeof(string) }; + + internal static bool IsStringLike(Type type) + { + return GetParseMethod(type) != null; + } + + internal static MethodInfo GetParseMethod(Type type) + { + MethodInfo method = type.GetMethod("Parse", parseMethodParamaterTypes); + + if (method?.IsPublic != true) return null; + + return method; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..7a64b41d70f0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/IJsonSerializable.cs @@ -0,0 +1,263 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + public interface IJsonSerializable + { + JsonNode ToJson(JsonObject container = null, SerializationMode serializationMode = SerializationMode.None); + } + internal static class JsonSerializable + { + /// + /// Serializes an enumerable and returns a JsonNode. + /// + /// an IEnumerable collection of items + /// A JsonNode that contains the collection of items serialized. + private static JsonNode ToJsonValue(System.Collections.IEnumerable enumerable) + { + if (enumerable != null) + { + // is it a byte array of some kind? + if (enumerable is System.Collections.Generic.IEnumerable byteEnumerable) + { + return new XBinary(System.Linq.Enumerable.ToArray(byteEnumerable)); + } + + var hasValues = false; + // just create an array of value nodes. + var result = new XNodeArray(); + foreach (var each in enumerable) + { + // we had at least one value. + hasValues = true; + + // try to serialize it. + var node = ToJsonValue(each); + if (null != node) + { + result.Add(node); + } + } + + // if we were able to add values, (or it was just empty), return it. + if (result.Count > 0 || !hasValues) + { + return result; + } + } + + // we couldn't serialize the values. Sorry. + return null; + } + + /// + /// Serializes a valuetype to a JsonNode. + /// + /// a ValueType (ie, a primitive, enum or struct) to be serialized + /// a JsonNode with the serialized value + private static JsonNode ToJsonValue(ValueType vValue) + { + // numeric type + if (vValue is SByte || vValue is Int16 || vValue is Int32 || vValue is Int64 || vValue is Byte || vValue is UInt16 || vValue is UInt32 || vValue is UInt64 || vValue is decimal || vValue is float || vValue is double) + { + return new JsonNumber(vValue.ToString()); + } + + // boolean type + if (vValue is bool bValue) + { + return new JsonBoolean(bValue); + } + + // dates + if (vValue is DateTime dtValue) + { + return new JsonDate(dtValue); + } + + // DictionaryEntity struct type + if (vValue is System.Collections.DictionaryEntry deValue) + { + return new JsonObject { { deValue.Key.ToString(), ToJsonValue(deValue.Value) } }; + } + + // sorry, no idea. + return null; + } + /// + /// Attempts to serialize an object by using ToJson() or ToJsonString() if they exist. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + private static JsonNode TryToJsonValue(dynamic oValue) + { + object jsonValue = null; + dynamic v = oValue; + try + { + jsonValue = v.ToJson().ToString(); + } + catch + { + // no harm... + try + { + jsonValue = v.ToJsonString().ToString(); + } + catch + { + // no worries here either. + } + } + + // if we got something out, let's use it. + if (null != jsonValue) + { + // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok? + return new JsonNumber(jsonValue.ToString()); + } + + return null; + } + + /// + /// Serialize an object by using a variety of methods. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + internal static JsonNode ToJsonValue(object value) + { + // things that implement our interface are preferred. + if (value is Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IJsonSerializable jsonSerializable) + { + return jsonSerializable.ToJson(); + } + + // strings are easy. + if (value is string || value is char) + { + return new JsonString(value.ToString()); + } + + // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString ) + if (value is System.ValueType vValue) + { + return ToJsonValue(vValue) ?? TryToJsonValue(vValue) ?? new JsonString(vValue.ToString()); + } + + // dictionaries are objects that should be able to serialize + if (value is System.Collections.Generic.IDictionary dictionary) + { + return Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson(dictionary, null); + } + + // hashtables are converted to dictionaries for serialization + if (value is System.Collections.Hashtable hashtable) + { + var dict = new System.Collections.Generic.Dictionary(); + DictionaryExtensions.HashTableToDictionary(hashtable, dict); + return Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.ToJson(dict, null); + } + + // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString) + if (value is System.Collections.IEnumerable enumerableValue) + { + // some kind of enumerable value + return ToJsonValue(enumerableValue) ?? TryToJsonValue(value) ?? new JsonString(value.ToString()); + } + + // at this point, we're going to fallback to a string literal here, since we really have no idea what it is. + return new JsonString(value.ToString()); + } + + internal static JsonObject ToJson(System.Collections.Generic.Dictionary dictionary, JsonObject container) => ToJson((System.Collections.Generic.IDictionary)dictionary, container); + + /// + /// Serializes a dictionary into a JsonObject container. + /// + /// The dictionary to serailize + /// the container to serialize the dictionary into + /// the container + internal static JsonObject ToJson(System.Collections.Generic.IDictionary dictionary, JsonObject container) + { + container = container ?? new JsonObject(); + if (dictionary != null && dictionary.Count > 0) + { + foreach (var key in dictionary) + { + // currently, we don't serialize null values. + if (null != key.Value) + { + container.Add(key.Key, ToJsonValue(key.Value)); + continue; + } + } + } + return container; + } + + internal static Func> DeserializeDictionary(Func> dictionaryFactory) + { + return (node) => FromJson(node, dictionaryFactory(), (object)(DeserializeDictionary(dictionaryFactory)) as Func); + } + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.Dictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) => FromJson(json, (System.Collections.Generic.IDictionary)container, objectFactory, excludes); + + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.IDictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) + { + if (null == json) + { + return container; + } + + foreach (var key in json.Keys) + { + if (true == excludes?.Contains(key)) + { + continue; + } + + var value = json[key]; + try + { + switch (value.Type) + { + case JsonType.Null: + // skip null values. + continue; + + case JsonType.Array: + case JsonType.Boolean: + case JsonType.Date: + case JsonType.Binary: + case JsonType.Number: + case JsonType.String: + container.Add(key, (V)value.ToValue()); + break; + case JsonType.Object: + if (objectFactory != null) + { + var v = objectFactory(value as JsonObject); + if (null != v) + { + container.Add(key, v); + } + } + break; + } + } + catch + { + } + } + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonArray.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..3db448a7ecf2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonArray.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public partial class JsonArray + { + internal override object ToValue() => Count == 0 ? new object[0] : System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(this, each => each.ToValue())); + } + + +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..6de307ff5125 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonBoolean.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal partial class JsonBoolean + { + internal static JsonBoolean Create(bool? value) => value is bool b ? new JsonBoolean(b) : null; + internal bool ToBoolean() => Value; + + internal override object ToValue() => Value; + } + + +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonNode.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..c8148117b70e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonNode.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonNode + { + /// + /// Returns the content of this node as the underlying value. + /// Will default to the string representation if not overridden in child classes. + /// + /// an object with the underlying value of the node. + internal virtual object ToValue() { + return this.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..57659baa4711 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonNumber.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + using System; + + public partial class JsonNumber + { + internal static readonly DateTime EpochDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static long ToUnixTime(DateTime dateTime) + { + return (long)dateTime.Subtract(EpochDate).TotalSeconds; + } + private static DateTime FromUnixTime(long totalSeconds) + { + return EpochDate.AddSeconds(totalSeconds); + } + internal byte ToByte() => this; + internal int ToInt() => this; + internal long ToLong() => this; + internal short ToShort() => this; + internal UInt16 ToUInt16() => this; + internal UInt32 ToUInt32() => this; + internal UInt64 ToUInt64() => this; + internal decimal ToDecimal() => this; + internal double ToDouble() => this; + internal float ToFloat() => this; + + internal static JsonNumber Create(int? value) => value is int n ? new JsonNumber(n) : null; + internal static JsonNumber Create(long? value) => value is long n ? new JsonNumber(n) : null; + internal static JsonNumber Create(float? value) => value is float n ? new JsonNumber(n) : null; + internal static JsonNumber Create(double? value) => value is double n ? new JsonNumber(n) : null; + internal static JsonNumber Create(decimal? value) => value is decimal n ? new JsonNumber(n) : null; + internal static JsonNumber Create(DateTime? value) => value is DateTime date ? new JsonNumber(ToUnixTime(date)) : null; + + public static implicit operator DateTime(JsonNumber number) => FromUnixTime(number); + internal DateTime ToDateTime() => this; + + internal JsonNumber(decimal value) + { + this.value = value.ToString(); + } + internal override object ToValue() + { + if (IsInteger) + { + if (int.TryParse(this.value, out int iValue)) + { + return iValue; + } + if (long.TryParse(this.value, out long lValue)) + { + return lValue; + } + } + else + { + if (float.TryParse(this.value, out float fValue)) + { + return fValue; + } + if (double.TryParse(this.value, out double dValue)) + { + return dValue; + } + if (decimal.TryParse(this.value, out decimal dcValue)) + { + return dcValue; + } + } + return null; + } + } + + +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonObject.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..83f237d902d6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonObject.cs @@ -0,0 +1,183 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.JsonSerializable.FromJson(this, new System.Collections.Generic.Dictionary(), (obj) => obj.ToValue()); + + internal void SafeAdd(string name, Func valueFn) + { + if (valueFn != null) + { + var value = valueFn(); + if (null != value) + { + items.Add(name, value); + } + } + } + + internal void SafeAdd(string name, JsonNode value) + { + if (null != value) + { + items.Add(name, value); + } + } + + internal T NullableProperty(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; + } + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + //throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal JsonObject Property(string propertyName) + { + return PropertyT(propertyName); + } + + internal T PropertyT(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; // we're going to assume that the consumer knows what to do if null is explicity returned? + } + + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + // throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal int NumberProperty(string propertyName, ref int output) => output = this.PropertyT(propertyName)?.ToInt() ?? output; + internal float NumberProperty(string propertyName, ref float output) => output = this.PropertyT(propertyName)?.ToFloat() ?? output; + internal byte NumberProperty(string propertyName, ref byte output) => output = this.PropertyT(propertyName)?.ToByte() ?? output; + internal long NumberProperty(string propertyName, ref long output) => output = this.PropertyT(propertyName)?.ToLong() ?? output; + internal double NumberProperty(string propertyName, ref double output) => output = this.PropertyT(propertyName)?.ToDouble() ?? output; + internal decimal NumberProperty(string propertyName, ref decimal output) => output = this.PropertyT(propertyName)?.ToDecimal() ?? output; + internal short NumberProperty(string propertyName, ref short output) => output = this.PropertyT(propertyName)?.ToShort() ?? output; + internal DateTime NumberProperty(string propertyName, ref DateTime output) => output = this.PropertyT(propertyName)?.ToDateTime() ?? output; + + internal int? NumberProperty(string propertyName, ref int? output) => output = this.NullableProperty(propertyName)?.ToInt() ?? null; + internal float? NumberProperty(string propertyName, ref float? output) => output = this.NullableProperty(propertyName)?.ToFloat() ?? null; + internal byte? NumberProperty(string propertyName, ref byte? output) => output = this.NullableProperty(propertyName)?.ToByte() ?? null; + internal long? NumberProperty(string propertyName, ref long? output) => output = this.NullableProperty(propertyName)?.ToLong() ?? null; + internal double? NumberProperty(string propertyName, ref double? output) => output = this.NullableProperty(propertyName)?.ToDouble() ?? null; + internal decimal? NumberProperty(string propertyName, ref decimal? output) => output = this.NullableProperty(propertyName)?.ToDecimal() ?? null; + internal short? NumberProperty(string propertyName, ref short? output) => output = this.NullableProperty(propertyName)?.ToShort() ?? null; + + internal DateTime? NumberProperty(string propertyName, ref DateTime? output) => output = this.NullableProperty(propertyName)?.ToDateTime() ?? null; + + + internal string StringProperty(string propertyName) => this.PropertyT(propertyName)?.ToString(); + internal string StringProperty(string propertyName, ref string output) => output = this.PropertyT(propertyName)?.ToString() ?? output; + internal char StringProperty(string propertyName, ref char output) => output = this.PropertyT(propertyName)?.ToChar() ?? output; + internal char? StringProperty(string propertyName, ref char? output) => output = this.PropertyT(propertyName)?.ToChar() ?? null; + + internal DateTime StringProperty(string propertyName, ref DateTime output) => DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out output) ? output : output; + internal DateTime? StringProperty(string propertyName, ref DateTime? output) => output = DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out var o) ? o : output; + + + internal bool BooleanProperty(string propertyName, ref bool output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? output; + internal bool? BooleanProperty(string propertyName, ref bool? output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? null; + + internal T[] ArrayProperty(string propertyName, ref T[] output, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + } + return output; + } + internal T[] ArrayProperty(string propertyName, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + var output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + return output; + } + return new T[0]; + } + internal void IterateArrayProperty(string propertyName, Action deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + for (var i = 0; i < array.Count; i++) + { + deserializer(array[i]); + } + } + } + + internal Dictionary DictionaryProperty(string propertyName, ref Dictionary output, Func deserializer) + { + var dictionary = this.PropertyT(propertyName); + if (output == null) + { + output = new Dictionary(); + } + else + { + output.Clear(); + } + if (dictionary != null) + { + foreach (var key in dictionary.Keys) + { + output[key] = deserializer(dictionary[key]); + } + } + return output; + } + + internal static JsonObject Create(IDictionary source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new JsonObject(); + + foreach (var key in source.Keys) + { + result.SafeAdd(key, selector(source[key])); + } + return result; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonString.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..2bf1b3cc9327 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/JsonString.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + using System; + using System.Globalization; + using System.Linq; + + public partial class JsonString + { + internal static string DateFormat = "yyyy-MM-dd"; + internal static string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; + internal static string DateTimeRfc1123Format = "R"; + + internal static JsonString Create(string value) => value == null ? null : new JsonString(value); + internal static JsonString Create(char? value) => value is char c ? new JsonString(c.ToString()) : null; + + internal static JsonString CreateDate(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTime(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTimeRfc1123(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeRfc1123Format, CultureInfo.CurrentCulture)) : null; + + internal char ToChar() => this.Value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char(JsonString value) => value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char? (JsonString value) => value?.ToString()?.FirstOrDefault(); + + public static implicit operator DateTime(JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime); + public static implicit operator DateTime? (JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime?); + + } + + +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..dd711dd054a0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Customizations/XNodeArray.cs @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + using System; + using System.Linq; + + public partial class XNodeArray + { + internal static XNodeArray Create(T[] source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new XNodeArray(); + foreach (var item in source.Select(selector)) + { + result.SafeAdd(item); + } + return result; + } + internal void SafeAdd(JsonNode item) + { + if (item != null) + { + items.Add(item); + } + } + internal void SafeAdd(Func itemFn) + { + if (itemFn != null) + { + var item = itemFn(); + if (item != null) + { + items.Add(item); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Debugging.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..ea4fe2ac613f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Debugging.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * 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.ContainerService.Runtime +{ + internal static class AttachDebugger + { + internal static void Break() + { + while (!System.Diagnostics.Debugger.IsAttached) + { + System.Console.Error.WriteLine($"Waiting for debugger to attach to process {System.Diagnostics.Process.GetCurrentProcess().Id}"); + for (int i = 0; i < 50; i++) + { + if (System.Diagnostics.Debugger.IsAttached) + { + break; + } + System.Threading.Thread.Sleep(100); + System.Console.Error.Write("."); + } + System.Console.Error.WriteLine(); + } + System.Diagnostics.Debugger.Break(); + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/DictionaryExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..cd752fb22442 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/DictionaryExtensions.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.ContainerService.Runtime +{ + internal static class DictionaryExtensions + { + internal static void HashTableToDictionary(System.Collections.Hashtable hashtable, System.Collections.Generic.IDictionary dictionary) + { + if (null == hashtable) + { + return; + } + foreach (var each in hashtable.Keys) + { + var key = each.ToString(); + var value = hashtable[key]; + if (null != value) + { + try + { + dictionary[key] = (V)value; + } + catch + { + // Values getting dropped; not compatible with target dictionary. Not sure what to do here. + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/EventData.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/EventData.cs new file mode 100644 index 000000000000..63951d7413b8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/EventData.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + + using System; + using System.Threading; + + ///Represents the data in signaled event. + public partial class EventData + { + /// + /// The type of the event being signaled + /// + public string Id; + + /// + /// The user-ready message from the event. + /// + public string Message; + + /// + /// When the event is about a parameter, this is the parameter name. + /// Used in Validation Events + /// + public string Parameter; + + /// + /// This represents a numeric value associated with the event. + /// Use for progress-style events + /// + public double Value; + + /// + /// Any extended data for an event should be serialized and stored here. + /// + public string ExtendedData; + + /// + /// If the event triggers after the request message has been created, this will contain the Request Message (which in HTTP calls would be HttpRequestMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.RequestMessgae is HttpRequestMessage httpRequest) + /// { + /// httpRequest.Headers.Add("x-request-flavor", "vanilla"); + /// } + /// + /// + public object RequestMessage; + + /// + /// If the event triggers after the response is back, this will contain the Response Message (which in HTTP calls would be HttpResponseMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.ResponseMessage is HttpResponseMessage httpResponse){ + /// var flavor = httpResponse.Headers.GetValue("x-request-flavor"); + /// } + /// + /// + public object ResponseMessage; + + /// + /// Cancellation method for this event. + /// + /// If the event consumer wishes to cancel the request that initiated this event, call Cancel() + /// + /// + /// The original initiator of the request must provide the implementation of this. + /// + public System.Action Cancel; + } + +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/EventDataExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..eeca1c4a63df --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/EventDataExtensions.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. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using System; + + /// + /// PowerShell-specific data on top of the llc# EventData + /// + /// + /// In PowerShell, we add on the EventDataConverter to support sending events between modules. + /// Obviously, this code would need to be duplcated on both modules. + /// This is preferable to sharing a common library, as versioning makes that problematic. + /// + [System.ComponentModel.TypeConverter(typeof(EventDataConverter))] + public partial class EventData : EventArgs + { + } + + /// + /// A PowerShell PSTypeConverter to adapt an EventData object that has been passed. + /// Usually used between modules. + /// + public class EventDataConverter : System.Management.Automation.PSTypeConverter + { + public override bool CanConvertTo(object sourceValue, Type destinationType) => false; + public override object ConvertTo(object sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => null; + public override bool CanConvertFrom(dynamic sourceValue, Type destinationType) => destinationType == typeof(EventData) && CanConvertFrom(sourceValue); + public override object ConvertFrom(dynamic sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Verifies that a given object has the required members to convert it to the target type (EventData) + /// + /// Uses a dynamic type so that it is able to use the simplest code without excessive checking. + /// + /// The instance to verify + /// True, if the object has all the required parameters. + public static bool CanConvertFrom(dynamic sourceValue) + { + try + { + // check if this has *required* parameters... + sourceValue?.Id?.GetType(); + sourceValue?.Message?.GetType(); + sourceValue?.Cancel?.GetType(); + + // remaining parameters are not *required*, + // and if they have values, it will copy them at conversion time. + } + catch + { + // if anything throws an exception (because it's null, or doesn't have that member) + return false; + } + return true; + } + + /// + /// Returns result of the delegate as the expected type, or default(T) + /// + /// This isolates any exceptions from the consumer. + /// + /// A delegate that returns a value + /// The desired output type + /// The value from the function if the type is correct + private static T To(Func srcValue) + { + try { return srcValue(); } + catch { return default(T); } + } + + /// + /// Converts an incoming object to the expected type by treating the incoming object as a dynamic, and coping the expected values. + /// + /// the incoming object + /// EventData + public static EventData ConvertFrom(dynamic sourceValue) + { + return new EventData + { + Id = To(() => sourceValue.Id), + Message = To(() => sourceValue.Message), + Parameter = To(() => sourceValue.Parameter), + Value = To(() => sourceValue.Value), + RequestMessage = To(() => sourceValue.RequestMessage), + ResponseMessage = To(() => sourceValue.ResponseMessage), + Cancel = To(() => sourceValue.Cancel) + }; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/EventListener.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..dc0d40fb9fb8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/EventListener.cs @@ -0,0 +1,247 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IEventListener listener); + } + + /// + /// The IEventListener Interface defines the communication mechanism for Signaling events during a remote call. + /// + /// + /// The interface is designed to be as minimal as possible, allow for quick peeking of the event type (id) + /// and the cancellation status and provides a delegate for retrieving the event details themselves. + /// + public interface IEventListener + { + Task Signal(string id, CancellationToken token, GetEventData createMessage); + CancellationToken Token { get; } + System.Action Cancel { get; } + } + + internal static partial class Extensions + { + public static Task Signal(this IEventListener instance, string id, CancellationToken token, Func createMessage) => instance.Signal(id, token, createMessage); + public static Task Signal(this IEventListener instance, string id, CancellationToken token) => instance.Signal(id, token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, EventData message) => instance.Signal(id, token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, Func createMessage) => instance.Signal(id, instance.Token, createMessage); + public static Task Signal(this IEventListener instance, string id) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, EventData message) => instance.Signal(id, instance.Token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, System.Uri uri) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = uri.ToString(), Cancel = instance.Cancel }); + + public static async Task AssertNotNull(this IEventListener instance, string parameterName, object value) + { + if (value == null) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' should not be null", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMinimumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length < length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is less than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMaximumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length > length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is greater than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + + public static async Task AssertRegEx(this IEventListener instance, string parameterName, string value, string regularExpression) + { + if (value != null && !System.Text.RegularExpressions.Regex.Match(value, regularExpression).Success) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' does not validate against pattern /{regularExpression}/", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertEnum(this IEventListener instance, string parameterName, string value, params string[] values) + { + if (!values.Any(each => each.Equals(value))) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' is not one of ({values.Aggregate((c, e) => $"'{e}',{c}")}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertObjectIsValid(this IEventListener instance, string parameterName, object inst) + { + await (inst as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.IValidates)?.Validate(instance); + } + + public static async Task AssertIsLessThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) >= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) <= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsLessThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) > 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) < 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, Int64? value, Int64 multiple) + { + if (null != value && value % multiple != 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, double? value, double multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, decimal? value, decimal multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + } + + /// + /// An Implementation of the IEventListener that supports subscribing to events and dispatching them + /// (used for manually using the lowlevel interface) + /// + public class EventListener : CancellationTokenSource, IEnumerable>, IEventListener + { + private Dictionary calls = new Dictionary(); + public IEnumerator> GetEnumerator() => calls.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => calls.GetEnumerator(); + public EventListener() + { + } + + public new Action Cancel => base.Cancel; + private Event tracer; + + public EventListener(params (string name, Event callback)[] initializer) + { + foreach (var each in initializer) + { + Add(each.name, each.callback); + } + } + + public void Add(string name, SynchEvent callback) + { + Add(name, (message) => { callback(message); return Task.CompletedTask; }); + } + + public void Add(string name, Event callback) + { + if (callback != null) + { + if (string.IsNullOrEmpty(name)) + { + if (calls.ContainsKey(name)) + { + tracer += callback; + } + else + { + tracer = callback; + } + } + else + { + if (calls.ContainsKey(name)) + { + calls[name ?? System.String.Empty] += callback; + } + else + { + calls[name ?? System.String.Empty] = callback; + } + } + } + } + + + public async Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + using (NoSynchronizationContext) + { + if (!string.IsNullOrEmpty(id) && (calls.TryGetValue(id, out Event listener) || tracer != null)) + { + var message = createMessage(); + message.Id = id; + + await listener?.Invoke(message); + await tracer?.Invoke(message); + + if (token.IsCancellationRequested) + { + throw new OperationCanceledException($"Canceled by event {id} ", this.Token); + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Events.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Events.cs new file mode 100644 index 000000000000..646e7c84601b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Events.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + public static partial class Events + { + public const string Log = nameof(Log); + public const string Validation = nameof(Validation); + public const string ValidationWarning = nameof(ValidationWarning); + public const string AfterValidation = nameof(AfterValidation); + public const string RequestCreated = nameof(RequestCreated); + public const string ResponseCreated = nameof(ResponseCreated); + public const string URLCreated = nameof(URLCreated); + public const string Finally = nameof(Finally); + public const string HeaderParametersAdded = nameof(HeaderParametersAdded); + public const string BodyContentSet = nameof(BodyContentSet); + public const string BeforeCall = nameof(BeforeCall); + public const string BeforeResponseDispatch = nameof(BeforeResponseDispatch); + public const string FollowingNextLink = nameof(FollowingNextLink); + public const string DelayBeforePolling = nameof(DelayBeforePolling); + public const string Polling = nameof(Polling); + + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/EventsExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..3857dad87650 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/EventsExtensions.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + public static partial class Events + { + public const string CmdletProcessRecordStart = nameof(CmdletProcessRecordStart); + public const string CmdletProcessRecordAsyncStart = nameof(CmdletProcessRecordAsyncStart); + public const string CmdletException = nameof(CmdletException); + public const string CmdletGetPipeline = nameof(CmdletGetPipeline); + public const string CmdletBeforeAPICall = nameof(CmdletBeforeAPICall); + public const string CmdletBeginProcessing = nameof(CmdletBeginProcessing); + public const string CmdletEndProcessing = nameof(CmdletEndProcessing); + public const string CmdletProcessRecordEnd = nameof(CmdletProcessRecordEnd); + public const string CmdletProcessRecordAsyncEnd = nameof(CmdletProcessRecordAsyncEnd); + public const string CmdletAfterAPICall = nameof(CmdletAfterAPICall); + + public const string Verbose = nameof(Verbose); + public const string Debug = nameof(Debug); + public const string Information = nameof(Information); + public const string Error = nameof(Error); + public const string Warning = nameof(Warning); + } + +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Extensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..1043a3466966 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Extensions.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using System.Linq; + using System; + + internal static partial class Extensions + { + public static T[] SubArray(this T[] array, int offset, int length) + { + return new ArraySegment(array, offset, length) + .ToArray(); + } + + public static T ReadHeaders(this T instance, global::System.Net.Http.Headers.HttpResponseHeaders headers) where T : class + { + (instance as IHeaderSerializable)?.ReadHeaders(headers); + return instance; + } + + internal static bool If(T input, out T output) + { + if (null == input) + { + output = default(T); + return false; + } + output = input; + return true; + } + + internal static void AddIf(T value, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(value); + } + } + + internal static void AddIf(T value, string serializedName, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(serializedName, value); + } + } + + /// + /// Returns the first header value as a string from an HttpReponseMessage. + /// + /// the HttpResponseMessage to fetch a header from + /// the header name + /// the first header value as a string from an HttpReponseMessage. string.empty if there is no header value matching + internal static string GetFirstHeader(this System.Net.Http.HttpResponseMessage response, string headerName) => response.Headers.FirstOrDefault(each => string.Equals(headerName, each.Key, System.StringComparison.OrdinalIgnoreCase)).Value?.FirstOrDefault() ?? string.Empty; + + /// + /// Sets the Synchronization Context to null, and returns an IDisposable that when disposed, + /// will restore the synchonization context to the original value. + /// + /// This is used a less-invasive means to ensure that code in the library that doesn't + /// need to be continued in the original context doesn't have to have ConfigureAwait(false) + /// on every single await + /// + /// If the SynchronizationContext is null when this is used, the resulting IDisposable + /// will not do anything (this prevents excessive re-setting of the SynchronizationContext) + /// + /// Usage: + /// + /// using(NoSynchronizationContext) { + /// await SomeAsyncOperation(); + /// await SomeOtherOperation(); + /// } + /// + /// + /// + /// An IDisposable that will return the SynchronizationContext to original state + internal static System.IDisposable NoSynchronizationContext => System.Threading.SynchronizationContext.Current == null ? Dummy : new NoSyncContext(); + + /// + /// An instance of the Dummy IDispoable. + /// + /// + internal static System.IDisposable Dummy = new DummyDisposable(); + + /// + /// An IDisposable that does absolutely nothing. + /// + internal class DummyDisposable : System.IDisposable + { + public void Dispose() + { + } + } + /// + /// An IDisposable that saves the SynchronizationContext,sets it to null and + /// restores it to the original upon Dispose(). + /// + /// NOTE: This is designed to be less invasive than using .ConfigureAwait(false) + /// on every single await in library code (ie, places where we know we don't need + /// to continue in the same context as we went async) + /// + internal class NoSyncContext : System.IDisposable + { + private System.Threading.SynchronizationContext original = System.Threading.SynchronizationContext.Current; + internal NoSyncContext() + { + System.Threading.SynchronizationContext.SetSynchronizationContext(null); + } + public void Dispose() => System.Threading.SynchronizationContext.SetSynchronizationContext(original); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..6e1addd9aa78 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal static class StringBuilderExtensions + { + /// + /// Extracts the buffered value and resets the buffer + /// + internal static string Extract(this StringBuilder builder) + { + var text = builder.ToString(); + + builder.Clear(); + + return text; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..2e0b5d9a63ac --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/Extensions/TypeExtensions.cs @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal static class TypeExtensions + { + internal static bool IsNullable(this Type type) => + type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable<>)); + + internal static Type GetOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition() == openGenericInterfaceType) + { + return candidateType; + } + + // Check if it references it's own converter.... + + foreach (Type interfaceType in candidateType.GetInterfaces()) + { + if (interfaceType.IsGenericType + && interfaceType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return interfaceType; + } + } + + return null; + } + + // Author: Sebastian Good + // http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type + internal static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + if (candidateType.Equals(openGenericInterfaceType)) + { + return true; + } + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return true; + } + + foreach (Type i in candidateType.GetInterfaces()) + { + if (i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType)) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/Seperator.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..0cfe9f7527e0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/Seperator.cs @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..de7469b8a9e1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/TypeDetails.cs @@ -0,0 +1,116 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + + + + internal class TypeDetails + { + private readonly Type info; + + internal TypeDetails(Type info) + { + this.info = info ?? throw new ArgumentNullException(nameof(info)); + } + + internal Type NonNullType { get; set; } + + internal object DefaultValue { get; set; } + + internal bool IsNullable { get; set; } + + internal bool IsList { get; set; } + + internal bool IsStringLike { get; set; } + + internal bool IsEnum => info.IsEnum; + + internal bool IsArray => info.IsArray; + + internal bool IsValueType => info.IsValueType; + + internal Type ElementType { get; set; } + + internal IJsonConverter JsonConverter { get; set; } + + #region Creation + + private static readonly ConcurrentDictionary cache = new ConcurrentDictionary(); + + internal static TypeDetails Get() => Get(typeof(T)); + + internal static TypeDetails Get(Type type) => cache.GetOrAdd(type, Create); + + private static TypeDetails Create(Type type) + { + var isGenericList = !type.IsPrimitive && type.ImplementsOpenGenericInterface(typeof(IList<>)); + var isList = !type.IsPrimitive && (isGenericList || typeof(IList).IsAssignableFrom(type)); + + var isNullable = type.IsNullable(); + + Type elementType; + + if (type.IsArray) + { + elementType = type.GetElementType(); + } + else if (isGenericList) + { + var iList = type.GetOpenGenericInterface(typeof(IList<>)); + + elementType = iList.GetGenericArguments()[0]; + } + else + { + elementType = null; + } + + var nonNullType = isNullable ? type.GetGenericArguments()[0] : type; + + var isStringLike = false; + + IJsonConverter converter; + + var jsonConverterAttribute = type.GetCustomAttribute(); + + if (jsonConverterAttribute != null) + { + converter = jsonConverterAttribute.Converter; + } + else if (nonNullType.IsEnum) + { + converter = new EnumConverter(nonNullType); + } + else if (JsonConverterFactory.Instances.TryGetValue(nonNullType, out converter)) + { + } + else if (StringLikeHelper.IsStringLike(nonNullType)) + { + isStringLike = true; + + converter = new StringLikeConverter(nonNullType); + } + + return new TypeDetails(nonNullType) { + NonNullType = nonNullType, + DefaultValue = type.IsValueType ? Activator.CreateInstance(type) : null, + IsNullable = isNullable, + IsList = isList, + IsStringLike = isStringLike, + ElementType = elementType, + JsonConverter = converter + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/XHelper.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..f565fd10d5bb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Helpers/XHelper.cs @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal static class XHelper + { + internal static JsonNode Create(JsonType type, TypeCode code, object value) + { + switch (type) + { + case JsonType.Binary : return new XBinary((byte[])value); + case JsonType.Boolean : return new JsonBoolean((bool)value); + case JsonType.Number : return new JsonNumber(value.ToString()); + case JsonType.String : return new JsonString((string)value); + } + + throw new Exception($"JsonType '{type}' does not have a fast conversion"); + } + + internal static bool TryGetElementType(TypeCode code, out JsonType type) + { + switch (code) + { + case TypeCode.Boolean : type = JsonType.Boolean; return true; + case TypeCode.Byte : type = JsonType.Number; return true; + case TypeCode.DateTime : type = JsonType.Date; return true; + case TypeCode.Decimal : type = JsonType.Number; return true; + case TypeCode.Double : type = JsonType.Number; return true; + case TypeCode.Empty : type = JsonType.Null; return true; + case TypeCode.Int16 : type = JsonType.Number; return true; + case TypeCode.Int32 : type = JsonType.Number; return true; + case TypeCode.Int64 : type = JsonType.Number; return true; + case TypeCode.SByte : type = JsonType.Number; return true; + case TypeCode.Single : type = JsonType.Number; return true; + case TypeCode.String : type = JsonType.String; return true; + case TypeCode.UInt16 : type = JsonType.Number; return true; + case TypeCode.UInt32 : type = JsonType.Number; return true; + case TypeCode.UInt64 : type = JsonType.Number; return true; + } + + type = default; + + return false; + } + + internal static JsonType GetElementType(TypeCode code) + { + switch (code) + { + case TypeCode.Boolean : return JsonType.Boolean; + case TypeCode.Byte : return JsonType.Number; + case TypeCode.DateTime : return JsonType.Date; + case TypeCode.Decimal : return JsonType.Number; + case TypeCode.Double : return JsonType.Number; + case TypeCode.Empty : return JsonType.Null; + case TypeCode.Int16 : return JsonType.Number; + case TypeCode.Int32 : return JsonType.Number; + case TypeCode.Int64 : return JsonType.Number; + case TypeCode.SByte : return JsonType.Number; + case TypeCode.Single : return JsonType.Number; + case TypeCode.String : return JsonType.String; + case TypeCode.UInt16 : return JsonType.Number; + case TypeCode.UInt32 : return JsonType.Number; + case TypeCode.UInt64 : return JsonType.Number; + default : return JsonType.Object; + } + + throw new Exception($"TypeCode '{code}' does not have a fast converter"); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/HttpPipeline.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..9131dba4f833 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/HttpPipeline.cs @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + using GetEventData = System.Func; + using NextDelegate = System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + + using SignalDelegate = System.Func, System.Threading.Tasks.Task>; + using GetParameterDelegate = System.Func, string, object>; + using SendAsyncStepDelegate = System.Func, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + using PipelineChangeDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>; + using ModuleLoadPipelineDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + using NewRequestPipelineDelegate = System.Action, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + +/* + public class DelegateBasedEventListener : IEventListener + { + private EventListenerDelegate _listener; + public DelegateBasedEventListener(EventListenerDelegate listener) + { + _listener = listener; + } + public CancellationToken Token => CancellationToken.None; + public System.Action Cancel => () => { }; + + + public Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + return _listener(id, token, () => createMessage()); + } + } +*/ + /// + /// This is a necessary extension to the SendAsyncFactory to support the 'generic' delegate format. + /// + public partial class SendAsyncFactory + { + /// + /// This translates a generic-defined delegate for a listener into one that fits our ISendAsync pattern. + /// (Provided to support out-of-module delegation for Azure Cmdlets) + /// + /// The Pipeline Step as a delegate + public SendAsyncFactory(SendAsyncStepDelegate step) => this.implementation = (request, listener, next) => + step( + request, + listener.Token, + listener.Cancel, + (id, token, getEventData) => listener.Signal(id, token, () => { + var data = EventDataConverter.ConvertFrom( getEventData() ) as EventData; + data.Id = id; + data.Cancel = listener.Cancel; + data.RequestMessage = request; + return data; + }), + (req, token, cancel, listenerDelegate) => next.SendAsync(req, listener)); + } + + public partial class HttpPipeline : ISendAsync + { + public HttpPipeline Append(SendAsyncStepDelegate item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStepDelegate item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/containerservice.DefaultTag/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..e61939f2ba92 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/HttpPipelineMocking.ps1 @@ -0,0 +1,110 @@ +$ErrorActionPreference = "Stop" + +# get the recording path +if (-not $TestRecordingFile) { + $TestRecordingFile = Join-Path $PSScriptRoot 'recording.json' +} + +# create the Http Pipeline Recorder +$Mock = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PipelineMock $TestRecordingFile + +# set the recorder to the appropriate mode (default to 'live') +Write-Host -ForegroundColor Green "Running '$TestMode' mode..." +switch ($TestMode) { + 'record' { + Write-Host -ForegroundColor Green "Recording to $TestRecordingFile" + $Mock.SetRecord() + $null = erase -ea 0 $TestRecordingFile + } + 'playback' { + if (-not (Test-Path $TestRecordingFile)) { + Write-Host -fore:yellow "Recording file '$TestRecordingFile' is not present. Tests expecting recorded responses will fail" + } else { + Write-Host -ForegroundColor Green "Using recording $TestRecordingFile" + } + $Mock.SetPlayback() + $Mock.ForceResponseHeaders["Retry-After"] = "0"; + } + default: { + $Mock.SetLive() + } +} + +# overrides for Pester Describe/Context/It + +function Describe( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushDescription($Name) + try { + return pester\Describe -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopDescription() + } +} + +function Context( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushContext($Name) + try { + return pester\Context -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopContext() + } +} + +function It { + [CmdletBinding(DefaultParameterSetName = 'Normal')] + param( + [Parameter(Mandatory = $true, Position = 0)] + [string]$Name, + + [Parameter(Position = 1)] + [ScriptBlock] $Test = { }, + + [System.Collections.IDictionary[]] $TestCases, + + [Parameter(ParameterSetName = 'Pending')] + [Switch] $Pending, + + [Parameter(ParameterSetName = 'Skip')] + [Alias('Ignore')] + [Switch] $Skip + ) + $Mock.PushScenario($Name) + + try { + if ($skip) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Skip + } + if ($pending) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Pending + } + return pester\It -Name $Name -Test $Test -TestCases $TestCases + } + finally { + $null = $Mock.PopScenario() + } +} + +# set the HttpPipelineAppend for all the cmdlets +$PSDefaultParameterValues["*:HttpPipelinePrepend"] = $Mock diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/IAssociativeArray.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..3c0876ab492b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/IAssociativeArray.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +#define DICT_PROPERTIES +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + /// A subset of IDictionary that doesn't implement IEnumerable or IDictionary to work around PowerShell's aggressive formatter + public interface IAssociativeArray + { +#if DICT_PROPERTIES + System.Collections.Generic.IEnumerable Keys { get; } + System.Collections.Generic.IEnumerable Values { get; } + int Count { get; } +#endif + System.Collections.Generic.IDictionary AdditionalProperties { get; } + T this[string index] { get; set; } + void Add(string key, T value); + bool ContainsKey(string key); + bool Remove(string key); + bool TryGetValue(string key, out T value); + void Clear(); + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/IHeaderSerializable.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..f1140b0a592e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/IHeaderSerializable.cs @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/ISendAsync.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..05b1a4fda227 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/ISendAsync.cs @@ -0,0 +1,300 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + /// + /// The interface for sending an HTTP request across the wire. + /// + public interface ISendAsync + { + Task SendAsync(HttpRequestMessage request, IEventListener callback); + } + + public class SendAsyncTerminalFactory : ISendAsyncTerminalFactory, ISendAsync + { + SendAsync implementation; + + public SendAsyncTerminalFactory(SendAsync implementation) => this.implementation = implementation; + public SendAsyncTerminalFactory(ISendAsync implementation) => this.implementation = implementation.SendAsync; + public ISendAsync Create() => this; + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback); + } + + public partial class SendAsyncFactory : ISendAsyncFactory + { + public class Sender : ISendAsync + { + internal ISendAsync next; + internal SendAsyncStep implementation; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback, next); + } + SendAsyncStep implementation; + + public SendAsyncFactory(SendAsyncStep implementation) => this.implementation = implementation; + public ISendAsync Create(ISendAsync next) => new Sender { next = next, implementation = implementation }; + + } + + public class HttpClientFactory : ISendAsyncTerminalFactory, ISendAsync + { + HttpClient client; + public HttpClientFactory() : this(new HttpClient()) + { + } + public HttpClientFactory(HttpClient client) => this.client = client; + public ISendAsync Create() => this; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, callback.Token); + } + + public interface ISendAsyncFactory + { + ISendAsync Create(ISendAsync next); + } + + public interface ISendAsyncTerminalFactory + { + ISendAsync Create(); + } + + public partial class HttpPipeline : ISendAsync + { + private ISendAsync pipeline; + private ISendAsyncTerminalFactory terminal; + private List steps = new List(); + + public HttpPipeline() : this(new HttpClientFactory()) + { + } + + public HttpPipeline(ISendAsyncTerminalFactory terminalStep) + { + if (terminalStep == null) + { + throw new System.ArgumentNullException(nameof(terminalStep), "Terminal Step Factory in HttpPipeline may not be null"); + } + TerminalFactory = terminalStep; + } + + /// + /// Returns an HttpPipeline with the current state of this pipeline. + /// + public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + + public ISendAsyncTerminalFactory TerminalFactory + { + get => terminal; + set + { + if (value == null) + { + throw new System.ArgumentNullException("TerminalFactory in HttpPipeline may not be null"); + } + terminal = value; + } + } + + public ISendAsync Pipeline + { + get + { + // if the pipeline has been created and not invalidated, return it. + if (this.pipeline != null) + { + return this.pipeline; + } + + // create the pipeline from scratch. + var next = terminal.Create(); + foreach (var factory in steps) + { + // skip factories that return null. + next = factory.Create(next) ?? next; + } + return this.pipeline = next; + } + } + + public int Count => steps.Count; + + public HttpPipeline Prepend(ISendAsyncFactory item) + { + if (item != null) + { + steps.Add(item); + pipeline = null; + } + return this; + } + + public HttpPipeline Append(SendAsyncStep item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStep item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Append(ISendAsyncFactory item) + { + if (item != null) + { + steps.Insert(0, item); + pipeline = null; + } + return this; + } + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(item); + } + } + return this; + } + + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(item); + } + } + return this; + } + + // you can use this as the ISendAsync Implementation + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => Pipeline.SendAsync(request, callback); + } + + internal static partial class Extensions + { + internal static HttpRequestMessage CloneAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.Clone(requestUri, method); + } + } + + internal static Task CloneWithContentAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.CloneWithContent(requestUri, method); + } + } + + /// + /// Clones an HttpRequestMessage (without the content) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static HttpRequestMessage Clone(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = new HttpRequestMessage + { + Method = method ?? original.Method, + RequestUri = requestUri ?? original.RequestUri, + Version = original.Version, + }; + + foreach (KeyValuePair prop in original.Properties) + { + clone.Properties.Add(prop); + } + + foreach (KeyValuePair> header in original.Headers) + { + /* + **temporarily skip cloning telemetry related headers** + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + */ + if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key)) + { + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + } + + return clone; + } + + /// + /// Clones an HttpRequestMessage (including the content stream and content headers) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static async Task CloneWithContent(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = original.Clone(requestUri, method); + var stream = new System.IO.MemoryStream(); + if (original.Content != null) + { + await original.Content.CopyToAsync(stream).ConfigureAwait(false); + stream.Position = 0; + clone.Content = new StreamContent(stream); + if (original.Content.Headers != null) + { + foreach (var h in original.Content.Headers) + { + clone.Content.Headers.Add(h.Key, h.Value); + } + } + } + return clone; + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/InfoAttribute.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..328d650acd1a --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/InfoAttribute.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using System; + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class)] + public class InfoAttribute : Attribute + { + public bool Required { get; set; } = false; + public bool ReadOnly { get; set; } = false; + public Type[] PossibleTypes { get; set; } = new Type[0]; + public string Description { get; set; } = ""; + public string SerializedName { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class CompleterInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class DefaultInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Iso/IsoDate.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..8ec077e6e017 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Iso/IsoDate.cs @@ -0,0 +1,214 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal struct IsoDate + { + internal int Year { get; set; } // 0-3000 + + internal int Month { get; set; } // 1-12 + + internal int Day { get; set; } // 1-31 + + internal int Hour { get; set; } // 0-24 + + internal int Minute { get; set; } // 0-60 (60 is a special case) + + internal int Second { get; set; } // 0-60 (60 is used for leap seconds) + + internal double Millisecond { get; set; } // 0-999.9... + + internal TimeSpan Offset { get; set; } + + internal DateTimeKind Kind { get; set; } + + internal TimeSpan TimeOfDay => new TimeSpan(Hour, Minute, Second); + + internal DateTime ToDateTime() + { + if (Kind == DateTimeKind.Utc || Offset == TimeSpan.Zero) + { + return new DateTime(Year, Month, Day, Hour, Minute, Second, (int)Millisecond, DateTimeKind.Utc); + } + + return ToDateTimeOffset().DateTime; + } + + internal DateTimeOffset ToDateTimeOffset() + { + return new DateTimeOffset( + Year, + Month, + Day, + Hour, + Minute, + Second, + (int)Millisecond, + Offset + ); + } + + internal DateTime ToUtcDateTime() + { + return ToDateTimeOffset().UtcDateTime; + } + + public override string ToString() + { + var sb = new StringBuilder(); + + // yyyy-MM-dd + sb.Append($"{Year}-{Month:00}-{Day:00}"); + + if (TimeOfDay > new TimeSpan(0)) + { + sb.Append($"T{Hour:00}:{Minute:00}"); + + if (TimeOfDay.Seconds > 0) + { + sb.Append($":{Second:00}"); + } + } + + if (Offset.Ticks == 0) + { + sb.Append('Z'); // UTC + } + else + { + if (Offset.Ticks >= 0) + { + sb.Append('+'); + } + + sb.Append($"{Offset.Hours:00}:{Offset.Minutes:00}"); + } + + return sb.ToString(); + } + + internal static IsoDate FromDateTimeOffset(DateTimeOffset date) + { + return new IsoDate { + Year = date.Year, + Month = date.Month, + Day = date.Day, + Hour = date.Hour, + Minute = date.Minute, + Second = date.Second, + Offset = date.Offset, + Kind = date.Offset == TimeSpan.Zero ? DateTimeKind.Utc : DateTimeKind.Unspecified + }; + } + + private static readonly char[] timeSeperators = { ':', '.' }; + + internal static IsoDate Parse(string text) + { + var tzIndex = -1; + var timeIndex = text.IndexOf('T'); + + var builder = new IsoDate { Day = 1, Month = 1 }; + + // TODO: strip the time zone offset off the end + string dateTime = text; + string timeZone = null; + + if (dateTime.IndexOf('Z') > -1) + { + tzIndex = dateTime.LastIndexOf('Z'); + + builder.Kind = DateTimeKind.Utc; + } + else if (dateTime.LastIndexOf('+') > 10) + { + tzIndex = dateTime.LastIndexOf('+'); + } + else if (dateTime.LastIndexOf('-') > 10) + { + tzIndex = dateTime.LastIndexOf('-'); + } + + if (tzIndex > -1) + { + timeZone = dateTime.Substring(tzIndex); + dateTime = dateTime.Substring(0, tzIndex); + } + + string date = (timeIndex == -1) ? dateTime : dateTime.Substring(0, timeIndex); + + var dateParts = date.Split(Seperator.Dash); // '-' + + for (int i = 0; i < dateParts.Length; i++) + { + var part = dateParts[i]; + + switch (i) + { + case 0: builder.Year = int.Parse(part); break; + case 1: builder.Month = int.Parse(part); break; + case 2: builder.Day = int.Parse(part); break; + } + } + + if (timeIndex > -1) + { + string[] timeParts = dateTime.Substring(timeIndex + 1).Split(timeSeperators); + + for (int i = 0; i < timeParts.Length; i++) + { + var part = timeParts[i]; + + switch (i) + { + case 0: builder.Hour = int.Parse(part); break; + case 1: builder.Minute = int.Parse(part); break; + case 2: builder.Second = int.Parse(part); break; + case 3: builder.Millisecond = double.Parse("0." + part) * 1000; break; + } + } + } + + if (timeZone != null && timeZone != "Z") + { + var hours = int.Parse(timeZone.Substring(1, 2)); + var minutes = int.Parse(timeZone.Substring(4, 2)); + + if (timeZone[0] == '-') + { + hours = -hours; + minutes = -minutes; + } + + builder.Offset = new TimeSpan(hours, minutes, 0); + } + + return builder; + } + } + + /* + YYYY # eg 1997 + YYYY-MM # eg 1997-07 + YYYY-MM-DD # eg 1997-07-16 + YYYY-MM-DDThh:mmTZD # eg 1997-07-16T19:20+01:00 + YYYY-MM-DDThh:mm:ssTZD # eg 1997-07-16T19:20:30+01:00 + YYYY-MM-DDThh:mm:ss.sTZD # eg 1997-07-16T19:20:30.45+01:00 + + where: + + YYYY = four-digit year + MM = two-digit month (01=January, etc.) + DD = two-digit day of month (01 through 31) + hh = two digits of hour (00 through 23) (am/pm NOT allowed) + mm = two digits of minute (00 through 59) + ss = two digits of second (00 through 59) + s = one or more digits representing a decimal fraction of a second + TZD = time zone designator (Z or +hh:mm or -hh:mm) + */ +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/JsonType.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..509490db8f4b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/JsonType.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal enum JsonType + { + Null = 0, + Object = 1, + Array = 2, + Binary = 3, + Boolean = 4, + Date = 5, + Number = 6, + String = 7 + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/MessageAttribute.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..ba20e6f4a167 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/MessageAttribute.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. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Management.Automation; + using System.Text; + + [AttributeUsage(AttributeTargets.All)] + public class GenericBreakingChangeAttribute : Attribute + { + private string _message; + //A dexcription of what the change is about, non mandatory + public string ChangeDescription { get; set; } = null; + + //The version the change is effective from, non mandatory + public string DeprecateByVersion { get; } + public string DeprecateByAzVersion { get; } + + //The date on which the change comes in effect + public DateTime ChangeInEfectByDate { get; } + public bool ChangeInEfectByDateSet { get; } = false; + + //Old way of calling the cmdlet + public string OldWay { get; set; } + //New way fo calling the cmdlet + public string NewWay { get; set; } + + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion) + { + _message = message; + this.DeprecateByAzVersion = deprecateByAzVersion; + this.DeprecateByVersion = deprecateByVersion; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByAzVersion = deprecateByAzVersion; + + if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.ChangeInEfectByDate = result; + this.ChangeInEfectByDateSet = true; + } + } + + public DateTime getInEffectByDate() + { + return this.ChangeInEfectByDate.Date; + } + + + /** + * This function prints out the breaking change message for the attribute on the cmdline + * */ + public void PrintCustomAttributeInfo(Action writeOutput) + { + + if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine)) + { + writeOutput(Environment.NewLine); + } + writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + + + if (!string.IsNullOrWhiteSpace(ChangeDescription)) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesChangeDescriptionMessage, this.ChangeDescription)); + } + + if (ChangeInEfectByDateSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); + } + + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + + if (OldWay != null && NewWay != null) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesUsageChangeMessageConsole, OldWay, NewWay)); + } + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + + protected virtual string GetAttributeSpecificMessage() + { + return _message; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute + { + + public string ReplacementCmdletName { get; set; } + + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) + { + } + + protected override string GetAttributeSpecificMessage() + { + if (string.IsNullOrWhiteSpace(ReplacementCmdletName)) + { + return Resources.BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement; + } + else + { + return string.Format(Resources.BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement, ReplacementCmdletName); + } + } + } + + [AttributeUsage(AttributeTargets.All)] + public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string[] ChangedParameterSet { set; get; } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) + { + ChangedParameterSet = changedParameterSet; + } + + protected override string GetAttributeSpecificMessage() + { + + return Resources.BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement; + + } + + public bool IsApplicableToInvocation(InvocationInfo invocation, string parameterSetName) + { + if (ChangedParameterSet != null) + return ChangedParameterSet.Contains(parameterSetName); + return false; + } + + } + + [AttributeUsage(AttributeTargets.All)] + public class PreviewMessageAttribute : Attribute + { + public string _message; + + public DateTime EstimatedGaDate { get; } + + public bool IsEstimatedGaDateSet { get; } = false; + + + public PreviewMessageAttribute() + { + this._message = Resources.PreviewCmdletMessage; + } + + public PreviewMessageAttribute(string message) + { + this._message = string.IsNullOrEmpty(message) ? Resources.PreviewCmdletMessage : message; + } + + public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this(message) + { + if (DateTime.TryParse(estimatedDateOfGa, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.EstimatedGaDate = result; + this.IsEstimatedGaDateSet = true; + } + } + + public void PrintCustomAttributeInfo(Action writeOutput) + { + writeOutput(this._message); + + if (IsEstimatedGaDateSet) + { + writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); + } + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string NameOfParameterChanging { get; } + + public string ReplaceMentCmdletParameterName { get; set; } = null; + + public bool IsBecomingMandatory { get; set; } = false; + + public String OldParamaterType { get; set; } + + public String NewParameterType { get; set; } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + if (!string.IsNullOrWhiteSpace(ReplaceMentCmdletParameterName)) + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplacedMandatory, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplaced, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + } + else + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterMandatoryNow, NameOfParameterChanging)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterChanging, NameOfParameterChanging)); + } + } + + //See if the type of the param is changing + if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterType)) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType, NewParameterType)); + } + return message.ToString(); + } + + /// + /// See if the bound parameters contain the current parameter, if they do + /// then the attribbute is applicable + /// If the invocationInfo is null we return true + /// + /// + /// bool + public override bool IsApplicableToInvocation(InvocationInfo invocationInfo) + { + bool? applicable = invocationInfo == null ? true : invocationInfo.BoundParameters?.Keys?.Contains(this.NameOfParameterChanging); + return applicable.HasValue ? applicable.Value : false; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string DeprecatedCmdLetOutputType { get; } + + //This is still a String instead of a Type as this + //might be undefined at the time of adding the attribute + public string ReplacementCmdletOutputType { get; set; } + + public string[] DeprecatedOutputProperties { get; set; } + + public string[] NewOutputProperties { get; set; } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + + //check for the deprecation scenario + if (string.IsNullOrWhiteSpace(ReplacementCmdletOutputType) && NewOutputProperties == null && DeprecatedOutputProperties == null && string.IsNullOrWhiteSpace(ChangeDescription)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputTypeDeprecated, DeprecatedCmdLetOutputType)); + } + else + { + if (!string.IsNullOrWhiteSpace(ReplacementCmdletOutputType)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange1, DeprecatedCmdLetOutputType, ReplacementCmdletOutputType)); + } + else + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange2, DeprecatedCmdLetOutputType)); + } + + if (DeprecatedOutputProperties != null && DeprecatedOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesRemoved); + foreach (string property in DeprecatedOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + + if (NewOutputProperties != null && NewOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesAdded); + foreach (string property in NewOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + } + return message.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/MessageAttributeHelper.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..6508fb8d5b68 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/MessageAttributeHelper.cs @@ -0,0 +1,184 @@ +// ---------------------------------------------------------------------------------- +// +// 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. +// ---------------------------------------------------------------------------------- +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Management.Automation; + using System.Reflection; + using System.Text; + using System.Threading.Tasks; + public class MessageAttributeHelper + { + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings"; + public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings"; + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And reads all the deprecation attributes attached to it + * Prints a message on the cmdline For each of the attribute found + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + * */ + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet, bool showPreviewMessage = true) + { + bool supressWarningOrError = false; + + try + { + supressWarningOrError = bool.Parse(System.Environment.GetEnvironmentVariable(SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME)); + } + catch (Exception) + { + //no action + } + + if (supressWarningOrError) + { + //Do not process the attributes at runtime... The env variable to override the warning messages is set + return; + } + if (IsAzure && invocationInfo.BoundParameters.ContainsKey("DefaultProfile")) + { + psCmdlet.WriteWarning("The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription."); + } + + ProcessBreakingChangeAttributesAtRuntime(commandInfo, invocationInfo, parameterSet, psCmdlet); + + } + + private static void ProcessBreakingChangeAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); + + if (attributes != null && attributes.Count > 0) + { + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + + foreach (GenericBreakingChangeAttribute attribute in attributes) + { + attribute.PrintCustomAttributeInfo(appendAttributeMessage); + } + + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + psCmdlet.WriteWarning(sb.ToString()); + } + } + + + public static void ProcessPreviewMessageAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); + + if (previewAttributes != null && previewAttributes.Count > 0) + { + foreach (PreviewMessageAttribute attribute in previewAttributes) + { + attribute.PrintCustomAttributeInfo(appendAttributeMessage); + } + psCmdlet.WriteWarning(sb.ToString()); + } + } + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And returns all the deprecation attributes attached to it + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + **/ + private static IEnumerable GetAllBreakingChangeAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet) + { + List attributeList = new List(); + + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); + } + + public static bool ContainsPreviewAttribute(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + return GetAllPreviewAttributesInType(commandInfo, invocationInfo)?.Count() > 0; + } + + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + List attributeList = new List(); + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.IsApplicableToInvocation(invocationInfo)); + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Method.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Method.cs new file mode 100644 index 000000000000..f29f469553a5 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Method.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + internal static class Method + { + internal static System.Net.Http.HttpMethod Get = System.Net.Http.HttpMethod.Get; + internal static System.Net.Http.HttpMethod Put = System.Net.Http.HttpMethod.Put; + internal static System.Net.Http.HttpMethod Head = System.Net.Http.HttpMethod.Head; + internal static System.Net.Http.HttpMethod Post = System.Net.Http.HttpMethod.Post; + internal static System.Net.Http.HttpMethod Delete = System.Net.Http.HttpMethod.Delete; + internal static System.Net.Http.HttpMethod Options = System.Net.Http.HttpMethod.Options; + internal static System.Net.Http.HttpMethod Trace = System.Net.Http.HttpMethod.Trace; + internal static System.Net.Http.HttpMethod Patch = new System.Net.Http.HttpMethod("PATCH"); + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Models/JsonMember.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..36add76b82e0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Models/JsonMember.cs @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; +using System.Runtime.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + + + internal sealed class JsonMember + { + private readonly TypeDetails type; + + private readonly Func getter; + private readonly Action setter; + + internal JsonMember(PropertyInfo property, int defaultOrder) + { + getter = property.GetValue; + setter = property.SetValue; + + var dataMember = property.GetCustomAttribute(); + + Name = dataMember?.Name ?? property.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(property.PropertyType); + + CanRead = property.CanRead; + } + + internal JsonMember(FieldInfo field, int defaultOrder) + { + getter = field.GetValue; + setter = field.SetValue; + + var dataMember = field.GetCustomAttribute(); + + Name = dataMember?.Name ?? field.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(field.FieldType); + + CanRead = true; + } + + internal string Name { get; } + + internal int Order { get; } + + internal TypeDetails TypeDetails => type; + + internal Type Type => type.NonNullType; + + internal bool IsList => type.IsList; + + // Arrays, Sets, ... + internal Type ElementType => type.ElementType; + + internal IJsonConverter Converter => type.JsonConverter; + + internal bool EmitDefaultValue { get; } + + internal bool IsStringLike => type.IsStringLike; + + internal object DefaultValue => type.DefaultValue; + + internal bool CanRead { get; } + + #region Helpers + + internal object GetValue(object instance) => getter(instance); + + internal void SetValue(object instance, object value) => setter(instance, value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Models/JsonModel.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..1cf23c2bbd26 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Models/JsonModel.cs @@ -0,0 +1,89 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal class JsonModel + { + private Dictionary map; + private readonly object _sync = new object(); + + private JsonModel(Type type, List members) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + Members = members ?? throw new ArgumentNullException(nameof(members)); + } + + internal string Name => Type.Name; + + internal Type Type { get; } + + internal List Members { get; } + + internal JsonMember this[string name] + { + get + { + if (map == null) + { + lock (_sync) + { + if (map == null) + { + map = new Dictionary(); + + foreach (JsonMember m in Members) + { + map[m.Name.ToLower()] = m; + } + } + } + } + + + map.TryGetValue(name.ToLower(), out JsonMember member); + + return member; + } + } + + internal static JsonModel FromType(Type type) + { + var members = new List(); + + int i = 0; + + // BindingFlags.Instance | BindingFlags.Public + + foreach (var member in type.GetFields()) + { + if (member.IsStatic) continue; + + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + foreach (var member in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + members.Sort((a, b) => a.Order.CompareTo(b.Order)); // inline sort + + return new JsonModel(type, members); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Models/JsonModelCache.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..b31c180674e4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Models/JsonModelCache.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Runtime.CompilerServices; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal static class JsonModelCache + { + private static readonly ConditionalWeakTable cache + = new ConditionalWeakTable(); + + internal static JsonModel Get(Type type) => cache.GetValue(type, Create); + + private static JsonModel Create(Type type) => JsonModel.FromType(type); + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..235e2cc9fc08 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/JsonArray.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public abstract partial class JsonArray : JsonNode, IEnumerable + { + internal override JsonType Type => JsonType.Array; + + internal abstract JsonType? ElementType { get; } + + public abstract int Count { get; } + + internal virtual bool IsSet => false; + + internal bool IsEmpty => Count == 0; + + #region IEnumerable + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + #region Static Helpers + + internal static JsonArray Create(short[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(int[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(long[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(decimal[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(float[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(string[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(XBinary[] values) + => new XImmutableArray(values); + + #endregion + + internal static new JsonArray Parse(string text) + => (JsonArray)JsonNode.Parse(text); + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..587811f3ac12 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XImmutableArray.cs @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal sealed class XImmutableArray : JsonArray, IEnumerable + { + private readonly T[] values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XImmutableArray(T[] values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Length; + + public bool IsReadOnly => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + #region Static Constructor + + internal XImmutableArray Create(T[] items) + { + return new XImmutableArray(items); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..e8d5fd531d86 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XList.cs @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal sealed class XList : JsonArray, IEnumerable + { + private readonly IList values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XList(IList values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Count; + + public bool IsReadOnly => values.IsReadOnly; + + #region IList + + public void Add(T value) + { + values.Add(value); + } + + public bool Contains(T value) => values.Contains(value); + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..8ff505af5049 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed partial class XNodeArray : JsonArray, ICollection + { + private readonly List items; + + internal XNodeArray() + { + items = new List(); + } + + internal XNodeArray(params JsonNode[] values) + { + items = new List(values); + } + + public override JsonNode this[int index] => items[index]; + + internal override JsonType? ElementType => null; + + public bool IsReadOnly => false; + + public override int Count => items.Count; + + #region ICollection Members + + public void Add(JsonNode item) + { + items.Add(item); + } + + void ICollection.Clear() + { + items.Clear(); + } + + public bool Contains(JsonNode item) => items.Contains(item); + + void ICollection.CopyTo(JsonNode[] array, int arrayIndex) + { + items.CopyTo(array, arrayIndex); + } + + public bool Remove(JsonNode item) + { + return items.Remove(item); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..88ecff6fc402 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/Collections/XSet.cs @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal sealed class XSet : JsonArray, IEnumerable + { + private readonly HashSet values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XSet(IEnumerable values) + : this(new HashSet(values)) + { } + + internal XSet(HashSet values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + internal override JsonType Type => JsonType.Array; + + internal override JsonType? ElementType => elementType; + + public bool IsReadOnly => true; + + public override int Count => values.Count; + + internal override bool IsSet => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + internal HashSet AsHashSet() => values; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..40bbdf4a1fb0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonBoolean.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal sealed partial class JsonBoolean : JsonNode + { + internal static readonly JsonBoolean True = new JsonBoolean(true); + internal static readonly JsonBoolean False = new JsonBoolean(false); + + internal JsonBoolean(bool value) + { + Value = value; + } + + internal bool Value { get; } + + internal override JsonType Type => JsonType.Boolean; + + internal static new JsonBoolean Parse(string text) + { + switch (text) + { + case "false": return False; + case "true": return True; + + default: throw new ArgumentException($"Expected true or false. Was {text}."); + } + } + + #region Implicit Casts + + public static implicit operator bool(JsonBoolean data) => data.Value; + + public static implicit operator JsonBoolean(bool data) => new JsonBoolean(data); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonDate.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..f50b65f1d501 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonDate.cs @@ -0,0 +1,173 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + + + internal sealed partial class JsonDate : JsonNode, IEquatable, IComparable + { + internal static bool AssumeUtcWhenKindIsUnspecified = true; + + private readonly DateTimeOffset value; + + internal JsonDate(DateTime value) + { + if (value.Kind == DateTimeKind.Unspecified && AssumeUtcWhenKindIsUnspecified) + { + value = DateTime.SpecifyKind(value, DateTimeKind.Utc); + } + + this.value = value; + } + + internal JsonDate(DateTimeOffset value) + { + this.value = value; + } + + internal override JsonType Type => JsonType.Date; + + #region Helpers + + internal DateTimeOffset ToDateTimeOffset() + { + return value; + } + + internal DateTime ToDateTime() + { + if (value.Offset == TimeSpan.Zero) + { + return value.UtcDateTime; + } + + return value.DateTime; + } + + internal DateTime ToUtcDateTime() => value.UtcDateTime; + + internal int ToUnixTimeSeconds() + { + return (int)value.ToUnixTimeSeconds(); + } + + internal long ToUnixTimeMilliseconds() + { + return (int)value.ToUnixTimeMilliseconds(); + } + + internal string ToIsoString() + { + return IsoDate.FromDateTimeOffset(value).ToString(); + } + + #endregion + + public override string ToString() + { + return ToIsoString(); + } + + internal static new JsonDate Parse(string text) + { + if (text == null) throw new ArgumentNullException(nameof(text)); + + // TODO support: unixtimeseconds.partialseconds + + if (text.Length > 4 && _IsNumber(text)) // UnixTime + { + var date = DateTimeOffset.FromUnixTimeSeconds(long.Parse(text)); + + return new JsonDate(date); + } + else if (text.Length <= 4 || text[4] == '-') // ISO: 2012- + { + return new JsonDate(IsoDate.Parse(text).ToDateTimeOffset()); + } + else + { + // NOT ISO ENCODED + // "Thu, 5 Apr 2012 16:59:01 +0200", + return new JsonDate(DateTimeOffset.Parse(text)); + } + } + + private static bool _IsNumber(string text) + { + foreach (var c in text) + { + if (!char.IsDigit(c)) return false; + } + + return true; + } + + internal static JsonDate FromUnixTime(int seconds) + { + return new JsonDate(DateTimeOffset.FromUnixTimeSeconds(seconds)); + } + + internal static JsonDate FromUnixTime(double seconds) + { + var milliseconds = (long)(seconds * 1000d); + + return new JsonDate(DateTimeOffset.FromUnixTimeMilliseconds(milliseconds)); + } + + #region Implicit Casts + + public static implicit operator DateTimeOffset(JsonDate value) + => value.ToDateTimeOffset(); + + public static implicit operator DateTime(JsonDate value) + => value.ToDateTime(); + + // From Date + public static implicit operator JsonDate(DateTimeOffset value) + { + return new JsonDate(value); + } + + public static implicit operator JsonDate(DateTime value) + { + return new JsonDate(value); + } + + // From String + public static implicit operator JsonDate(string value) + { + return Parse(value); + } + + #endregion + + #region Equality + + public override bool Equals(object obj) + { + return obj is JsonDate date && date.value == this.value; + } + + public bool Equals(JsonDate other) + { + return this.value == other.value; + } + + public override int GetHashCode() => value.GetHashCode(); + + #endregion + + #region IComparable Members + + int IComparable.CompareTo(JsonDate other) + { + return value.CompareTo(other.value); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonNode.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..b30f1402344b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonNode.cs @@ -0,0 +1,250 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + + + public abstract partial class JsonNode + { + internal abstract JsonType Type { get; } + + public virtual JsonNode this[int index] => throw new NotImplementedException(); + + public virtual JsonNode this[string name] + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #region Type Helpers + + internal bool IsArray => Type == JsonType.Array; + + internal bool IsDate => Type == JsonType.Date; + + internal bool IsObject => Type == JsonType.Object; + + internal bool IsNumber => Type == JsonType.Number; + + internal bool IsNull => Type == JsonType.Null; + + #endregion + + internal void WriteTo(TextWriter textWriter, bool pretty = true) + { + var writer = new JsonWriter(textWriter, pretty); + + writer.WriteNode(this); + } + + internal T As() + where T : new() + => new JsonSerializer().Deseralize((JsonObject)this); + + internal T[] ToArrayOf() + { + return (T[])new JsonSerializer().DeserializeArray(typeof(T[]), (JsonArray)this); + } + + #region ToString Overrides + + public override string ToString() => ToString(pretty: true); + + internal string ToString(bool pretty) + { + var sb = new StringBuilder(); + + using (var writer = new StringWriter(sb)) + { + WriteTo(writer, pretty); + + return sb.ToString(); + } + } + + #endregion + + #region Static Constructors + + internal static JsonNode Parse(string text) + { + return Parse(new SourceReader(new StringReader(text))); + } + + internal static JsonNode Parse(TextReader textReader) + => Parse(new SourceReader(textReader)); + + private static JsonNode Parse(SourceReader sourceReader) + { + using (var parser = new JsonParser(sourceReader)) + { + return parser.ReadNode(); + } + } + + internal static JsonNode FromObject(object instance) + => new JsonSerializer().Serialize(instance); + + #endregion + + #region Implict Casts + + public static implicit operator string(JsonNode node) => node.ToString(); + + #endregion + + #region Explict Casts + + public static explicit operator DateTime(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date: + return ((JsonDate)node).ToDateTime(); + + case JsonType.String: + return JsonDate.Parse(node.ToString()).ToDateTime(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num).UtcDateTime; + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)).UtcDateTime; + } + } + + throw new ConversionException(node, typeof(DateTime)); + } + + public static explicit operator DateTimeOffset(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date : return ((JsonDate)node).ToDateTimeOffset(); + case JsonType.String : return JsonDate.Parse(node.ToString()).ToDateTimeOffset(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num); + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)); + } + + } + + throw new ConversionException(node, typeof(DateTimeOffset)); + } + + public static explicit operator float(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return float.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(float)); + } + + public static explicit operator double(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return double.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(double)); + } + + public static explicit operator decimal(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return decimal.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(decimal)); + } + + public static explicit operator Guid(JsonNode node) + => new Guid(node.ToString()); + + public static explicit operator short(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return short.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(short)); + } + + public static explicit operator int(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return int.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(int)); + } + + public static explicit operator long(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return long.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(long)); + } + + public static explicit operator bool(JsonNode node) + => ((JsonBoolean)node).Value; + + public static explicit operator ushort(JsonNode node) + => (JsonNumber)node; + + public static explicit operator uint(JsonNode node) + => (JsonNumber)node; + + public static explicit operator ulong(JsonNode node) + => (JsonNumber)node; + + public static explicit operator TimeSpan(JsonNode node) + => TimeSpan.Parse(node.ToString()); + + public static explicit operator Uri(JsonNode node) + { + if (node.Type == JsonType.String) + { + return new Uri(node.ToString()); + } + + throw new ConversionException(node, typeof(Uri)); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..60e661f9c3d3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonNumber.cs @@ -0,0 +1,109 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed partial class JsonNumber : JsonNode + { + private readonly string value; + private readonly bool overflows = false; + + internal JsonNumber(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal JsonNumber(int value) + { + this.value = value.ToString(); + } + + internal JsonNumber(long value) + { + this.value = value.ToString(); + + if (value > 9007199254740991) + { + overflows = true; + } + } + + internal JsonNumber(float value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal JsonNumber(double value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal override JsonType Type => JsonType.Number; + + internal string Value => value; + + #region Helpers + + internal bool Overflows => overflows; + + internal bool IsInteger => !value.Contains("."); + + internal bool IsFloat => value.Contains("."); + + #endregion + + #region Casting + + public static implicit operator byte(JsonNumber number) + => byte.Parse(number.Value); + + public static implicit operator short(JsonNumber number) + => short.Parse(number.Value); + + public static implicit operator int(JsonNumber number) + => int.Parse(number.Value); + + public static implicit operator long(JsonNumber number) + => long.Parse(number.value); + + public static implicit operator UInt16(JsonNumber number) + => ushort.Parse(number.Value); + + public static implicit operator UInt32(JsonNumber number) + => uint.Parse(number.Value); + + public static implicit operator UInt64(JsonNumber number) + => ulong.Parse(number.Value); + + public static implicit operator decimal(JsonNumber number) + => decimal.Parse(number.Value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator Double(JsonNumber number) + => double.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator float(JsonNumber number) + => float.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator JsonNumber(short data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(int data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(long data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(Single data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(double data) + => new JsonNumber(data.ToString()); + + #endregion + + public override string ToString() => value; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonObject.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..dde9a3914329 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonObject.cs @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public partial class JsonObject : JsonNode, IDictionary + { + private readonly Dictionary items; + + internal JsonObject() + { + items = new Dictionary(); + } + + internal JsonObject(IEnumerable> properties) + { + if (properties == null) throw new ArgumentNullException(nameof(properties)); + + items = new Dictionary(); + + foreach (var field in properties) + { + items.Add(field.Key, field.Value); + } + } + + #region IDictionary Constructors + + internal JsonObject(IDictionary dic) + { + items = new Dictionary(dic.Count); + + foreach (var pair in dic) + { + Add(pair.Key, pair.Value); + } + } + + #endregion + + internal override JsonType Type => JsonType.Object; + + #region Add Overloads + + public void Add(string name, JsonNode value) => + items.Add(name, value); + + public void Add(string name, byte[] value) => + items.Add(name, new XBinary(value)); + + public void Add(string name, DateTime value) => + items.Add(name, new JsonDate(value)); + + public void Add(string name, int value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, long value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, float value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, double value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, string value) => + items.Add(name, new JsonString(value)); + + public void Add(string name, bool value) => + items.Add(name, new JsonBoolean(value)); + + public void Add(string name, Uri url) => + items.Add(name, new JsonString(url.AbsoluteUri)); + + public void Add(string name, string[] values) => + items.Add(name, new XImmutableArray(values)); + + public void Add(string name, int[] values) => + items.Add(name, new XImmutableArray(values)); + + #endregion + + #region ICollection> Members + + void ICollection>.Add(KeyValuePair item) + { + items.Add(item.Key, item.Value); + } + + void ICollection>.Clear() + { + items.Clear(); + } + + bool ICollection>.Contains(KeyValuePair item) => + throw new NotImplementedException(); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => + throw new NotImplementedException(); + + + int ICollection>.Count => items.Count; + + bool ICollection>.IsReadOnly => false; + + bool ICollection>.Remove(KeyValuePair item) => + throw new NotImplementedException(); + + #endregion + + #region IDictionary Members + + public bool ContainsKey(string key) => items.ContainsKey(key); + + public ICollection Keys => items.Keys; + + public bool Remove(string key) => items.Remove(key); + + public bool TryGetValue(string key, out JsonNode value) => + items.TryGetValue(key, out value); + + public ICollection Values => items.Values; + + public override JsonNode this[string key] + { + get => items[key]; + set => items[key] = value; + } + + #endregion + + #region IEnumerable + + IEnumerator> IEnumerable>.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + + #region Helpers + + internal static new JsonObject FromObject(object instance) => + (JsonObject)new JsonSerializer().Serialize(instance); + + #endregion + + #region Static Constructors + + internal static JsonObject FromStream(Stream stream) + { + using (var tr = new StreamReader(stream)) + { + return (JsonObject)Parse(tr); + } + } + + internal static new JsonObject Parse(string text) + { + return (JsonObject)JsonNode.Parse(text); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonString.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..f02753949d23 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/JsonString.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed partial class JsonString : JsonNode, IEquatable + { + private readonly string value; + + internal JsonString(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal override JsonType Type => JsonType.String; + + internal string Value => value; + + internal int Length => value.Length; + + #region #region Implicit Casts + + public static implicit operator string(JsonString data) => data.Value; + + public static implicit operator JsonString(string value) => new JsonString(value); + + #endregion + + public override int GetHashCode() => value.GetHashCode(); + + public override string ToString() => value; + + #region IEquatable + + bool IEquatable.Equals(JsonString other) => this.Value == other.Value; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/XBinary.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..85d6fe122bad --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/XBinary.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal sealed class XBinary : JsonNode + { + private readonly byte[] _value; + private readonly string _base64; + + internal XBinary(byte[] value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal XBinary(string base64EncodedString) + { + _base64 = base64EncodedString ?? throw new ArgumentNullException(nameof(base64EncodedString)); + } + + internal override JsonType Type => JsonType.Binary; + + internal byte[] Value => _value ?? Convert.FromBase64String(_base64); + + #region #region Implicit Casts + + public static implicit operator byte[] (XBinary data) => data.Value; + + public static implicit operator XBinary(byte[] data) => new XBinary(data); + + #endregion + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => _base64 ?? Convert.ToBase64String(_value); + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/XNull.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..95cb35c48c06 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Nodes/XNull.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal sealed class XNull : JsonNode + { + internal static readonly XNull Instance = new XNull(); + + private XNull() { } + + internal override JsonType Type => JsonType.Null; + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..5f395d8e2dfc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/Exceptions/ParseException.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal class ParserException : Exception + { + internal ParserException(string message) + : base(message) + { } + + internal ParserException(string message, SourceLocation location) + : base(message) + { + + Location = location; + } + + internal SourceLocation Location { get; } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/JsonParser.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..9b33b95358e1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/JsonParser.cs @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public class JsonParser : IDisposable + { + private readonly TokenReader reader; + + internal JsonParser(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonParser(SourceReader sourceReader) + { + if (sourceReader == null) + throw new ArgumentNullException(nameof(sourceReader)); + + this.reader = new TokenReader(new JsonTokenizer(sourceReader)); + + this.reader.Next(); // Start with the first token + } + + internal IEnumerable ReadNodes() + { + JsonNode node; + + while ((node = ReadNode()) != null) yield return node; + } + + internal JsonNode ReadNode() + { + if (reader.Current.Kind == TokenKind.Eof || reader.Current.IsTerminator) + { + return null; + } + + switch (reader.Current.Kind) + { + case TokenKind.LeftBrace : return ReadObject(); // { + case TokenKind.LeftBracket : return ReadArray(); // [ + + default: throw new ParserException($"Expected '{{' or '['. Was {reader.Current}."); + } + } + + private JsonNode ReadFieldValue() + { + // Boolean, Date, Null, Number, String, Uri + if (reader.Current.IsLiteral) + { + return ReadLiteral(); + } + else + { + switch (reader.Current.Kind) + { + case TokenKind.LeftBracket: return ReadArray(); + case TokenKind.LeftBrace : return ReadObject(); + + default: throw new ParserException($"Unexpected token reading field value. Was {reader.Current}."); + } + } + } + + private JsonNode ReadLiteral() + { + var literal = reader.Current; + + reader.Next(); // Read the literal token + + switch (literal.Kind) + { + case TokenKind.Boolean : return JsonBoolean.Parse(literal.Value); + case TokenKind.Null : return XNull.Instance; + case TokenKind.Number : return new JsonNumber(literal.Value); + case TokenKind.String : return new JsonString(literal.Value); + + default: throw new ParserException($"Unexpected token reading literal. Was {literal}."); + } + } + + internal JsonObject ReadObject() + { + reader.Ensure(TokenKind.LeftBrace, "object"); + + reader.Next(); // Read '{' (Object start) + + var jsonObject = new JsonObject(); + + // Read the object's fields until we reach the end of the object ('}') + while (reader.Current.Kind != TokenKind.RightBrace) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read ',' (Seperator) + } + + // Ensure we have a field name + reader.Ensure(TokenKind.String, "Expected field name"); + + var field = ReadField(); + + jsonObject.Add(field.Key, field.Value); + } + + reader.Next(); // Read '}' (Object end) + + return jsonObject; + } + + + // TODO: Use ValueTuple in C#7 + private KeyValuePair ReadField() + { + var fieldName = reader.Current.Value; + + reader.Next(); // Read the field name + + reader.Ensure(TokenKind.Colon, "field"); + + reader.Next(); // Read ':' (Field value indicator) + + return new KeyValuePair(fieldName, ReadFieldValue()); + } + + + internal JsonArray ReadArray() + { + reader.Ensure(TokenKind.LeftBracket, "array"); + + var array = new XNodeArray(); + + reader.Next(); // Read the '[' (Array start) + + // Read the array's items + while (reader.Current.Kind != TokenKind.RightBracket) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read the ',' (Seperator) + } + + if (reader.Current.IsLiteral) + { + array.Add(ReadLiteral()); // Boolean, Date, Number, Null, String, Uri + } + else if (reader.Current.Kind == TokenKind.LeftBracket) + { + array.Add(ReadArray()); // Array + } + else if (reader.Current.Kind == TokenKind.LeftBrace) + { + array.Add(ReadObject()); // Object + } + else + { + throw new ParserException($"Expected comma, literal, or object. Was {reader.Current}."); + } + } + + reader.Next(); // Read the ']' (Array end) + + return array; + } + + #region IDisposable + + public void Dispose() + { + reader.Dispose(); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/JsonToken.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..459fb1e9c963 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/JsonToken.cs @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal enum TokenKind + { + LeftBrace, // { Object start + RightBrace, // } Object end + + LeftBracket, // [ Array start + RightBracket, // ] Array end + + Comma, // , Comma + Colon, // : Value indicator + Dot, // . Access field indicator + Terminator, // \0 Stream terminator + + Boolean = 31, // true or false + Null = 33, // null + Number = 34, // i.e. -1.93, -1, 0, 1, 1.1 + String = 35, // i.e. "text" + + Eof = 50 + } + + internal /* readonly */ struct JsonToken + { + internal static readonly JsonToken BraceOpen = new JsonToken(TokenKind.LeftBrace, "{"); + internal static readonly JsonToken BraceClose = new JsonToken(TokenKind.RightBrace, "}"); + + internal static readonly JsonToken BracketOpen = new JsonToken(TokenKind.LeftBracket, "["); + internal static readonly JsonToken BracketClose = new JsonToken(TokenKind.RightBracket, "]"); + + internal static readonly JsonToken Colon = new JsonToken(TokenKind.Colon, ":"); + internal static readonly JsonToken Comma = new JsonToken(TokenKind.Comma, ","); + internal static readonly JsonToken Terminator = new JsonToken(TokenKind.Terminator, "\0"); + + internal static readonly JsonToken True = new JsonToken(TokenKind.Boolean, "true"); + internal static readonly JsonToken False = new JsonToken(TokenKind.Boolean, "false"); + internal static readonly JsonToken Null = new JsonToken(TokenKind.Null, "null"); + + internal static readonly JsonToken Eof = new JsonToken(TokenKind.Eof, null); + + internal JsonToken(TokenKind kind, string value) + { + Kind = kind; + Value = value; + } + + internal readonly TokenKind Kind; + + internal readonly string Value; + + public override string ToString() => Kind + ": " + Value; + + #region Helpers + + internal bool IsLiteral => (byte)Kind > 30 && (byte)Kind < 40; + + internal bool IsTerminator => Kind == TokenKind.Terminator; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..fb537ef6880e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/JsonTokenizer.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + using System.IO; + + + public class JsonTokenizer : IDisposable + { + private readonly StringBuilder sb = new StringBuilder(); + + private readonly SourceReader reader; + + internal JsonTokenizer(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonTokenizer(SourceReader reader) + { + this.reader = reader; + + reader.Next(); // Start with the first char + } + + internal JsonToken ReadNext() + { + reader.SkipWhitespace(); + + if (reader.IsEof) return JsonToken.Eof; + + switch (reader.Current) + { + case '"': return ReadQuotedString(); + + // Symbols + case '[' : reader.Next(); return JsonToken.BracketOpen; // Array start + case ']' : reader.Next(); return JsonToken.BracketClose; // Array end + case ',' : reader.Next(); return JsonToken.Comma; // Value seperator + case ':' : reader.Next(); return JsonToken.Colon; // Field value indicator + case '{' : reader.Next(); return JsonToken.BraceOpen; // Object start + case '}' : reader.Next(); return JsonToken.BraceClose; // Object end + case '\0' : reader.Next(); return JsonToken.Terminator; // Stream terminiator + + default: return ReadLiteral(); + } + } + + private JsonToken ReadQuotedString() + { + Expect('"', "quoted string indicator"); + + reader.Next(); // Read '"' (Starting quote) + + // Read until we reach an unescaped quote char + while (reader.Current != '"') + { + EnsureNotEof("quoted string"); + + if (reader.Current == '\\') + { + char escapedCharacter = reader.ReadEscapeCode(); + + sb.Append(escapedCharacter); + + continue; + } + + StoreCurrentCharacterAndReadNext(); + } + + reader.Next(); // Read '"' (Ending quote) + + return new JsonToken(TokenKind.String, value: sb.Extract()); + } + + private JsonToken ReadLiteral() + { + if (char.IsDigit(reader.Current) || + reader.Current == '-' || + reader.Current == '+') + { + return ReadNumber(); + } + + return ReadIdentifer(); + } + + private JsonToken ReadNumber() + { + // Read until we hit a non-numeric character + // -6.247737e-06 + // E + + while (char.IsDigit(reader.Current) + || reader.Current == '.' + || reader.Current == 'e' + || reader.Current == 'E' + || reader.Current == '-' + || reader.Current == '+') + { + StoreCurrentCharacterAndReadNext(); + } + + return new JsonToken(TokenKind.Number, value: sb.Extract()); + } + + int count = 0; + + private JsonToken ReadIdentifer() + { + count++; + + if (!char.IsLetter(reader.Current)) + { + throw new ParserException( + message : $"Expected literal (number, boolean, or null). Was '{reader.Current}'.", + location : reader.Location + ); + } + + // Read letters, numbers, and underscores '_' + while (char.IsLetterOrDigit(reader.Current) || reader.Current == '_') + { + StoreCurrentCharacterAndReadNext(); + } + + string text = sb.Extract(); + + switch (text) + { + case "true": return JsonToken.True; + case "false": return JsonToken.False; + case "null": return JsonToken.Null; + + default: return new JsonToken(TokenKind.String, text); + } + } + + private void Expect(char character, string description) + { + if (reader.Current != character) + { + throw new ParserException( + message: $"Expected {description} ('{character}'). Was '{reader.Current}'.", + location: reader.Location + ); + } + } + + private void EnsureNotEof(string tokenType) + { + if (reader.IsEof) + { + throw new ParserException( + message: $"Unexpected EOF while reading {tokenType}.", + location: reader.Location + ); + } + } + + private void StoreCurrentCharacterAndReadNext() + { + sb.Append(reader.Current); + + reader.Next(); + } + + public void Dispose() + { + reader.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/Location.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..a5b63643bb91 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/Location.cs @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal struct SourceLocation + { + private int line; + private int column; + private int position; + + internal SourceLocation(int line = 0, int column = 0, int position = 0) + { + this.line = line; + this.column = column; + this.position = position; + } + + internal int Line => line; + + internal int Column => column; + + internal int Position => position; + + internal void Advance() + { + this.column++; + this.position++; + } + + internal void MarkNewLine() + { + this.line++; + this.column = 0; + } + + internal SourceLocation Clone() + { + return new SourceLocation(line, column, position); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..8e73e908a21e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/Readers/SourceReader.cs @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Globalization; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public sealed class SourceReader : IDisposable + { + private readonly TextReader source; + + private char current; + + private readonly SourceLocation location = new SourceLocation(); + + private bool isEof = false; + + internal SourceReader(TextReader textReader) + { + this.source = textReader ?? throw new ArgumentNullException(nameof(textReader)); + } + + /// + /// Advances to the next character + /// + internal void Next() + { + // Advance to the new line when we see a new line '\n'. + // A new line may be prefixed by a carriage return '\r'. + + if (current == '\n') + { + location.MarkNewLine(); + } + + int charCode = source.Read(); // -1 for end + + if (charCode >= 0) + { + current = (char)charCode; + } + else + { + // If we've already marked this as the EOF, throw an exception + if (isEof) + { + throw new EndOfStreamException("Cannot advance past end of stream."); + } + + isEof = true; + + current = '\0'; + } + + location.Advance(); + } + + internal void SkipWhitespace() + { + while (char.IsWhiteSpace(current)) + { + Next(); + } + } + + internal char ReadEscapeCode() + { + Next(); + + char escapedChar = current; + + Next(); // Consume escaped character + + switch (escapedChar) + { + // Special escape codes + case '"': return '"'; // " (Quotation mark) U+0022 + case '/': return '/'; // / (Solidus) U+002F + case '\\': return '\\'; // \ (Reverse solidus) U+005C + + // Control Characters + case '0': return '\0'; // Nul (0) U+0000 + case 'a': return '\a'; // Alert (7) + case 'b': return '\b'; // Backspace (8) U+0008 + case 'f': return '\f'; // Form feed (12) U+000C + case 'n': return '\n'; // Line feed (10) U+000A + case 'r': return '\r'; // Carriage return (13) U+000D + case 't': return '\t'; // Horizontal tab (9) U+0009 + case 'v': return '\v'; // Vertical tab + + // Unicode escape sequence + case 'u': return ReadUnicodeEscapeSequence(); // U+XXXX + + default: throw new Exception($"Unrecognized escape sequence '\\{escapedChar}'"); + } + } + + private readonly char[] hexCode = new char[4]; + + private char ReadUnicodeEscapeSequence() + { + hexCode[0] = current; Next(); + hexCode[1] = current; Next(); + hexCode[2] = current; Next(); + hexCode[3] = current; Next(); + + return Convert.ToChar(int.Parse( + s : new string(hexCode), + style : NumberStyles.HexNumber, + provider: NumberFormatInfo.InvariantInfo + )); + } + + internal char Current => current; + + internal bool IsEof => isEof; + + internal char Peek() => (char)source.Peek(); + + internal SourceLocation Location => location; + + public void Dispose() + { + source.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/TokenReader.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..d7427d773f8e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Parser/TokenReader.cs @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + public class TokenReader : IDisposable + { + private readonly JsonTokenizer tokenizer; + private JsonToken current; + + internal TokenReader(JsonTokenizer tokenizer) + { + this.tokenizer = tokenizer ?? throw new ArgumentNullException(nameof(tokenizer)); + } + + internal void Next() + { + current = tokenizer.ReadNext(); + } + + internal JsonToken Current => current; + + internal void Ensure(TokenKind kind, string readerName) + { + if (current.Kind != kind) + { + throw new ParserException($"Expected {kind} while reading {readerName}). Was {current}."); + } + } + + public void Dispose() + { + tokenizer.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/PipelineMocking.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..266aec0fea26 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/PipelineMocking.cs @@ -0,0 +1,262 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json; + + public enum MockMode + { + Live, + Record, + Playback, + + } + + public class PipelineMock + { + + private System.Collections.Generic.Stack scenario = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack context = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack description = new System.Collections.Generic.Stack(); + + private readonly string recordingPath; + private int counter = 0; + + public static implicit operator Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep(PipelineMock instance) => instance.SendAsync; + + public MockMode Mode { get; set; } = MockMode.Live; + public PipelineMock(string recordingPath) + { + this.recordingPath = recordingPath; + } + + public void PushContext(string text) => context.Push(text); + + public void PushDescription(string text) => description.Push(text); + + + public void PushScenario(string it) + { + // reset counter too + counter = 0; + + scenario.Push(it); + } + + public void PopContext() => context.Pop(); + + public void PopDescription() => description.Pop(); + + public void PopScenario() => scenario.Pop(); + + public void SetRecord() => Mode = MockMode.Record; + + public void SetPlayback() => Mode = MockMode.Playback; + + public void SetLive() => Mode = MockMode.Live; + + public string Scenario => (scenario.Count > 0 ? scenario.Peek() : "[NoScenario]"); + public string Description => (description.Count > 0 ? description.Peek() : "[NoDescription]"); + public string Context => (context.Count > 0 ? context.Peek() : "[NoContext]"); + + /// + /// Headers that we substitute out blank values for in the recordings + /// Add additional headers as necessary + /// + public static HashSet Blacklist = new HashSet(System.StringComparer.CurrentCultureIgnoreCase) { + "Authorization", + }; + + public Dictionary ForceResponseHeaders = new Dictionary(); + + internal static XImmutableArray Removed = new XImmutableArray(new string[] { "[Filtered]" }); + + internal static IEnumerable> FilterHeaders(IEnumerable>> headers) => headers.Select(header => new KeyValuePair(header.Key, Blacklist.Contains(header.Key) ? Removed : new XImmutableArray(header.Value.ToArray()))); + + internal static JsonNode SerializeContent(HttpContent content, ref bool isBase64) => content == null ? XNull.Instance : SerializeContent(content.ReadAsByteArrayAsync().Result, ref isBase64); + + internal static JsonNode SerializeContent(byte[] content, ref bool isBase64) + { + if (null == content || content.Length == 0) + { + return XNull.Instance; + } + var first = content[0]; + var last = content[content.Length - 1]; + + // plaintext for JSON/SGML/XML/HTML/STRINGS/ARRAYS + if ((first == '{' && last == '}') || (first == '<' && last == '>') || (first == '[' && last == ']') || (first == '"' && last == '"')) + { + return new JsonString(System.Text.Encoding.UTF8.GetString(content)); + } + + // base64 for everyone else + return new JsonString(System.Convert.ToBase64String(content)); + } + + internal static byte[] DeserializeContent(string content, bool isBase64) + { + if (string.IsNullOrWhiteSpace(content)) + { + return new byte[0]; + } + + if (isBase64) + { + try + { + return System.Convert.FromBase64String(content); + } + catch + { + // hmm. didn't work, return it as a string I guess. + } + } + return System.Text.Encoding.UTF8.GetBytes(content); + } + + public void SaveMessage(string rqKey, HttpRequestMessage request, HttpResponseMessage response) + { + var messages = System.IO.File.Exists(this.recordingPath) ? Load() : new JsonObject() ?? new JsonObject(); + bool isBase64Request = false; + bool isBase64Response = false; + messages[rqKey] = new JsonObject { + { "Request",new JsonObject { + { "Method", request.Method.Method }, + { "RequestUri", request.RequestUri }, + { "Content", SerializeContent( request.Content, ref isBase64Request) }, + { "isContentBase64", isBase64Request }, + { "Headers", new JsonObject(FilterHeaders(request.Headers)) }, + { "ContentHeaders", request.Content == null ? new JsonObject() : new JsonObject(FilterHeaders(request.Content.Headers))} + } }, + {"Response", new JsonObject { + { "StatusCode", (int)response.StatusCode}, + { "Headers", new JsonObject(FilterHeaders(response.Headers))}, + { "ContentHeaders", new JsonObject(FilterHeaders(response.Content.Headers))}, + { "Content", SerializeContent(response.Content, ref isBase64Response) }, + { "isContentBase64", isBase64Response }, + }} + }; + System.IO.File.WriteAllText(this.recordingPath, messages.ToString()); + } + + private JsonObject Load() + { + if (System.IO.File.Exists(this.recordingPath)) + { + try + { + return JsonObject.FromStream(System.IO.File.OpenRead(this.recordingPath)); + } + catch + { + throw new System.Exception($"Invalid recording file: '{recordingPath}'"); + } + } + + throw new System.ArgumentException($"Missing recording file: '{recordingPath}'", nameof(recordingPath)); + } + + public HttpResponseMessage LoadMessage(string rqKey) + { + var responses = Load(); + var message = responses.Property(rqKey); + + if (null == message) + { + throw new System.ArgumentException($"Missing Request '{rqKey}' in recording file", nameof(rqKey)); + } + + var sc = 0; + var reqMessage = message.Property("Request"); + var respMessage = message.Property("Response"); + + // --------------------------- deserialize response ---------------------------------------------------------------- + bool isBase64Response = false; + respMessage.BooleanProperty("isContentBase64", ref isBase64Response); + var response = new HttpResponseMessage + { + StatusCode = (HttpStatusCode)respMessage.NumberProperty("StatusCode", ref sc), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(respMessage.StringProperty("Content"), isBase64Response)) + }; + + foreach (var each in respMessage.Property("Headers")) + { + response.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + foreach (var frh in ForceResponseHeaders) + { + response.Headers.Remove(frh.Key); + response.Headers.TryAddWithoutValidation(frh.Key, frh.Value); + } + + foreach (var each in respMessage.Property("ContentHeaders")) + { + response.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + // --------------------------- deserialize request ---------------------------------------------------------------- + bool isBase64Request = false; + reqMessage.BooleanProperty("isContentBase64", ref isBase64Request); + response.RequestMessage = new HttpRequestMessage + { + Method = new HttpMethod(reqMessage.StringProperty("Method")), + RequestUri = new System.Uri(reqMessage.StringProperty("RequestUri")), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(reqMessage.StringProperty("Content"), isBase64Request)) + }; + + foreach (var each in reqMessage.Property("Headers")) + { + response.RequestMessage.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + foreach (var each in reqMessage.Property("ContentHeaders")) + { + response.RequestMessage.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + return response; + } + + public async Task SendAsync(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + counter++; + var rqkey = $"{Description}+{Context}+{Scenario}+${request.Method.Method}+{request.RequestUri}+{counter}"; + + switch (Mode) + { + case MockMode.Record: + //Add following code since the request.Content will be released after sendAsync + var requestClone = request; + if (requestClone.Content != null) + { + requestClone = await request.CloneWithContent(request.RequestUri, request.Method); + } + // make the call + var response = await next.SendAsync(request, callback); + + // save the message to the recording file + SaveMessage(rqkey, requestClone, response); + + // return the response. + return response; + + case MockMode.Playback: + // load and return the response. + return LoadMessage(rqkey); + + default: + // pass-thru, do nothing + return await next.SendAsync(request, callback); + } + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..b4e3bb0b30d0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Properties/Resources.Designer.cs @@ -0,0 +1,5655 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.generated.runtime.Properties +{ + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.PowerShell.Cmdlets.ContainerService.generated.runtime.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The remote server returned an error: (401) Unauthorized.. + /// + public static string AccessDeniedExceptionMessage + { + get + { + return ResourceManager.GetString("AccessDeniedExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account id doesn't match one in subscription.. + /// + public static string AccountIdDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("AccountIdDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account needs to be specified. + /// + public static string AccountNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account "{0}" has been added.. + /// + public static string AddAccountAdded + { + get + { + return ResourceManager.GetString("AddAccountAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To switch to a different subscription, please use Select-AzureSubscription.. + /// + public static string AddAccountChangeSubscription + { + get + { + return ResourceManager.GetString("AddAccountChangeSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential".. + /// + public static string AddAccountNonInteractiveGuestOrFpo + { + get + { + return ResourceManager.GetString("AddAccountNonInteractiveGuestOrFpo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription "{0}" is selected as the default subscription.. + /// + public static string AddAccountShowDefaultSubscription + { + get + { + return ResourceManager.GetString("AddAccountShowDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To view all the subscriptions, please use Get-AzureSubscription.. + /// + public static string AddAccountViewSubscriptions + { + get + { + return ResourceManager.GetString("AddAccountViewSubscriptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is created successfully.. + /// + public static string AddOnCreatedMessage + { + get + { + return ResourceManager.GetString("AddOnCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on name {0} is already used.. + /// + public static string AddOnNameAlreadyUsed + { + get + { + return ResourceManager.GetString("AddOnNameAlreadyUsed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} not found.. + /// + public static string AddOnNotFound + { + get + { + return ResourceManager.GetString("AddOnNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on {0} is removed successfully.. + /// + public static string AddOnRemovedMessage + { + get + { + return ResourceManager.GetString("AddOnRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is updated successfully.. + /// + public static string AddOnUpdatedMessage + { + get + { + return ResourceManager.GetString("AddOnUpdatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}.. + /// + public static string AddRoleMessageCreate + { + get + { + return ResourceManager.GetString("AddRoleMessageCreate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’.. + /// + public static string AddRoleMessageCreateNode + { + get + { + return ResourceManager.GetString("AddRoleMessageCreateNode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure".. + /// + public static string AddRoleMessageCreatePHP + { + get + { + return ResourceManager.GetString("AddRoleMessageCreatePHP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator. + /// + public static string AddRoleMessageInsufficientPermissions + { + get + { + return ResourceManager.GetString("AddRoleMessageInsufficientPermissions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A role name '{0}' already exists. + /// + public static string AddRoleMessageRoleExists + { + get + { + return ResourceManager.GetString("AddRoleMessageRoleExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} already has an endpoint with name {1}. + /// + public static string AddTrafficManagerEndpointFailed + { + get + { + return ResourceManager.GetString("AddTrafficManagerEndpointFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. + ///Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable [rest of string was truncated]";. + /// + public static string ARMDataCollectionMessage + { + get + { + return ResourceManager.GetString("ARMDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}.. + /// + public static string AuthenticatingForSingleTenant + { + get + { + return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows Azure Powershell\. + /// + public static string AzureDirectory + { + get + { + return ResourceManager.GetString("AzureDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://manage.windowsazure.com. + /// + public static string AzurePortalUrl + { + get + { + return ResourceManager.GetString("AzurePortalUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PORTAL_URL. + /// + public static string AzurePortalUrlEnv + { + get + { + return ResourceManager.GetString("AzurePortalUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected profile must not be null.. + /// + public static string AzureProfileMustNotBeNull + { + get + { + return ResourceManager.GetString("AzureProfileMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure SDK\{0}\. + /// + public static string AzureSdkDirectory + { + get + { + return ResourceManager.GetString("AzureSdkDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscArchiveAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscArchiveAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find configuration data file: {0}. + /// + public static string AzureVMDscCannotFindConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscCannotFindConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create Archive. + /// + public static string AzureVMDscCreateArchiveAction + { + get + { + return ResourceManager.GetString("AzureVMDscCreateArchiveAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The configuration data must be a .psd1 file. + /// + public static string AzureVMDscInvalidConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscInvalidConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing configuration script: {0}. + /// + public static string AzureVMDscParsingConfiguration + { + get + { + return ResourceManager.GetString("AzureVMDscParsingConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscStorageBlobAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscStorageBlobAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upload '{0}'. + /// + public static string AzureVMDscUploadToBlobStorageAction + { + get + { + return ResourceManager.GetString("AzureVMDscUploadToBlobStorageAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execution failed because a background thread could not prompt the user.. + /// + public static string BaseShouldMethodFailureReason + { + get + { + return ResourceManager.GetString("BaseShouldMethodFailureReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Uri was empty.. + /// + public static string BaseUriEmpty + { + get + { + return ResourceManager.GetString("BaseUriEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing without ParameterSet.. + /// + public static string BeginProcessingWithoutParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithoutParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing with ParameterSet '{1}'.. + /// + public static string BeginProcessingWithParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Blob with the name {0} already exists in the account.. + /// + public static string BlobAlreadyExistsInTheAccount + { + get + { + return ResourceManager.GetString("BlobAlreadyExistsInTheAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}.blob.core.windows.net/. + /// + public static string BlobEndpointUri + { + get + { + return ResourceManager.GetString("BlobEndpointUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_BLOBSTORAGE_TEMPLATE. + /// + public static string BlobEndpointUriEnv + { + get + { + return ResourceManager.GetString("BlobEndpointUriEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is changing.. + /// + public static string BreakingChangeAttributeParameterChanging + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterChanging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is becoming mandatory.. + /// + public static string BreakingChangeAttributeParameterMandatoryNow + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterMandatoryNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplaced + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplaced", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by mandatory parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplacedMandatory + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplacedMandatory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the parameter is changing from '{0}' to '{1}'.. + /// + public static string BreakingChangeAttributeParameterTypeChange + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterTypeChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change description : {0} + ///. + /// + public static string BreakingChangesAttributesChangeDescriptionMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesChangeDescriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet '{0}' is replacing this cmdlet.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type is changing from the existing type :'{0}' to the new type :'{1}'. + /// + public static string BreakingChangesAttributesCmdLetOutputChange1 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "The output type '{0}' is changing". + /// + public static string BreakingChangesAttributesCmdLetOutputChange2 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + ///- The following properties are being added to the output type : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesAdded + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + /// - The following properties in the output type are being deprecated : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesRemoved + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesRemoved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type '{0}' is being deprecated without a replacement.. + /// + public static string BreakingChangesAttributesCmdLetOutputTypeDeprecated + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputTypeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0} + /// + ///. + /// + public static string BreakingChangesAttributesDeclarationMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - Cmdlet : '{0}' + /// - {1} + ///. + /// + public static string BreakingChangesAttributesDeclarationMessageWithCmdletName + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessageWithCmdletName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to NOTE : Go to {0} for steps to suppress (and other related information on) the breaking change messages.. + /// + public static string BreakingChangesAttributesFooterMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesFooterMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Breaking changes in the cmdlet '{0}' :. + /// + public static string BreakingChangesAttributesHeaderMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesHeaderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note : This change will take effect on '{0}' + ///. + /// + public static string BreakingChangesAttributesInEffectByDateMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByDateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from az version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByAzVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByAzVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ```powershell + ///# Old + ///{0} + /// + ///# New + ///{1} + ///``` + /// + ///. + /// + public static string BreakingChangesAttributesUsageChangeMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cmdlet invocation changes : + /// Old Way : {0} + /// New Way : {1}. + /// + public static string BreakingChangesAttributesUsageChangeMessageConsole + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessageConsole", resourceCulture); + } + } + + /// + /// The cmdlet is in experimental stage. The function may not be enabled in current subscription. + /// + public static string ExperimentalCmdletMessage + { + get + { + return ResourceManager.GetString("ExperimentalCmdletMessage", resourceCulture); + } + } + + + + /// + /// Looks up a localized string similar to CACHERUNTIMEURL. + /// + public static string CacheRuntimeUrl + { + get + { + return ResourceManager.GetString("CacheRuntimeUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cache. + /// + public static string CacheRuntimeValue + { + get + { + return ResourceManager.GetString("CacheRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CacheRuntimeVersion. + /// + public static string CacheRuntimeVersionKey + { + get + { + return ResourceManager.GetString("CacheRuntimeVersionKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}). + /// + public static string CacheVersionWarningText + { + get + { + return ResourceManager.GetString("CacheVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot change built-in environment {0}.. + /// + public static string CannotChangeBuiltinEnvironment + { + get + { + return ResourceManager.GetString("CannotChangeBuiltinEnvironment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find {0} with name {1}.. + /// + public static string CannotFind + { + get + { + return ResourceManager.GetString("CannotFind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment for service {0} with {1} slot doesn't exist. + /// + public static string CannotFindDeployment + { + get + { + return ResourceManager.GetString("CannotFindDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't find valid Microsoft Azure role in current directory {0}. + /// + public static string CannotFindRole + { + get + { + return ResourceManager.GetString("CannotFindRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist. + /// + public static string CannotFindServiceConfigurationFile + { + get + { + return ResourceManager.GetString("CannotFindServiceConfigurationFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders.. + /// + public static string CannotFindServiceRoot + { + get + { + return ResourceManager.GetString("CannotFindServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated.. + /// + public static string CannotUpdateUnknownSubscription + { + get + { + return ResourceManager.GetString("CannotUpdateUnknownSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ManagementCertificate. + /// + public static string CertificateElementName + { + get + { + return ResourceManager.GetString("CertificateElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to certificate.pfx. + /// + public static string CertificateFileName + { + get + { + return ResourceManager.GetString("CertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate imported into CurrentUser\My\{0}. + /// + public static string CertificateImportedMessage + { + get + { + return ResourceManager.GetString("CertificateImportedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. + /// + public static string CertificateNotFoundInStore + { + get + { + return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your account does not have access to the private key for certificate {0}. + /// + public static string CertificatePrivateKeyAccessError + { + get + { + return ResourceManager.GetString("CertificatePrivateKeyAccessError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} deployment for {2} service. + /// + public static string ChangeDeploymentStateWaitMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStateWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cloud service {0} is in {1} state.. + /// + public static string ChangeDeploymentStatusCompleteMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStatusCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing/Removing public environment '{0}' is not allowed.. + /// + public static string ChangePublicEnvironmentMessage + { + get + { + return ResourceManager.GetString("ChangePublicEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} is set to value {1}. + /// + public static string ChangeSettingsElementMessage + { + get + { + return ResourceManager.GetString("ChangeSettingsElementMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing public environment is not supported.. + /// + public static string ChangingDefaultEnvironmentNotSupported + { + get + { + return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choose which publish settings file to use:. + /// + public static string ChoosePublishSettingsFile + { + get + { + return ResourceManager.GetString("ChoosePublishSettingsFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel. + /// + public static string ClientDiagnosticLevelName + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string ClientDiagnosticLevelValue + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cloud_package.cspkg. + /// + public static string CloudPackageFileName + { + get + { + return ResourceManager.GetString("CloudPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Cloud.cscfg. + /// + public static string CloudServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("CloudServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-ons for {0}. + /// + public static string CloudServiceDescription + { + get + { + return ResourceManager.GetString("CloudServiceDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive.. + /// + public static string CommunicationCouldNotBeEstablished + { + get + { + return ResourceManager.GetString("CommunicationCouldNotBeEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete. + /// + public static string CompleteMessage + { + get + { + return ResourceManager.GetString("CompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OperationID : '{0}'. + /// + public static string ComputeCloudExceptionOperationIdMessage + { + get + { + return ResourceManager.GetString("ComputeCloudExceptionOperationIdMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to config.json. + /// + public static string ConfigurationFileName + { + get + { + return ResourceManager.GetString("ConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to VirtualMachine creation failed.. + /// + public static string CreateFailedErrorMessage + { + get + { + return ResourceManager.GetString("CreateFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead.. + /// + public static string CreateWebsiteFailed + { + get + { + return ResourceManager.GetString("CreateWebsiteFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core. + /// + public static string DataCacheClientsType + { + get + { + return ResourceManager.GetString("DataCacheClientsType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //blobcontainer[@datacenter='{0}']. + /// + public static string DatacenterBlobQuery + { + get + { + return ResourceManager.GetString("DatacenterBlobQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure PowerShell Data Collection Confirmation. + /// + public static string DataCollectionActivity + { + get + { + return ResourceManager.GetString("DataCollectionActivity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose not to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmNo + { + get + { + return ResourceManager.GetString("DataCollectionConfirmNo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This confirmation message will be dismissed in '{0}' second(s).... + /// + public static string DataCollectionConfirmTime + { + get + { + return ResourceManager.GetString("DataCollectionConfirmTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmYes + { + get + { + return ResourceManager.GetString("DataCollectionConfirmYes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The setting profile has been saved to the following path '{0}'.. + /// + public static string DataCollectionSaveFileInformation + { + get + { + return ResourceManager.GetString("DataCollectionSaveFileInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription. + /// + public static string DefaultAndCurrentSubscription + { + get + { + return ResourceManager.GetString("DefaultAndCurrentSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to none. + /// + public static string DefaultFileVersion + { + get + { + return ResourceManager.GetString("DefaultFileVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are no hostnames which could be used for validation.. + /// + public static string DefaultHostnamesValidation + { + get + { + return ResourceManager.GetString("DefaultHostnamesValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 8080. + /// + public static string DefaultPort + { + get + { + return ResourceManager.GetString("DefaultPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string DefaultRoleCachingInMB + { + get + { + return ResourceManager.GetString("DefaultRoleCachingInMB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto. + /// + public static string DefaultUpgradeMode + { + get + { + return ResourceManager.GetString("DefaultUpgradeMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 80. + /// + public static string DefaultWebPort + { + get + { + return ResourceManager.GetString("DefaultWebPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string Delete + { + get + { + return ResourceManager.GetString("Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for service {1} is already in {2} state. + /// + public static string DeploymentAlreadyInState + { + get + { + return ResourceManager.GetString("DeploymentAlreadyInState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment in {0} slot for service {1} is removed. + /// + public static string DeploymentRemovedMessage + { + get + { + return ResourceManager.GetString("DeploymentRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel. + /// + public static string DiagnosticLevelName + { + get + { + return ResourceManager.GetString("DiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string DiagnosticLevelValue + { + get + { + return ResourceManager.GetString("DiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key to add already exists in the dictionary.. + /// + public static string DictionaryAddAlreadyContainsKey + { + get + { + return ResourceManager.GetString("DictionaryAddAlreadyContainsKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The array index cannot be less than zero.. + /// + public static string DictionaryCopyToArrayIndexLessThanZero + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayIndexLessThanZero", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The supplied array does not have enough room to contain the copied elements.. + /// + public static string DictionaryCopyToArrayTooShort + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayTooShort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided dns {0} doesn't exist. + /// + public static string DnsDoesNotExist + { + get + { + return ResourceManager.GetString("DnsDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure Certificate. + /// + public static string EnableRemoteDesktop_FriendlyCertificateName + { + get + { + return ResourceManager.GetString("EnableRemoteDesktop_FriendlyCertificateName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Endpoint can't be retrieved for storage account. + /// + public static string EndPointNotFoundForBlobStorage + { + get + { + return ResourceManager.GetString("EndPointNotFoundForBlobStorage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} end processing.. + /// + public static string EndProcessingLog + { + get + { + return ResourceManager.GetString("EndProcessingLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet.. + /// + public static string EnvironmentDoesNotSupportActiveDirectory + { + get + { + return ResourceManager.GetString("EnvironmentDoesNotSupportActiveDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment '{0}' already exists.. + /// + public static string EnvironmentExists + { + get + { + return ResourceManager.GetString("EnvironmentExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name doesn't match one in subscription.. + /// + public static string EnvironmentNameDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("EnvironmentNameDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name needs to be specified.. + /// + public static string EnvironmentNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment needs to be specified.. + /// + public static string EnvironmentNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment name '{0}' is not found.. + /// + public static string EnvironmentNotFound + { + get + { + return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to environments.xml. + /// + public static string EnvironmentsFileName + { + get + { + return ResourceManager.GetString("EnvironmentsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error creating VirtualMachine. + /// + public static string ErrorCreatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorCreatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to download available runtimes for location '{0}'. + /// + public static string ErrorRetrievingRuntimesForLocation + { + get + { + return ResourceManager.GetString("ErrorRetrievingRuntimesForLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error updating VirtualMachine. + /// + public static string ErrorUpdatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorUpdatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} failed. Error: {1}, ExceptionDetails: {2}. + /// + public static string FailedJobErrorMessage + { + get + { + return ResourceManager.GetString("FailedJobErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File path is not valid.. + /// + public static string FilePathIsNotValid + { + get + { + return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP request was forbidden with client authentication scheme 'Anonymous'.. + /// + public static string FirstPurchaseErrorMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell.. + /// + public static string FirstPurchaseMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation Status:. + /// + public static string GatewayOperationStatus + { + get + { + return ResourceManager.GetString("GatewayOperationStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\General. + /// + public static string GeneralScaffolding + { + get + { + return ResourceManager.GetString("GeneralScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting all available Microsoft Azure Add-Ons, this may take few minutes.... + /// + public static string GetAllAddOnsWaitMessage + { + get + { + return ResourceManager.GetString("GetAllAddOnsWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name{0}Primary Key{0}Seconday Key. + /// + public static string GetStorageKeysHeader + { + get + { + return ResourceManager.GetString("GetStorageKeysHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Git not found. Please install git and place it in your command line path.. + /// + public static string GitNotFound + { + get + { + return ResourceManager.GetString("GitNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find publish settings. Please run Import-AzurePublishSettingsFile.. + /// + public static string GlobalSettingsManager_Load_PublishSettingsNotFound + { + get + { + return ResourceManager.GetString("GlobalSettingsManager_Load_PublishSettingsNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg end element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoEndWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoEndWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WadCfg start element in the config is not matching the end element.. + /// + public static string IaasDiagnosticsBadConfigNoMatchingWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoMatchingWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode.dll. + /// + public static string IISNodeDll + { + get + { + return ResourceManager.GetString("IISNodeDll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeEngineKey + { + get + { + return ResourceManager.GetString("IISNodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode-dev\\release\\x64. + /// + public static string IISNodePath + { + get + { + return ResourceManager.GetString("IISNodePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeRuntimeValue + { + get + { + return ResourceManager.GetString("IISNodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}). + /// + public static string IISNodeVersionWarningText + { + get + { + return ResourceManager.GetString("IISNodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illegal characters in path.. + /// + public static string IllegalPath + { + get + { + return ResourceManager.GetString("IllegalPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. + /// + public static string InternalServerErrorMessage + { + get + { + return ResourceManager.GetString("InternalServerErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot enable memcach protocol on a cache worker role {0}.. + /// + public static string InvalidCacheRoleName + { + get + { + return ResourceManager.GetString("InvalidCacheRoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. + /// + public static string InvalidCertificate + { + get + { + return ResourceManager.GetString("InvalidCertificate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format.. + /// + public static string InvalidCertificateSingle + { + get + { + return ResourceManager.GetString("InvalidCertificateSingle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided configuration path is invalid or doesn't exist. + /// + public static string InvalidConfigPath + { + get + { + return ResourceManager.GetString("InvalidConfigPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2.. + /// + public static string InvalidCountryNameMessage + { + get + { + return ResourceManager.GetString("InvalidCountryNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. + /// + public static string InvalidDefaultSubscription + { + get + { + return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment with {0} does not exist. + /// + public static string InvalidDeployment + { + get + { + return ResourceManager.GetString("InvalidDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production".. + /// + public static string InvalidDeploymentSlot + { + get + { + return ResourceManager.GetString("InvalidDeploymentSlot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. + /// + public static string InvalidDnsName + { + get + { + return ResourceManager.GetString("InvalidDnsName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service endpoint.. + /// + public static string InvalidEndpoint + { + get + { + return ResourceManager.GetString("InvalidEndpoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. + /// + public static string InvalidFileExtension + { + get + { + return ResourceManager.GetString("InvalidFileExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File {0} has invalid characters. + /// + public static string InvalidFileName + { + get + { + return ResourceManager.GetString("InvalidFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your git publishing credentials using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. On the left side open "Web Sites" + ///2. Click on any website + ///3. Choose "Setup Git Publishing" or "Reset deployment credentials" + ///4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username}. + /// + public static string InvalidGitCredentials + { + get + { + return ResourceManager.GetString("InvalidGitCredentials", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value {0} provided is not a valid GUID. Please provide a valid GUID.. + /// + public static string InvalidGuid + { + get + { + return ResourceManager.GetString("InvalidGuid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified hostname does not exist. Please specify a valid hostname for the site.. + /// + public static string InvalidHostnameValidation + { + get + { + return ResourceManager.GetString("InvalidHostnameValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances must be greater than or equal 0 and less than or equal 20. + /// + public static string InvalidInstancesCount + { + get + { + return ResourceManager.GetString("InvalidInstancesCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file.. + /// + public static string InvalidJobFile + { + get + { + return ResourceManager.GetString("InvalidJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not download a valid runtime manifest, Please check your internet connection and try again.. + /// + public static string InvalidManifestError + { + get + { + return ResourceManager.GetString("InvalidManifestError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The account {0} was not found. Please specify a valid account name.. + /// + public static string InvalidMediaServicesAccount + { + get + { + return ResourceManager.GetString("InvalidMediaServicesAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided name "{0}" does not match the service bus namespace naming rules.. + /// + public static string InvalidNamespaceName + { + get + { + return ResourceManager.GetString("InvalidNamespaceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path must specify a valid path to an Azure profile.. + /// + public static string InvalidNewProfilePath + { + get + { + return ResourceManager.GetString("InvalidNewProfilePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be null. Parameter name: '{0}'. + /// + public static string InvalidNullArgument + { + get + { + return ResourceManager.GetString("InvalidNullArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is invalid or empty. + /// + public static string InvalidOrEmptyArgumentMessage + { + get + { + return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided package path is invalid or doesn't exist. + /// + public static string InvalidPackagePath + { + get + { + return ResourceManager.GetString("InvalidPackagePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is an invalid parameter set name.. + /// + public static string InvalidParameterSetName + { + get + { + return ResourceManager.GetString("InvalidParameterSetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} doesn't exist in {1} or you've not passed valid value for it. + /// + public static string InvalidPath + { + get + { + return ResourceManager.GetString("InvalidPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} has invalid characters. + /// + public static string InvalidPathName + { + get + { + return ResourceManager.GetString("InvalidPathName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token}. + /// + public static string InvalidProfileProperties + { + get + { + return ResourceManager.GetString("InvalidProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile. + /// + public static string InvalidPublishSettingsSchema + { + get + { + return ResourceManager.GetString("InvalidPublishSettingsSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name "{0}" has invalid characters. + /// + public static string InvalidRoleNameMessage + { + get + { + return ResourceManager.GetString("InvalidRoleNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid name for the service root folder is required. + /// + public static string InvalidRootNameMessage + { + get + { + return ResourceManager.GetString("InvalidRootNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a recognized runtime type. + /// + public static string InvalidRuntimeError + { + get + { + return ResourceManager.GetString("InvalidRuntimeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid language is required. + /// + public static string InvalidScaffoldingLanguageArg + { + get + { + return ResourceManager.GetString("InvalidScaffoldingLanguageArg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscription is currently selected. Use Select-Subscription to activate a subscription.. + /// + public static string InvalidSelectedSubscription + { + get + { + return ResourceManager.GetString("InvalidSelectedSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations.. + /// + public static string InvalidServiceBusLocation + { + get + { + return ResourceManager.GetString("InvalidServiceBusLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide a service name or run this command from inside a service project directory.. + /// + public static string InvalidServiceName + { + get + { + return ResourceManager.GetString("InvalidServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must provide valid value for {0}. + /// + public static string InvalidServiceSettingElement + { + get + { + return ResourceManager.GetString("InvalidServiceSettingElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to settings.json is invalid or doesn't exist. + /// + public static string InvalidServiceSettingMessage + { + get + { + return ResourceManager.GetString("InvalidServiceSettingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data.. + /// + public static string InvalidSubscription + { + get + { + return ResourceManager.GetString("InvalidSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscription id {0} is not valid. + /// + public static string InvalidSubscriptionId + { + get + { + return ResourceManager.GetString("InvalidSubscriptionId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Must specify a non-null subscription name.. + /// + public static string InvalidSubscriptionName + { + get + { + return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet. + /// + public static string InvalidSubscriptionNameMessage + { + get + { + return ResourceManager.GetString("InvalidSubscriptionNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscriptions file {0} has invalid content.. + /// + public static string InvalidSubscriptionsDataSchema + { + get + { + return ResourceManager.GetString("InvalidSubscriptionsDataSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge.. + /// + public static string InvalidVMSize + { + get + { + return ResourceManager.GetString("InvalidVMSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The web job file must have *.zip extension. + /// + public static string InvalidWebJobFile + { + get + { + return ResourceManager.GetString("InvalidWebJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Singleton option works for continuous jobs only.. + /// + public static string InvalidWebJobSingleton + { + get + { + return ResourceManager.GetString("InvalidWebJobSingleton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The website {0} was not found. Please specify a valid website name.. + /// + public static string InvalidWebsite + { + get + { + return ResourceManager.GetString("InvalidWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No job for id: {0} was found.. + /// + public static string JobNotFound + { + get + { + return ResourceManager.GetString("JobNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to engines. + /// + public static string JsonEnginesSectionName + { + get + { + return ResourceManager.GetString("JsonEnginesSectionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scaffolding for this language is not yet supported. + /// + public static string LanguageScaffoldingIsNotSupported + { + get + { + return ResourceManager.GetString("LanguageScaffoldingIsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Link already established. + /// + public static string LinkAlreadyEstablished + { + get + { + return ResourceManager.GetString("LinkAlreadyEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to local_package.csx. + /// + public static string LocalPackageFileName + { + get + { + return ResourceManager.GetString("LocalPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Local.cscfg. + /// + public static string LocalServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("LocalServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for {0} deployment for {1} cloud service.... + /// + public static string LookingForDeploymentMessage + { + get + { + return ResourceManager.GetString("LookingForDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for cloud service {0}.... + /// + public static string LookingForServiceMessage + { + get + { + return ResourceManager.GetString("LookingForServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure Long-Running Job. + /// + public static string LROJobName + { + get + { + return ResourceManager.GetString("LROJobName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter.. + /// + public static string LROTaskExceptionMessage + { + get + { + return ResourceManager.GetString("LROTaskExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to managementCertificate.pem. + /// + public static string ManagementCertificateFileName + { + get + { + return ResourceManager.GetString("ManagementCertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ?whr={0}. + /// + public static string ManagementPortalRealmFormat + { + get + { + return ResourceManager.GetString("ManagementPortalRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //baseuri. + /// + public static string ManifestBaseUriQuery + { + get + { + return ResourceManager.GetString("ManifestBaseUriQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uri. + /// + public static string ManifestBlobUriKey + { + get + { + return ResourceManager.GetString("ManifestBlobUriKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml. + /// + public static string ManifestUri + { + get + { + return ResourceManager.GetString("ManifestUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'.. + /// + public static string MissingCertificateInProfileProperties + { + get + { + return ResourceManager.GetString("MissingCertificateInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'.. + /// + public static string MissingPasswordInProfileProperties + { + get + { + return ResourceManager.GetString("MissingPasswordInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'SubscriptionId'.. + /// + public static string MissingSubscriptionInProfileProperties + { + get + { + return ResourceManager.GetString("MissingSubscriptionInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple Add-Ons found holding name {0}. + /// + public static string MultipleAddOnsFoundMessage + { + get + { + return ResourceManager.GetString("MultipleAddOnsFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername.. + /// + public static string MultiplePublishingUsernames + { + get + { + return ResourceManager.GetString("MultiplePublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The first publish settings file "{0}" is used. If you want to use another file specify the file name.. + /// + public static string MultiplePublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("MultiplePublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.NamedCaches. + /// + public static string NamedCacheSettingName + { + get + { + return ResourceManager.GetString("NamedCacheSettingName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}. + /// + public static string NamedCacheSettingValue + { + get + { + return ResourceManager.GetString("NamedCacheSettingValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A publishing username is required. Please specify one using the argument PublishingUsername.. + /// + public static string NeedPublishingUsernames + { + get + { + return ResourceManager.GetString("NeedPublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Add-On Confirmation. + /// + public static string NewAddOnConformation + { + get + { + return ResourceManager.GetString("NewAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string NewMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names.. + /// + public static string NewNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("NewNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at {0} and (c) agree to sharing my contact information with {2}.. + /// + public static string NewNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service has been created at {0}. + /// + public static string NewServiceCreatedMessage + { + get + { + return ResourceManager.GetString("NewServiceCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + public static string No + { + get + { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription.. + /// + public static string NoCachedToken + { + get + { + return ResourceManager.GetString("NoCachedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole.. + /// + public static string NoCacheWorkerRoles + { + get + { + return ResourceManager.GetString("NoCacheWorkerRoles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No clouds available. + /// + public static string NoCloudsAvailable + { + get + { + return ResourceManager.GetString("NoCloudsAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "There is no current context, please log in using Connect-AzAccount.". + /// + public static string NoCurrentContextForDataCmdlet + { + get + { + return ResourceManager.GetString("NoCurrentContextForDataCmdlet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeDirectory + { + get + { + return ResourceManager.GetString("NodeDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeEngineKey + { + get + { + return ResourceManager.GetString("NodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node.exe. + /// + public static string NodeExe + { + get + { + return ResourceManager.GetString("NodeExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name>. + /// + public static string NoDefaultSubscriptionMessage + { + get + { + return ResourceManager.GetString("NoDefaultSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft SDKs\Azure\Nodejs\Nov2011. + /// + public static string NodeModulesPath + { + get + { + return ResourceManager.GetString("NodeModulesPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeProgramFilesFolderName + { + get + { + return ResourceManager.GetString("NodeProgramFilesFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeRuntimeValue + { + get + { + return ResourceManager.GetString("NodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\Node. + /// + public static string NodeScaffolding + { + get + { + return ResourceManager.GetString("NodeScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node. + /// + public static string NodeScaffoldingResources + { + get + { + return ResourceManager.GetString("NodeScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}). + /// + public static string NodeVersionWarningText + { + get + { + return ResourceManager.GetString("NodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No, I do not agree. + /// + public static string NoHint + { + get + { + return ResourceManager.GetString("NoHint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. + /// + public static string NoInternetConnection + { + get + { + return ResourceManager.GetString("NoInternetConnection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <NONE>. + /// + public static string None + { + get + { + return ResourceManager.GetString("None", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No publish settings files with extension *.publishsettings are found in the directory "{0}".. + /// + public static string NoPublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("NoPublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no subscription associated with account {0}.. + /// + public static string NoSubscriptionAddedMessage + { + get + { + return ResourceManager.GetString("NoSubscriptionAddedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount?. + /// + public static string NoSubscriptionFoundForTenant + { + get + { + return ResourceManager.GetString("NoSubscriptionFoundForTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration.. + /// + public static string NotCacheWorkerRole + { + get + { + return ResourceManager.GetString("NotCacheWorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate can't be null.. + /// + public static string NullCertificateMessage + { + get + { + return ResourceManager.GetString("NullCertificateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} could not be null or empty. + /// + public static string NullObjectMessage + { + get + { + return ResourceManager.GetString("NullObjectMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add a null RoleSettings to {0}. + /// + public static string NullRoleSettingsMessage + { + get + { + return ResourceManager.GetString("NullRoleSettingsMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add new role to null service definition. + /// + public static string NullServiceDefinitionMessage + { + get + { + return ResourceManager.GetString("NullServiceDefinitionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request offer '{0}' is not found.. + /// + public static string OfferNotFoundMessage + { + get + { + return ResourceManager.GetString("OfferNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation "{0}" failed on VM with ID: {1}. + /// + public static string OperationFailedErrorMessage + { + get + { + return ResourceManager.GetString("OperationFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The REST operation failed with message '{0}' and error code '{1}'. + /// + public static string OperationFailedMessage + { + get + { + return ResourceManager.GetString("OperationFailedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state.. + /// + public static string OperationTimedOutOrError + { + get + { + return ResourceManager.GetString("OperationTimedOutOrError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package. + /// + public static string Package + { + get + { + return ResourceManager.GetString("Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Package is created at service root path {0}.. + /// + public static string PackageCreated + { + get + { + return ResourceManager.GetString("PackageCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {{ + /// "author": "", + /// + /// "name": "{0}", + /// "version": "0.0.0", + /// "dependencies":{{}}, + /// "devDependencies":{{}}, + /// "optionalDependencies": {{}}, + /// "engines": {{ + /// "node": "*", + /// "iisnode": "*" + /// }} + /// + ///}} + ///. + /// + public static string PackageJsonDefaultFile + { + get + { + return ResourceManager.GetString("PackageJsonDefaultFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package.json. + /// + public static string PackageJsonFileName + { + get + { + return ResourceManager.GetString("PackageJsonFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} doesn't exist.. + /// + public static string PathDoesNotExist + { + get + { + return ResourceManager.GetString("PathDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. + /// + public static string PathDoesNotExistForElement + { + get + { + return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Peer Asn has to be provided.. + /// + public static string PeerAsnRequired + { + get + { + return ResourceManager.GetString("PeerAsnRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 5.4.0. + /// + public static string PHPDefaultRuntimeVersion + { + get + { + return ResourceManager.GetString("PHPDefaultRuntimeVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to php. + /// + public static string PhpRuntimeValue + { + get + { + return ResourceManager.GetString("PhpRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\PHP. + /// + public static string PHPScaffolding + { + get + { + return ResourceManager.GetString("PHPScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP. + /// + public static string PHPScaffoldingResources + { + get + { + return ResourceManager.GetString("PHPScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}). + /// + public static string PHPVersionWarningText + { + get + { + return ResourceManager.GetString("PHPVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your first web site using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. At the bottom of the page, click on New > Web Site > Quick Create + ///2. Type {0} in the URL field + ///3. Click on "Create Web Site" + ///4. Once the site has been created, click on the site name + ///5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create.. + /// + public static string PortalInstructions + { + get + { + return ResourceManager.GetString("PortalInstructions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git". + /// + public static string PortalInstructionsGit + { + get + { + return ResourceManager.GetString("PortalInstructionsGit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The estimated generally available date is '{0}'.. + /// + public static string PreviewCmdletETAMessage { + get { + return ResourceManager.GetString("PreviewCmdletETAMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. Its behavior is subject to change based on customer feedback.. + /// + public static string PreviewCmdletMessage + { + get + { + return ResourceManager.GetString("PreviewCmdletMessage", resourceCulture); + } + } + + + /// + /// Looks up a localized string similar to A value for the Primary Peer Subnet has to be provided.. + /// + public static string PrimaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("PrimaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Promotion code can be used only when updating to a new plan.. + /// + public static string PromotionCodeWithCurrentPlanMessage + { + get + { + return ResourceManager.GetString("PromotionCodeWithCurrentPlanMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service not published at user request.. + /// + public static string PublishAbortedAtUserRequest + { + get + { + return ResourceManager.GetString("PublishAbortedAtUserRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete.. + /// + public static string PublishCompleteMessage + { + get + { + return ResourceManager.GetString("PublishCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connecting.... + /// + public static string PublishConnectingMessage + { + get + { + return ResourceManager.GetString("PublishConnectingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Deployment ID: {0}.. + /// + public static string PublishCreatedDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishCreatedDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created hosted service '{0}'.. + /// + public static string PublishCreatedServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatedServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Website URL: {0}.. + /// + public static string PublishCreatedWebsiteMessage + { + get + { + return ResourceManager.GetString("PublishCreatedWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating.... + /// + public static string PublishCreatingServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatingServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Initializing.... + /// + public static string PublishInitializingMessage + { + get + { + return ResourceManager.GetString("PublishInitializingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to busy. + /// + public static string PublishInstanceStatusBusy + { + get + { + return ResourceManager.GetString("PublishInstanceStatusBusy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to creating the virtual machine. + /// + public static string PublishInstanceStatusCreating + { + get + { + return ResourceManager.GetString("PublishInstanceStatusCreating", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instance {0} of role {1} is {2}.. + /// + public static string PublishInstanceStatusMessage + { + get + { + return ResourceManager.GetString("PublishInstanceStatusMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ready. + /// + public static string PublishInstanceStatusReady + { + get + { + return ResourceManager.GetString("PublishInstanceStatusReady", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing deployment for {0} with Subscription ID: {1}.... + /// + public static string PublishPreparingDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishPreparingDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publishing {0} to Microsoft Azure. This may take several minutes.... + /// + public static string PublishServiceStartMessage + { + get + { + return ResourceManager.GetString("PublishServiceStartMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publish settings. + /// + public static string PublishSettings + { + get + { + return ResourceManager.GetString("PublishSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure. + /// + public static string PublishSettingsElementName + { + get + { + return ResourceManager.GetString("PublishSettingsElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to .PublishSettings. + /// + public static string PublishSettingsFileExtention + { + get + { + return ResourceManager.GetString("PublishSettingsFileExtention", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publishSettings.xml. + /// + public static string PublishSettingsFileName + { + get + { + return ResourceManager.GetString("PublishSettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &whr={0}. + /// + public static string PublishSettingsFileRealmFormat + { + get + { + return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publish settings imported. + /// + public static string PublishSettingsSetSuccessfully + { + get + { + return ResourceManager.GetString("PublishSettingsSetSuccessfully", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PUBLISHINGPROFILE_URL. + /// + public static string PublishSettingsUrlEnv + { + get + { + return ResourceManager.GetString("PublishSettingsUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting.... + /// + public static string PublishStartingMessage + { + get + { + return ResourceManager.GetString("PublishStartingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upgrading.... + /// + public static string PublishUpgradingMessage + { + get + { + return ResourceManager.GetString("PublishUpgradingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uploading Package to storage service {0}.... + /// + public static string PublishUploadingPackageMessage + { + get + { + return ResourceManager.GetString("PublishUploadingPackageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verifying storage account '{0}'.... + /// + public static string PublishVerifyingStorageMessage + { + get + { + return ResourceManager.GetString("PublishVerifyingStorageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionAdditionalContentPathNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionAdditionalContentPathNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration published to {0}. + /// + public static string PublishVMDscExtensionArchiveUploadedMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionArchiveUploadedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyFileVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyFileVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy the module '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyModuleVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyModuleVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1).. + /// + public static string PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleted '{0}'. + /// + public static string PublishVMDscExtensionDeletedFileMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeletedFileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot delete '{0}': {1}. + /// + public static string PublishVMDscExtensionDeleteErrorMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeleteErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionDirectoryNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDirectoryNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot get module for DscResource '{0}'. Possible solutions: + ///1) Specify -ModuleName for Import-DscResource in your configuration. + ///2) Unblock module that contains resource. + ///3) Move Import-DscResource inside Node block. + ///. + /// + public static string PublishVMDscExtensionGetDscResourceFailed + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionGetDscResourceFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List of required modules: [{0}].. + /// + public static string PublishVMDscExtensionRequiredModulesVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredModulesVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version.. + /// + public static string PublishVMDscExtensionRequiredPsVersion + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredPsVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration script '{0}' contained parse errors: + ///{1}. + /// + public static string PublishVMDscExtensionStorageParserErrors + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionStorageParserErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Temp folder '{0}' created.. + /// + public static string PublishVMDscExtensionTempFolderVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionTempFolderVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip).. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration file '{0}' not found.. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. + ///Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enab [rest of string was truncated]";. + /// + public static string RDFEDataCollectionMessage + { + get + { + return ResourceManager.GetString("RDFEDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replace current deployment with '{0}' Id ?. + /// + public static string RedeployCommit + { + get + { + return ResourceManager.GetString("RedeployCommit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to regenerate key?. + /// + public static string RegenerateKeyWarning + { + get + { + return ResourceManager.GetString("RegenerateKeyWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Generate new key.. + /// + public static string RegenerateKeyWhatIfMessage + { + get + { + return ResourceManager.GetString("RegenerateKeyWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove account '{0}'?. + /// + public static string RemoveAccountConfirmation + { + get + { + return ResourceManager.GetString("RemoveAccountConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing account. + /// + public static string RemoveAccountMessage + { + get + { + return ResourceManager.GetString("RemoveAccountMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove Add-On Confirmation. + /// + public static string RemoveAddOnConformation + { + get + { + return ResourceManager.GetString("RemoveAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm.. + /// + public static string RemoveAddOnMessage + { + get + { + return ResourceManager.GetString("RemoveAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureBGPPeering Operation failed.. + /// + public static string RemoveAzureBGPPeeringFailed + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Bgp Peering. + /// + public static string RemoveAzureBGPPeeringMessage + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Bgp Peering with Service Key {0}.. + /// + public static string RemoveAzureBGPPeeringSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Bgp Peering with service key '{0}'?. + /// + public static string RemoveAzureBGPPeeringWarning + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit with service key '{0}'?. + /// + public static string RemoveAzureDedicatdCircuitWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatdCircuitWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuit Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuitLink Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitLinkFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circui Link. + /// + public static string RemoveAzureDedicatedCircuitLinkMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1}. + /// + public static string RemoveAzureDedicatedCircuitLinkSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'?. + /// + public static string RemoveAzureDedicatedCircuitLinkWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circuit. + /// + public static string RemoveAzureDedicatedCircuitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit with Service Key {0}.. + /// + public static string RemoveAzureDedicatedCircuitSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing cloud service {0}.... + /// + public static string RemoveAzureServiceWaitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureServiceWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription.. + /// + public static string RemoveDefaultSubscription + { + get + { + return ResourceManager.GetString("RemoveDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing {0} deployment for {1} service. + /// + public static string RemoveDeploymentWaitMessage + { + get + { + return ResourceManager.GetString("RemoveDeploymentWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'?. + /// + public static string RemoveEnvironmentConfirmation + { + get + { + return ResourceManager.GetString("RemoveEnvironmentConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing environment. + /// + public static string RemoveEnvironmentMessage + { + get + { + return ResourceManager.GetString("RemoveEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job collection. + /// + public static string RemoveJobCollectionMessage + { + get + { + return ResourceManager.GetString("RemoveJobCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job collection "{0}". + /// + public static string RemoveJobCollectionWarning + { + get + { + return ResourceManager.GetString("RemoveJobCollectionWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job. + /// + public static string RemoveJobMessage + { + get + { + return ResourceManager.GetString("RemoveJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job "{0}". + /// + public static string RemoveJobWarning + { + get + { + return ResourceManager.GetString("RemoveJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the account?. + /// + public static string RemoveMediaAccountWarning + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account removed.. + /// + public static string RemoveMediaAccountWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription.. + /// + public static string RemoveNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("RemoveNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing old package {0}.... + /// + public static string RemovePackage + { + get + { + return ResourceManager.GetString("RemovePackage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile?. + /// + public static string RemoveProfileConfirmation + { + get + { + return ResourceManager.GetString("RemoveProfileConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile. + /// + public static string RemoveProfileMessage + { + get + { + return ResourceManager.GetString("RemoveProfileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the namespace '{0}'?. + /// + public static string RemoveServiceBusNamespaceConfirmation + { + get + { + return ResourceManager.GetString("RemoveServiceBusNamespaceConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove cloud service?. + /// + public static string RemoveServiceWarning + { + get + { + return ResourceManager.GetString("RemoveServiceWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove cloud service and all it's deployments. + /// + public static string RemoveServiceWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveServiceWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove subscription '{0}'?. + /// + public static string RemoveSubscriptionConfirmation + { + get + { + return ResourceManager.GetString("RemoveSubscriptionConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing subscription. + /// + public static string RemoveSubscriptionMessage + { + get + { + return ResourceManager.GetString("RemoveSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The endpoint {0} cannot be removed from profile {1} because it's not in the profile.. + /// + public static string RemoveTrafficManagerEndpointMissing + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerEndpointMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureTrafficManagerProfile Operation failed.. + /// + public static string RemoveTrafficManagerProfileFailed + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Traffic Manager profile with name {0}.. + /// + public static string RemoveTrafficManagerProfileSucceeded + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Traffic Manager profile "{0}"?. + /// + public static string RemoveTrafficManagerProfileWarning + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the VM '{0}'?. + /// + public static string RemoveVMConfirmationMessage + { + get + { + return ResourceManager.GetString("RemoveVMConfirmationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting VM.. + /// + public static string RemoveVMMessage + { + get + { + return ResourceManager.GetString("RemoveVMMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing WebJob.... + /// + public static string RemoveWebJobMessage + { + get + { + return ResourceManager.GetString("RemoveWebJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove job '{0}'?. + /// + public static string RemoveWebJobWarning + { + get + { + return ResourceManager.GetString("RemoveWebJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing website. + /// + public static string RemoveWebsiteMessage + { + get + { + return ResourceManager.GetString("RemoveWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the website "{0}". + /// + public static string RemoveWebsiteWarning + { + get + { + return ResourceManager.GetString("RemoveWebsiteWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing public environment is not supported.. + /// + public static string RemovingDefaultEnvironmentsNotSupported + { + get + { + return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting namespace. + /// + public static string RemovingNamespaceMessage + { + get + { + return ResourceManager.GetString("RemovingNamespaceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repository is not setup. You need to pass a valid site name.. + /// + public static string RepositoryNotSetup + { + get + { + return ResourceManager.GetString("RepositoryNotSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use.. + /// + public static string ReservedIPNameNoLongerInUseButStillBeingReserved + { + get + { + return ResourceManager.GetString("ReservedIPNameNoLongerInUseButStillBeingReserved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource with ID : {0} does not exist.. + /// + public static string ResourceNotFound + { + get + { + return ResourceManager.GetString("ResourceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Restart. + /// + public static string Restart + { + get + { + return ResourceManager.GetString("Restart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resume. + /// + public static string Resume + { + get + { + return ResourceManager.GetString("Resume", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /role:{0};"{1}/{0}" . + /// + public static string RoleArgTemplate + { + get + { + return ResourceManager.GetString("RoleArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to bin. + /// + public static string RoleBinFolderName + { + get + { + return ResourceManager.GetString("RoleBinFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} is {1}. + /// + public static string RoleInstanceWaitMsg + { + get + { + return ResourceManager.GetString("RoleInstanceWaitMsg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 20. + /// + public static string RoleMaxInstances + { + get + { + return ResourceManager.GetString("RoleMaxInstances", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to role name. + /// + public static string RoleName + { + get + { + return ResourceManager.GetString("RoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name {0} doesn't exist. + /// + public static string RoleNotFoundMessage + { + get + { + return ResourceManager.GetString("RoleNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RoleSettings.xml. + /// + public static string RoleSettingsTemplateFileName + { + get + { + return ResourceManager.GetString("RoleSettingsTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role type {0} doesn't exist. + /// + public static string RoleTypeDoesNotExist + { + get + { + return ResourceManager.GetString("RoleTypeDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to public static Dictionary<string, Location> ReverseLocations { get; private set; }. + /// + public static string RuntimeDeploymentLocationError + { + get + { + return ResourceManager.GetString("RuntimeDeploymentLocationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing runtime deployment for service '{0}'. + /// + public static string RuntimeDeploymentStart + { + get + { + return ResourceManager.GetString("RuntimeDeploymentStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version?. + /// + public static string RuntimeMismatchWarning + { + get + { + return ResourceManager.GetString("RuntimeMismatchWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEOVERRIDEURL. + /// + public static string RuntimeOverrideKey + { + get + { + return ResourceManager.GetString("RuntimeOverrideKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /runtimemanifest/runtimes/runtime. + /// + public static string RuntimeQuery + { + get + { + return ResourceManager.GetString("RuntimeQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEID. + /// + public static string RuntimeTypeKey + { + get + { + return ResourceManager.GetString("RuntimeTypeKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEURL. + /// + public static string RuntimeUrlKey + { + get + { + return ResourceManager.GetString("RuntimeUrlKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEVERSIONPRIMARYKEY. + /// + public static string RuntimeVersionPrimaryKey + { + get + { + return ResourceManager.GetString("RuntimeVersionPrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to scaffold.xml. + /// + public static string ScaffoldXml + { + get + { + return ResourceManager.GetString("ScaffoldXml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation. + /// + public static string SchedulerInvalidLocation + { + get + { + return ResourceManager.GetString("SchedulerInvalidLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Secondary Peer Subnet has to be provided.. + /// + public static string SecondaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("SecondaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} already exists on disk in location {1}. + /// + public static string ServiceAlreadyExistsOnDisk + { + get + { + return ResourceManager.GetString("ServiceAlreadyExistsOnDisk", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No ServiceBus authorization rule with the given characteristics was found. + /// + public static string ServiceBusAuthorizationRuleNotFound + { + get + { + return ResourceManager.GetString("ServiceBusAuthorizationRuleNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service bus entity '{0}' is not found.. + /// + public static string ServiceBusEntityTypeNotFound + { + get + { + return ResourceManager.GetString("ServiceBusEntityTypeNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen due to an incorrect/missing namespace. + /// + public static string ServiceBusNamespaceMissingMessage + { + get + { + return ResourceManager.GetString("ServiceBusNamespaceMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service configuration. + /// + public static string ServiceConfiguration + { + get + { + return ResourceManager.GetString("ServiceConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service definition. + /// + public static string ServiceDefinition + { + get + { + return ResourceManager.GetString("ServiceDefinition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceDefinition.csdef. + /// + public static string ServiceDefinitionFileName + { + get + { + return ResourceManager.GetString("ServiceDefinitionFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}Deploy. + /// + public static string ServiceDeploymentName + { + get + { + return ResourceManager.GetString("ServiceDeploymentName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified cloud service "{0}" does not exist.. + /// + public static string ServiceDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is in {2} state, please wait until it finish and update it's status. + /// + public static string ServiceIsInTransitionState + { + get + { + return ResourceManager.GetString("ServiceIsInTransitionState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}.". + /// + public static string ServiceManagementClientExceptionStringFormat + { + get + { + return ResourceManager.GetString("ServiceManagementClientExceptionStringFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service name. + /// + public static string ServiceName + { + get + { + return ResourceManager.GetString("ServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. + /// + public static string ServiceNameExists + { + get + { + return ResourceManager.GetString("ServiceNameExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide name for the hosted service. + /// + public static string ServiceNameMissingMessage + { + get + { + return ResourceManager.GetString("ServiceNameMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service parent directory. + /// + public static string ServiceParentDirectory + { + get + { + return ResourceManager.GetString("ServiceParentDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} removed successfully. + /// + public static string ServiceRemovedMessage + { + get + { + return ResourceManager.GetString("ServiceRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service directory. + /// + public static string ServiceRoot + { + get + { + return ResourceManager.GetString("ServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service settings. + /// + public static string ServiceSettings + { + get + { + return ResourceManager.GetString("ServiceSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.. + /// + public static string ServiceSettings_ValidateStorageAccountName_InvalidName + { + get + { + return ResourceManager.GetString("ServiceSettings_ValidateStorageAccountName_InvalidName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for cloud service {1} doesn't exist.. + /// + public static string ServiceSlotDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceSlotDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is {2}. + /// + public static string ServiceStatusChanged + { + get + { + return ResourceManager.GetString("ServiceStatusChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set Add-On Confirmation. + /// + public static string SetAddOnConformation + { + get + { + return ResourceManager.GetString("SetAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} does not contain endpoint {1}. Adding it.. + /// + public static string SetInexistentTrafficManagerEndpointMessage + { + get + { + return ResourceManager.GetString("SetInexistentTrafficManagerEndpointMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string SetMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at <url> and (c) agree to sharing my contact information with {2}.. + /// + public static string SetNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances are set to {1}. + /// + public static string SetRoleInstancesMessage + { + get + { + return ResourceManager.GetString("SetRoleInstancesMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"Slot":"","Location":"","Subscription":"","StorageAccountName":""}. + /// + public static string SettingsFileEmptyContent + { + get + { + return ResourceManager.GetString("SettingsFileEmptyContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to deploymentSettings.json. + /// + public static string SettingsFileName + { + get + { + return ResourceManager.GetString("SettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insufficient parameters passed to create a new endpoint.. + /// + public static string SetTrafficManagerEndpointNeedsParameters + { + get + { + return ResourceManager.GetString("SetTrafficManagerEndpointNeedsParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ambiguous operation: the profile name specified doesn't match the name of the profile object.. + /// + public static string SetTrafficManagerProfileAmbiguous + { + get + { + return ResourceManager.GetString("SetTrafficManagerProfileAmbiguous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts.. + /// + public static string ShouldContinueFail + { + get + { + return ResourceManager.GetString("ShouldContinueFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm. + /// + public static string ShouldProcessCaption + { + get + { + return ResourceManager.GetString("ShouldProcessCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailConfirm + { + get + { + return ResourceManager.GetString("ShouldProcessFailConfirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again.. + /// + public static string ShouldProcessFailImpact + { + get + { + return ResourceManager.GetString("ShouldProcessFailImpact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailWhatIf + { + get + { + return ResourceManager.GetString("ShouldProcessFailWhatIf", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shutdown. + /// + public static string Shutdown + { + get + { + return ResourceManager.GetString("Shutdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /sites:{0};{1};"{2}/{0}" . + /// + public static string SitesArgTemplate + { + get + { + return ResourceManager.GetString("SitesArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string StandardRetryDelayInMs + { + get + { + return ResourceManager.GetString("StandardRetryDelayInMs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start. + /// + public static string Start + { + get + { + return ResourceManager.GetString("Start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Started. + /// + public static string StartedEmulator + { + get + { + return ResourceManager.GetString("StartedEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting Emulator.... + /// + public static string StartingEmulator + { + get + { + return ResourceManager.GetString("StartingEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to start. + /// + public static string StartStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StartStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop. + /// + public static string Stop + { + get + { + return ResourceManager.GetString("Stop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopping emulator.... + /// + public static string StopEmulatorMessage + { + get + { + return ResourceManager.GetString("StopEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopped. + /// + public static string StoppedEmulatorMessage + { + get + { + return ResourceManager.GetString("StoppedEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to stop. + /// + public static string StopStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StopStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Name:. + /// + public static string StorageAccountName + { + get + { + return ResourceManager.GetString("StorageAccountName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find storage account '{0}' please type the name of an existing storage account.. + /// + public static string StorageAccountNotFound + { + get + { + return ResourceManager.GetString("StorageAccountNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureStorageEmulator.exe. + /// + public static string StorageEmulatorExe + { + get + { + return ResourceManager.GetString("StorageEmulatorExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to InstallPath. + /// + public static string StorageEmulatorInstallPathRegistryKeyValue + { + get + { + return ResourceManager.GetString("StorageEmulatorInstallPathRegistryKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SOFTWARE\Microsoft\Windows Azure Storage Emulator. + /// + public static string StorageEmulatorRegistryKey + { + get + { + return ResourceManager.GetString("StorageEmulatorRegistryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary Key:. + /// + public static string StoragePrimaryKey + { + get + { + return ResourceManager.GetString("StoragePrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Secondary Key:. + /// + public static string StorageSecondaryKey + { + get + { + return ResourceManager.GetString("StorageSecondaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} already exists.. + /// + public static string SubscriptionAlreadyExists + { + get + { + return ResourceManager.GetString("SubscriptionAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information.. + /// + public static string SubscriptionDataFileDeprecated + { + get + { + return ResourceManager.GetString("SubscriptionDataFileDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DefaultSubscriptionData.xml. + /// + public static string SubscriptionDataFileName + { + get + { + return ResourceManager.GetString("SubscriptionDataFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription data file {0} does not exist.. + /// + public static string SubscriptionDataFileNotFound + { + get + { + return ResourceManager.GetString("SubscriptionDataFileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription id {0} doesn't exist.. + /// + public static string SubscriptionIdNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription must not be null. + /// + public static string SubscriptionMustNotBeNull + { + get + { + return ResourceManager.GetString("SubscriptionMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription name needs to be specified.. + /// + public static string SubscriptionNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription name {0} doesn't exist.. + /// + public static string SubscriptionNameNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription needs to be specified.. + /// + public static string SubscriptionNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Suspend. + /// + public static string Suspend + { + get + { + return ResourceManager.GetString("Suspend", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Swapping website production slot .... + /// + public static string SwappingWebsite + { + get + { + return ResourceManager.GetString("SwappingWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to swap the website '{0}' production slot with slot '{1}'?. + /// + public static string SwapWebsiteSlotWarning + { + get + { + return ResourceManager.GetString("SwapWebsiteSlotWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.. + /// + public static string SwitchAzureModeDeprecated + { + get + { + return ResourceManager.GetString("SwitchAzureModeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}'. + /// + public static string TraceBeginLROJob + { + get + { + return ResourceManager.GetString("TraceBeginLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}'. + /// + public static string TraceBlockLROThread + { + get + { + return ResourceManager.GetString("TraceBlockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Completing cmdlet execution in RunJob. + /// + public static string TraceEndLROJob + { + get + { + return ResourceManager.GetString("TraceEndLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}'. + /// + public static string TraceHandleLROStateChange + { + get + { + return ResourceManager.GetString("TraceHandleLROStateChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job due to stoppage or failure. + /// + public static string TraceHandlerCancelJob + { + get + { + return ResourceManager.GetString("TraceHandlerCancelJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job that was previously blocked.. + /// + public static string TraceHandlerUnblockJob + { + get + { + return ResourceManager.GetString("TraceHandlerUnblockJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Error in cmdlet execution. + /// + public static string TraceLROJobException + { + get + { + return ResourceManager.GetString("TraceLROJobException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Removing state changed event handler, exception '{0}'. + /// + public static string TraceRemoveLROEventHandler + { + get + { + return ResourceManager.GetString("TraceRemoveLROEventHandler", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: ShouldMethod '{0}' unblocked.. + /// + public static string TraceUnblockLROThread + { + get + { + return ResourceManager.GetString("TraceUnblockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}.. + /// + public static string UnableToDecodeBase64String + { + get + { + return ResourceManager.GetString("UnableToDecodeBase64String", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. + /// + public static string UnableToPatchJson + { + get + { + return ResourceManager.GetString("UnableToPatchJson", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provider {0} is unknown.. + /// + public static string UnknownProviderMessage + { + get + { + return ResourceManager.GetString("UnknownProviderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string Update + { + get + { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updated settings for subscription '{0}'. Current subscription is '{1}'.. + /// + public static string UpdatedSettings + { + get + { + return ResourceManager.GetString("UpdatedSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name is not valid.. + /// + public static string UserNameIsNotValid + { + get + { + return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name needs to be specified.. + /// + public static string UserNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the VLan Id has to be provided.. + /// + public static string VlanIdRequired + { + get + { + return ResourceManager.GetString("VlanIdRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please wait.... + /// + public static string WaitMessage + { + get + { + return ResourceManager.GetString("WaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The azure storage emulator is not installed, skip launching.... + /// + public static string WarningWhenStorageEmulatorIsMissing + { + get + { + return ResourceManager.GetString("WarningWhenStorageEmulatorIsMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Web.cloud.config. + /// + public static string WebCloudConfig + { + get + { + return ResourceManager.GetString("WebCloudConfig", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to web.config. + /// + public static string WebConfigTemplateFileName + { + get + { + return ResourceManager.GetString("WebConfigTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MSDeploy. + /// + public static string WebDeployKeywordInWebSitePublishProfile + { + get + { + return ResourceManager.GetString("WebDeployKeywordInWebSitePublishProfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot build the project successfully. Please see logs in {0}.. + /// + public static string WebProjectBuildFailTemplate + { + get + { + return ResourceManager.GetString("WebProjectBuildFailTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole. + /// + public static string WebRole + { + get + { + return ResourceManager.GetString("WebRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_web.cmd > log.txt. + /// + public static string WebRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WebRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole.xml. + /// + public static string WebRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WebRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Webspace.. + /// + public static string WebsiteAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Location.. + /// + public static string WebsiteAlreadyExistsReplacement + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExistsReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Site {0} already has repository created for it.. + /// + public static string WebsiteRepositoryAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteRepositoryAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workspaces/WebsiteExtension/Website/{0}/dashboard/. + /// + public static string WebsiteSufixUrl + { + get + { + return ResourceManager.GetString("WebsiteSufixUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}/msdeploy.axd?site={1}. + /// + public static string WebSiteWebDeployUriTemplate + { + get + { + return ResourceManager.GetString("WebSiteWebDeployUriTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole. + /// + public static string WorkerRole + { + get + { + return ResourceManager.GetString("WorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_worker.cmd > log.txt. + /// + public static string WorkerRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WorkerRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole.xml. + /// + public static string WorkerRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WorkerRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (x86). + /// + public static string x86InProgramFiles + { + get + { + return ResourceManager.GetString("x86InProgramFiles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + public static string Yes + { + get + { + return ResourceManager.GetString("Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes, I agree. + /// + public static string YesHint + { + get + { + return ResourceManager.GetString("YesHint", resourceCulture); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Properties/Resources.resx b/swaggerci/containerservice.DefaultTag/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..a08a2e50172b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Properties/Resources.resx @@ -0,0 +1,1747 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The remote server returned an error: (401) Unauthorized. + + + Account "{0}" has been added. + + + To switch to a different subscription, please use Select-AzureSubscription. + + + Subscription "{0}" is selected as the default subscription. + + + To view all the subscriptions, please use Get-AzureSubscription. + + + Add-On {0} is created successfully. + + + Add-on name {0} is already used. + + + Add-On {0} not found. + + + Add-on {0} is removed successfully. + + + Add-On {0} is updated successfully. + + + Role has been created at {0}\{1}. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure". + + + Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator + + + A role name '{0}' already exists + + + Windows Azure Powershell\ + + + https://manage.windowsazure.com + + + AZURE_PORTAL_URL + + + Azure SDK\{0}\ + + + Base Uri was empty. + WAPackIaaS + + + {0} begin processing without ParameterSet. + + + {0} begin processing with ParameterSet '{1}'. + + + Blob with the name {0} already exists in the account. + + + https://{0}.blob.core.windows.net/ + + + AZURE_BLOBSTORAGE_TEMPLATE + + + CACHERUNTIMEURL + + + cache + + + CacheRuntimeVersion + + + Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}) + + + Cannot find {0} with name {1}. + + + Deployment for service {0} with {1} slot doesn't exist + + + Can't find valid Microsoft Azure role in current directory {0} + + + service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist + + + Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders. + + + The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated. + + + ManagementCertificate + + + certificate.pfx + + + Certificate imported into CurrentUser\My\{0} + + + Your account does not have access to the private key for certificate {0} + + + {0} {1} deployment for {2} service + + + Cloud service {0} is in {1} state. + + + Changing/Removing public environment '{0}' is not allowed. + + + Service {0} is set to value {1} + + + Choose which publish settings file to use: + + + Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel + + + 1 + + + cloud_package.cspkg + + + ServiceConfiguration.Cloud.cscfg + + + Add-ons for {0} + + + Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive. + + + Complete + + + config.json + + + VirtualMachine creation failed. + WAPackIaaS + + + Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead. + + + Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core + + + //blobcontainer[@datacenter='{0}'] + + + Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription + + + none + + + There are no hostnames which could be used for validation. + + + 8080 + + + 1000 + + + Auto + + + 80 + + + Delete + WAPackIaaS + + + The {0} slot for service {1} is already in {2} state + + + The deployment in {0} slot for service {1} is removed + + + Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel + + + 1 + + + The key to add already exists in the dictionary. + + + The array index cannot be less than zero. + + + The supplied array does not have enough room to contain the copied elements. + + + The provided dns {0} doesn't exist + + + Microsoft Azure Certificate + + + Endpoint can't be retrieved for storage account + + + {0} end processing. + + + To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet. + + + The environment '{0}' already exists. + + + environments.xml + + + Error creating VirtualMachine + WAPackIaaS + + + Unable to download available runtimes for location '{0}' + + + Error updating VirtualMachine + WAPackIaaS + + + Job Id {0} failed. Error: {1}, ExceptionDetails: {2} + WAPackIaaS + + + The HTTP request was forbidden with client authentication scheme 'Anonymous'. + + + This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell. + + + Operation Status: + + + Resources\Scaffolding\General + + + Getting all available Microsoft Azure Add-Ons, this may take few minutes... + + + Name{0}Primary Key{0}Seconday Key + + + Git not found. Please install git and place it in your command line path. + + + Could not find publish settings. Please run Import-AzurePublishSettingsFile. + + + iisnode.dll + + + iisnode + + + iisnode-dev\\release\\x64 + + + iisnode + + + Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}) + + + Internal Server Error + + + Cannot enable memcach protocol on a cache worker role {0}. + + + Invalid certificate format. + + + The provided configuration path is invalid or doesn't exist + + + The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2. + + + Deployment with {0} does not exist + + + The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production". + + + Invalid service endpoint. + + + File {0} has invalid characters + + + You must create your git publishing credentials using the Microsoft Azure portal. +Please follow these steps in the portal: +1. On the left side open "Web Sites" +2. Click on any website +3. Choose "Setup Git Publishing" or "Reset deployment credentials" +4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username} + + + The value {0} provided is not a valid GUID. Please provide a valid GUID. + + + The specified hostname does not exist. Please specify a valid hostname for the site. + + + Role {0} instances must be greater than or equal 0 and less than or equal 20 + + + There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file. + + + Could not download a valid runtime manifest, Please check your internet connection and try again. + + + The account {0} was not found. Please specify a valid account name. + + + The provided name "{0}" does not match the service bus namespace naming rules. + + + Value cannot be null. Parameter name: '{0}' + + + The provided package path is invalid or doesn't exist + + + '{0}' is an invalid parameter set name. + + + {0} doesn't exist in {1} or you've not passed valid value for it + + + Path {0} has invalid characters + + + The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile + + + The provided role name "{0}" has invalid characters + + + A valid name for the service root folder is required + + + {0} is not a recognized runtime type + + + A valid language is required + + + No subscription is currently selected. Use Select-Subscription to activate a subscription. + + + The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations. + + + Please provide a service name or run this command from inside a service project directory. + + + You must provide valid value for {0} + + + settings.json is invalid or doesn't exist + + + The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data. + + + The provided subscription id {0} is not valid + + + A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet + + + The provided subscriptions file {0} has invalid content. + + + Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge. + + + The web job file must have *.zip extension + + + Singleton option works for continuous jobs only. + + + The website {0} was not found. Please specify a valid website name. + + + No job for id: {0} was found. + WAPackIaaS + + + engines + + + Scaffolding for this language is not yet supported + + + Link already established + + + local_package.csx + + + ServiceConfiguration.Local.cscfg + + + Looking for {0} deployment for {1} cloud service... + + + Looking for cloud service {0}... + + + managementCertificate.pem + + + ?whr={0} + + + //baseuri + + + uri + + + http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml + + + Multiple Add-Ons found holding name {0} + + + Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername. + + + The first publish settings file "{0}" is used. If you want to use another file specify the file name. + + + Microsoft.WindowsAzure.Plugins.Caching.NamedCaches + + + {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]} + + + A publishing username is required. Please specify one using the argument PublishingUsername. + + + New Add-On Confirmation + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names. + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at {0} and (c) agree to sharing my contact information with {2}. + + + Service has been created at {0} + + + No + + + There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription. + + + The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole. + + + No clouds available + WAPackIaaS + + + nodejs + + + node + + + node.exe + + + There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name> + + + Microsoft SDKs\Azure\Nodejs\Nov2011 + + + nodejs + + + node + + + Resources\Scaffolding\Node + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node + + + Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}) + + + No, I do not agree + + + No publish settings files with extension *.publishsettings are found in the directory "{0}". + + + '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration. + + + Certificate can't be null. + + + {0} could not be null or empty + + + Unable to add a null RoleSettings to {0} + + + Unable to add new role to null service definition + + + The request offer '{0}' is not found. + + + Operation "{0}" failed on VM with ID: {1} + WAPackIaaS + + + The REST operation failed with message '{0}' and error code '{1}' + + + Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state. + WAPackIaaS + + + package + + + Package is created at service root path {0}. + + + {{ + "author": "", + + "name": "{0}", + "version": "0.0.0", + "dependencies":{{}}, + "devDependencies":{{}}, + "optionalDependencies": {{}}, + "engines": {{ + "node": "*", + "iisnode": "*" + }} + +}} + + + + package.json + + + A value for the Peer Asn has to be provided. + + + 5.4.0 + + + php + + + Resources\Scaffolding\PHP + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP + + + Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}) + + + You must create your first web site using the Microsoft Azure portal. +Please follow these steps in the portal: +1. At the bottom of the page, click on New > Web Site > Quick Create +2. Type {0} in the URL field +3. Click on "Create Web Site" +4. Once the site has been created, click on the site name +5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create. + + + 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git" + + + A value for the Primary Peer Subnet has to be provided. + + + Promotion code can be used only when updating to a new plan. + + + Service not published at user request. + + + Complete. + + + Connecting... + + + Created Deployment ID: {0}. + + + Created hosted service '{0}'. + + + Created Website URL: {0}. + + + Creating... + + + Initializing... + + + busy + + + creating the virtual machine + + + Instance {0} of role {1} is {2}. + + + ready + + + Preparing deployment for {0} with Subscription ID: {1}... + + + Publishing {0} to Microsoft Azure. This may take several minutes... + + + publish settings + + + Azure + + + .PublishSettings + + + publishSettings.xml + + + Publish settings imported + + + AZURE_PUBLISHINGPROFILE_URL + + + Starting... + + + Upgrading... + + + Uploading Package to storage service {0}... + + + Verifying storage account '{0}'... + + + Replace current deployment with '{0}' Id ? + + + Are you sure you want to regenerate key? + + + Generate new key. + + + Are you sure you want to remove account '{0}'? + + + Removing account + + + Remove Add-On Confirmation + + + If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm. + + + Remove-AzureBGPPeering Operation failed. + + + Removing Bgp Peering + + + Successfully removed Azure Bgp Peering with Service Key {0}. + + + Are you sure you want to remove the Bgp Peering with service key '{0}'? + + + Are you sure you want to remove the Dedicated Circuit with service key '{0}'? + + + Remove-AzureDedicatedCircuit Operation failed. + + + Remove-AzureDedicatedCircuitLink Operation failed. + + + Removing Dedicated Circui Link + + + Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1} + + + Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'? + + + Removing Dedicated Circuit + + + Successfully removed Azure Dedicated Circuit with Service Key {0}. + + + Removing cloud service {0}... + + + Removing {0} deployment for {1} service + + + Removing job collection + + + Are you sure you want to remove the job collection "{0}" + + + Removing job + + + Are you sure you want to remove the job "{0}" + + + Are you sure you want to remove the account? + + + Account removed. + + + Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription. + + + Removing old package {0}... + + + Are you sure you want to delete the namespace '{0}'? + + + Are you sure you want to remove cloud service? + + + Remove cloud service and all it's deployments + + + Are you sure you want to remove subscription '{0}'? + + + Removing subscription + + + Are you sure you want to delete the VM '{0}'? + + + Deleting VM. + + + Removing WebJob... + + + Are you sure you want to remove job '{0}'? + + + Removing website + + + Are you sure you want to remove the website "{0}" + + + Deleting namespace + + + Repository is not setup. You need to pass a valid site name. + + + Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use. + + + Resource with ID : {0} does not exist. + WAPackIaaS + + + Restart + WAPackIaaS + + + Resume + WAPackIaaS + + + /role:{0};"{1}/{0}" + + + bin + + + Role {0} is {1} + + + 20 + + + role name + + + The provided role name {0} doesn't exist + + + RoleSettings.xml + + + Role type {0} doesn't exist + + + public static Dictionary<string, Location> ReverseLocations { get; private set; } + + + Preparing runtime deployment for service '{0}' + + + WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version? + + + RUNTIMEOVERRIDEURL + + + /runtimemanifest/runtimes/runtime + + + RUNTIMEID + + + RUNTIMEURL + + + RUNTIMEVERSIONPRIMARYKEY + + + scaffold.xml + + + Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation + + + A value for the Secondary Peer Subnet has to be provided. + + + Service {0} already exists on disk in location {1} + + + No ServiceBus authorization rule with the given characteristics was found + + + The service bus entity '{0}' is not found. + + + Internal Server Error. This could happen due to an incorrect/missing namespace + + + service configuration + + + service definition + + + ServiceDefinition.csdef + + + {0}Deploy + + + The specified cloud service "{0}" does not exist. + + + {0} slot for service {1} is in {2} state, please wait until it finish and update it's status + + + Begin Operation: {0} + + + Completed Operation: {0} + + + Begin Operation: {0} + + + Completed Operation: {0} + + + service name + + + Please provide name for the hosted service + + + service parent directory + + + Service {0} removed successfully + + + service directory + + + service settings + + + The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + + + The {0} slot for cloud service {1} doesn't exist. + + + {0} slot for service {1} is {2} + + + Set Add-On Confirmation + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at <url> and (c) agree to sharing my contact information with {2}. + + + Role {0} instances are set to {1} + + + {"Slot":"","Location":"","Subscription":"","StorageAccountName":""} + + + deploymentSettings.json + + + Confirm + + + Shutdown + WAPackIaaS + + + /sites:{0};{1};"{2}/{0}" + + + 1000 + + + Start + WAPackIaaS + + + Started + + + Starting Emulator... + + + start + + + Stop + WAPackIaaS + + + Stopping emulator... + + + Stopped + + + stop + + + Account Name: + + + Cannot find storage account '{0}' please type the name of an existing storage account. + + + AzureStorageEmulator.exe + + + InstallPath + + + SOFTWARE\Microsoft\Windows Azure Storage Emulator + + + Primary Key: + + + Secondary Key: + + + The subscription named {0} already exists. + + + DefaultSubscriptionData.xml + + + The subscription data file {0} does not exist. + + + Subscription must not be null + WAPackIaaS + + + Suspend + WAPackIaaS + + + Swapping website production slot ... + + + Are you sure you want to swap the website '{0}' production slot with slot '{1}'? + + + The provider {0} is unknown. + + + Update + WAPackIaaS + + + Updated settings for subscription '{0}'. Current subscription is '{1}'. + + + A value for the VLan Id has to be provided. + + + Please wait... + + + The azure storage emulator is not installed, skip launching... + + + Web.cloud.config + + + web.config + + + MSDeploy + + + Cannot build the project successfully. Please see logs in {0}. + + + WebRole + + + setup_web.cmd > log.txt + + + WebRole.xml + + + WebSite with given name {0} already exists in the specified Subscription and Webspace. + + + WebSite with given name {0} already exists in the specified Subscription and Location. + + + Site {0} already has repository created for it. + + + Workspaces/WebsiteExtension/Website/{0}/dashboard/ + + + https://{0}/msdeploy.axd?site={1} + + + WorkerRole + + + setup_worker.cmd > log.txt + + + WorkerRole.xml + + + Yes + + + Yes, I agree + + + Remove-AzureTrafficManagerProfile Operation failed. + + + Successfully removed Traffic Manager profile with name {0}. + + + Are you sure you want to remove the Traffic Manager profile "{0}"? + + + Profile {0} already has an endpoint with name {1} + + + Profile {0} does not contain endpoint {1}. Adding it. + + + The endpoint {0} cannot be removed from profile {1} because it's not in the profile. + + + Insufficient parameters passed to create a new endpoint. + + + Ambiguous operation: the profile name specified doesn't match the name of the profile object. + + + <NONE> + + + "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}." + {0} is the HTTP status code. {1} is the Service Management Error Code. {2} is the Service Management Error message. {3} is the operation tracking ID. + + + Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}. + {0} is the string that is not in a valid base 64 format. + + + Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential". + + + Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'? + + + Removing environment + + + There is no subscription associated with account {0}. + + + Account id doesn't match one in subscription. + + + Environment name doesn't match one in subscription. + + + Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile? + + + Removing the Azure profile + + + The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. + + + Account needs to be specified + + + No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription. + + + Path must specify a valid path to an Azure profile. + + + Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token} + + + Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'. + + + Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'. + + + Property bag Hashtable must contain a 'SubscriptionId'. + + + Selected profile must not be null. + + + The Switch-AzureMode cmdlet is deprecated and will be removed in a future release. + + + OperationID : '{0}' + + + Cannot get module for DscResource '{0}'. Possible solutions: +1) Specify -ModuleName for Import-DscResource in your configuration. +2) Unblock module that contains resource. +3) Move Import-DscResource inside Node block. + + 0 = name of DscResource + + + Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version. + {0} = minimal required PS version, {1} = current PS version + + + Parsing configuration script: {0} + {0} is the path to a script file + + + Configuration script '{0}' contained parse errors: +{1} + 0 = path to the configuration script, 1 = parser errors + + + List of required modules: [{0}]. + {0} = list of modules + + + Temp folder '{0}' created. + {0} = temp folder path + + + Copy '{0}' to '{1}'. + {0} = source, {1} = destination + + + Copy the module '{0}' to '{1}'. + {0} = source, {1} = destination + + + File '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the path to a file + + + Configuration file '{0}' not found. + 0 = path to the configuration file + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip). + 0 = path to the configuration file + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1). + 0 = path to the configuration file + + + Create Archive + + + Upload '{0}' + {0} is the name of an storage blob + + + Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the name of an storage blob + + + Configuration published to {0} + {0} is an URI + + + Deleted '{0}' + {0} is the path of a file + + + Cannot delete '{0}': {1} + {0} is the path of a file, {1} is an error message + + + Cannot find the WadCfg end element in the config. + + + WadCfg start element in the config is not matching the end element. + + + Cannot find the WadCfg element in the config. + + + Cannot find configuration data file: {0} + + + The configuration data must be a .psd1 file + + + Cannot change built-in environment {0}. + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. +Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable data collection: PS > Enable-AzDataCollection. + + + Microsoft Azure PowerShell Data Collection Confirmation + + + You choose not to participate in Microsoft Azure PowerShell data collection. + + + This confirmation message will be dismissed in '{0}' second(s)... + + + You choose to participate in Microsoft Azure PowerShell data collection. + + + The setting profile has been saved to the following path '{0}'. + + + [Common.Authentication]: Authenticating for account {0} with single tenant {1}. + + + Changing public environment is not supported. + + + Environment name needs to be specified. + + + Environment needs to be specified. + + + The environment name '{0}' is not found. + + + File path is not valid. + + + Must specify a non-null subscription name. + + + The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription. + + + Removing public environment is not supported. + + + The subscription id {0} doesn't exist. + + + Subscription name needs to be specified. + + + The subscription name {0} doesn't exist. + + + Subscription needs to be specified. + + + User name is not valid. + + + User name needs to be specified. + + + "There is no current context, please log in using Connect-AzAccount." + + + No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount? + + + No certificate was found in the certificate store with thumbprint {0} + + + Illegal characters in path. + + + Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings + + + "{0}" is an invalid DNS name for {1} + + + The provided file in {0} must be have {1} extension + + + {0} is invalid or empty + + + Please connect to internet before executing this cmdlet + + + Path {0} doesn't exist. + + + Path for {0} doesn't exist in {1}. + + + &whr={0} + + + The provided service name {0} already exists, please pick another name + + + Unable to update mismatching Json structured: {0} {1}. + + + (x86) + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. +Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enable-AzureDataCollection. + + + Execution failed because a background thread could not prompt the user. + + + Azure Long-Running Job + + + The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter. + 0(string): exception message in background task + + + Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts. + + + Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter. + + + Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again. + + + Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter. + + + [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}' + 0(bool): whether cmdlet confirmation is required + + + [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}' + 0(string): method type + + + [AzureLongRunningJob]: Completing cmdlet execution in RunJob + + + [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}' + 0(string): last state, 1(string): new state, 2(string): state change reason + + + [AzureLongRunningJob]: Unblocking job due to stoppage or failure + + + [AzureLongRunningJob]: Unblocking job that was previously blocked. + + + [AzureLongRunningJob]: Error in cmdlet execution + + + [AzureLongRunningJob]: Removing state changed event handler, exception '{0}' + 0(string): exception message + + + [AzureLongRunningJob]: ShouldMethod '{0}' unblocked. + 0(string): methodType + + + +- The parameter : '{0}' is changing. + + + +- The parameter : '{0}' is becoming mandatory. + + + +- The parameter : '{0}' is being replaced by parameter : '{1}'. + + + +- The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + + + +- Change description : {0} + + + The cmdlet is being deprecated. There will be no replacement for it. + + + The cmdlet parameter set is being deprecated. There will be no replacement for it. + + + The cmdlet '{0}' is replacing this cmdlet. + + + +- The output type is changing from the existing type :'{0}' to the new type :'{1}' + + + +- The output type '{0}' is changing + + + +- The following properties are being added to the output type : + + + +- The following properties in the output type are being deprecated : + + + {0} + + + +- Cmdlet : '{0}' + - {1} + + + Upcoming breaking changes in the cmdlet '{0}' : + + + +- This change will take effect on '{0}' + + + +- The change is expected to take effect from version : '{0}' + + + ```powershell +# Old +{0} + +# New +{1} +``` + + + + +Cmdlet invocation changes : + Old Way : {0} + New Way : {1} + + + +The output type '{0}' is being deprecated without a replacement. + + + +The type of the parameter is changing from '{0}' to '{1}'. + + + +Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + + + This cmdlet is in preview. Its behavior is subject to change based on customer feedback. + + + The estimated generally available date is '{0}'. + + + - The change is expected to take effect from Az version : '{0}' + + \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Response.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Response.cs new file mode 100644 index 000000000000..462b4218f2d0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Response.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using System; + using System.Threading.Tasks; + public class Response : EventData + { + public Response() : base() + { + } + } + + public class Response : Response + { + private Func> _resultDelegate; + private Task _resultValue; + + public Response(T value) : base() => _resultValue = Task.FromResult(value); + public Response(Func value) : base() => _resultDelegate = () => Task.FromResult(value()); + public Response(Func> value) : base() => _resultDelegate = value; + public Task Result => _resultValue ?? (_resultValue = this._resultDelegate()); + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..98bed6292437 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Serialization/JsonSerializer.cs @@ -0,0 +1,350 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal class JsonSerializer + { + private int depth = 0; + + private SerializationOptions options = new SerializationOptions(); + + #region Deserialization + + internal T Deseralize(JsonObject json) + where T : new() + { + var contract = JsonModelCache.Get(typeof(T)); + + return (T)DeserializeObject(contract, json); + } + + internal object DeserializeObject(JsonModel contract, JsonObject json) + { + var instance = Activator.CreateInstance(contract.Type); + + depth++; + + // Ensure we don't recurse forever + if (depth > 5) throw new Exception("Depth greater than 5"); + + foreach (var field in json) + { + var member = contract[field.Key]; + + if (member != null) + { + var value = DeserializeValue(member, field.Value); + + member.SetValue(instance, value); + } + } + + depth--; + + return instance; + } + + private object DeserializeValue(JsonMember member, JsonNode value) + { + if (value.Type == JsonType.Null) return null; + + var type = member.Type; + + if (member.IsStringLike && value.Type != JsonType.String) + { + // Take the long path... + return DeserializeObject(JsonModelCache.Get(type), (JsonObject)value); + } + else if (member.Converter != null) + { + return member.Converter.FromJson(value); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (member.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + private object DeserializeValue(Type type, JsonNode value) + { + if (type == null) throw new ArgumentNullException(nameof(type)); + + if (value.Type == JsonType.Null) return null; + + var typeDetails = TypeDetails.Get(type); + + if (typeDetails.JsonConverter != null) + { + return typeDetails.JsonConverter.FromJson(value); + } + else if (typeDetails.IsEnum) + { + return Enum.Parse(type, value.ToString(), ignoreCase: true); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (typeDetails.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + internal Array DeserializeArray(Type type, JsonArray elements) + { + var elementType = type.GetElementType(); + + var elementTypeDetails = TypeDetails.Get(elementType); + + var array = Array.CreateInstance(elementType, elements.Count); + + int i = 0; + + if (elementTypeDetails.JsonConverter != null) + { + foreach (var value in elements) + { + array.SetValue(elementTypeDetails.JsonConverter.FromJson(value), i); + + i++; + } + } + else + { + foreach (var value in elements) + { + array.SetValue(DeserializeValue(elementType, value), i); + + i++; + } + } + + return array; + } + + internal IList DeserializeList(Type type, JsonArray jsonArray) + { + // TODO: Handle non-generic types + if (!type.IsGenericType) + throw new ArgumentException("Must be a generic type", nameof(type)); + + var elementType = type.GetGenericArguments()[0]; + + IList list; + + if (type.IsInterface) + { + // Create a concrete generic list + list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType)); + } + else + { + list = (IList)Activator.CreateInstance(type); + } + + foreach (var value in jsonArray) + { + list.Add(DeserializeValue(elementType, value)); + } + + return list; + } + + #endregion + + #region Serialization + + internal JsonNode Serialize(object instance) => + Serialize(instance, SerializationOptions.Default); + + internal JsonNode Serialize(object instance, string[] include) => + Serialize(instance, new SerializationOptions { Include = include }); + + internal JsonNode Serialize(object instance, SerializationOptions options) + { + this.options = options; + + if (instance == null) + { + return XNull.Instance; + } + + return ReadValue(instance.GetType(), instance); + } + + #region Readers + + internal JsonArray ReadArray(IEnumerable collection) + { + var array = new XNodeArray(); + + foreach (var item in collection) + { + array.Add(ReadValue(item.GetType(), item)); + } + + return array; + } + + internal IEnumerable> ReadProperties(object instance) + { + var contract = JsonModelCache.Get(instance.GetType()); + + foreach (var member in contract.Members) + { + string name = member.Name; + + if (options.PropertyNameTransformer != null) + { + name = options.PropertyNameTransformer.Invoke(name); + } + + // Skip the field if it's not included + if ((depth == 1 && !options.IsIncluded(name))) + { + continue; + } + + var value = member.GetValue(instance); + + if (!member.EmitDefaultValue && (value == null || (member.IsList && ((IList)value).Count == 0) || value.Equals(member.DefaultValue))) + { + continue; + } + else if (options.IgnoreNullValues && value == null) // Ignore null values + { + continue; + } + + // Transform the value if there is one + if (options.Transformations != null) + { + var transform = options.GetTransformation(name); + + if (transform != null) + { + value = transform.Transformer(value); + } + } + + yield return new KeyValuePair(name, ReadValue(member.TypeDetails, value)); + } + } + + private JsonObject ReadObject(object instance) + { + depth++; + + // TODO: Guard against a self referencing graph + if (depth > options.MaxDepth) + { + depth--; + + return new JsonObject(); + } + + var node = new JsonObject(ReadProperties(instance)); + + depth--; + + return node; + } + + private JsonNode ReadValue(Type type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + var member = TypeDetails.Get(type); + + return ReadValue(member, value); + } + + private JsonNode ReadValue(TypeDetails type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + if (type.JsonConverter != null) + { + return type.JsonConverter.ToJson(value); + } + else if (type.IsArray) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateArray((string[])value); + case TypeCode.UInt16: return CreateArray((ushort[])value); + case TypeCode.UInt32: return CreateArray((uint[])value); + case TypeCode.UInt64: return CreateArray((ulong[])value); + case TypeCode.Int16: return CreateArray((short[])value); + case TypeCode.Int32: return CreateArray((int[])value); + case TypeCode.Int64: return CreateArray((long[])value); + case TypeCode.Single: return CreateArray((float[])value); + case TypeCode.Double: return CreateArray((double[])value); + default: return ReadArray((IEnumerable)value); + } + } + else if (value is IEnumerable) + { + if (type.IsList && type.ElementType != null) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateList(value); + case TypeCode.UInt16: return CreateList(value); + case TypeCode.UInt32: return CreateList(value); + case TypeCode.UInt64: return CreateList(value); + case TypeCode.Int16: return CreateList(value); + case TypeCode.Int32: return CreateList(value); + case TypeCode.Int64: return CreateList(value); + case TypeCode.Single: return CreateList(value); + case TypeCode.Double: return CreateList(value); + } + } + + return ReadArray((IEnumerable)value); + } + else + { + // Complex object + return ReadObject(value); + } + } + + private XList CreateList(object value) => new XList((IList)value); + + private XImmutableArray CreateArray(T[] array) => new XImmutableArray(array); + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..878bf8689aba --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Serialization/PropertyTransformation.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal class PropertyTransformation + { + internal PropertyTransformation(string name, Func transformer) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Transformer = transformer ?? throw new ArgumentNullException(nameof(transformer)); + } + + internal string Name { get; } + + internal Func Transformer { get; } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..1d7b623a05cf --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Serialization/SerializationOptions.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal class SerializationOptions + { + internal static readonly SerializationOptions Default = new SerializationOptions(); + + internal SerializationOptions() { } + + internal SerializationOptions( + string[] include = null, + bool ingoreNullValues = false) + { + Include = include; + IgnoreNullValues = ingoreNullValues; + } + + internal string[] Include { get; set; } + + internal string[] Exclude { get; set; } + + internal bool IgnoreNullValues { get; set; } + + internal PropertyTransformation[] Transformations { get; set; } + + internal Func PropertyNameTransformer { get; set; } + + internal int MaxDepth { get; set; } = 5; + + internal bool IsIncluded(string name) + { + if (Exclude != null) + { + return !Exclude.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + else if (Include != null) + { + return Include.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + + return true; + } + + internal PropertyTransformation GetTransformation(string propertyName) + { + if (Transformations == null) return null; + + foreach (var t in Transformations) + { + if (t.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + { + return t; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/SerializationMode.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..e819ff1d76e0 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/SerializationMode.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + [System.Flags] + public enum SerializationMode + { + None = 0, + IncludeHeaders = 1 << 0, + IncludeReadOnly = 1 << 1, + + IncludeAll = IncludeHeaders | IncludeReadOnly + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/TypeConverterExtensions.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..6ec83db973f3 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/TypeConverterExtensions.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. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Linq; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.PowerShell +{ + internal static class TypeConverterExtensions + { + internal static T[] SelectToArray(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) }; + } +#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]; // 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.ToArray(); + } + + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Management.Automation.PSObject instance) + { + if (null != instance) + { + foreach (var each in instance.Properties) + { + yield return each; + } + } + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.Generic.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys.OfType() + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Management.Automation.PSObject instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + // new global::System.Collections.Generic.HashSet(System.StringComparer.InvariantCultureIgnoreCase) + return (null == instance || !instance.Properties.Any()) ? + Enumerable.Empty>() : + instance.Properties + .Where(property => + !(true == exclusions?.Contains(property.Name)) + && (false != inclusions?.Contains(property.Name))) + .Select(property => new System.Collections.Generic.KeyValuePair(property.Name, property.Value)); + } + + + internal static T GetValueForProperty(this System.Collections.Generic.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys, each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + internal static T GetValueForProperty(this System.Collections.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys.OfType(), each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static T GetValueForProperty(this System.Management.Automation.PSObject psObject, string propertyName, T defaultValue, System.Func converter) + { + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return property == null ? defaultValue : (T)converter(property.Value); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static bool Contains(this System.Management.Automation.PSObject psObject, string propertyName) + { + bool result = false; + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + result = property == null ? false : true; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return result; + } + } +} diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/UndeclaredResponseException.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..5b76e4198a04 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/UndeclaredResponseException.cs @@ -0,0 +1,112 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Extensions; + + public class RestException : Exception, IDisposable + { + public System.Net.HttpStatusCode StatusCode { get; set; } + public string Code { get; protected set; } + protected string message; + public HttpRequestMessage RequestMessage { get; protected set; } + public HttpResponseHeaders ResponseHeaders { get; protected set; } + + public string ResponseBody { get; protected set; } + public string ClientRequestId { get; protected set; } + public string RequestId { get; protected set; } + + public override string Message => message; + public string Action { get; protected set; } + + public RestException(System.Net.Http.HttpResponseMessage response) + { + StatusCode = response.StatusCode; + //CloneWithContent will not work here since the content is disposed after sendAsync + //Besides, it seems there is no need for the request content cloned here. + RequestMessage = response.RequestMessage.Clone(); + ResponseBody = response.Content.ReadAsStringAsync().Result; + ResponseHeaders = response.Headers; + + RequestId = response.GetFirstHeader("x-ms-request-id"); + ClientRequestId = response.GetFirstHeader("x-ms-client-request-id"); + + try + { + // try to parse the body as JSON, and see if a code and message are in there. + var json = Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json.JsonObject; + + // error message could be in properties.statusMessage + { message = If(json?.Property("properties"), out var p) + && If(p?.PropertyT("statusMessage"), out var sm) + ? (string)sm : (string)Message; } + + // see if there is an error block in the body + json = json?.Property("error") ?? json; + + { Code = If(json?.PropertyT("code"), out var c) ? (string)c : (string)StatusCode.ToString(); } + { message = If(json?.PropertyT("message"), out var m) ? (string)m : (string)Message; } + { Action = If(json?.PropertyT("action"), out var a) ? (string)a : (string)Action; } + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // couldn't get the code/message from the body response. + // In this case, we will assume the response is the expected error message + if(!string.IsNullOrEmpty(ResponseBody)) { + message = ResponseBody; + } + } +#endif + if (string.IsNullOrEmpty(message)) + { + if (StatusCode >= System.Net.HttpStatusCode.BadRequest && StatusCode < System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Request Error, Status: {StatusCode}"; + } + else if (StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Server Error, Status: {StatusCode}"; + } + else + { + message = $"The server responded with an unrecognized response, Status: {StatusCode}"; + } + } + } + + public void Dispose() + { + ((IDisposable)RequestMessage).Dispose(); + } + } + + public class RestException : RestException + { + public T Error { get; protected set; } + public RestException(System.Net.Http.HttpResponseMessage response, T error) : base(response) + { + Error = error; + } + } + + + public class UndeclaredResponseException : RestException + { + public UndeclaredResponseException(System.Net.Http.HttpResponseMessage response) : base(response) + { + + } + } +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/Writers/JsonWriter.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..9dd201a7771e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/Writers/JsonWriter.cs @@ -0,0 +1,223 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Web; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.Json +{ + internal class JsonWriter + { + const string indentation = " "; // 2 spaces + + private readonly bool pretty; + private readonly TextWriter writer; + + protected int currentLevel = 0; + + internal JsonWriter(TextWriter writer, bool pretty = true) + { + this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); + this.pretty = pretty; + } + + internal void WriteNode(JsonNode node) + { + switch (node.Type) + { + case JsonType.Array: WriteArray((IEnumerable)node); break; + case JsonType.Object: WriteObject((JsonObject)node); break; + + // Primitives + case JsonType.Binary: WriteBinary((XBinary)node); break; + case JsonType.Boolean: WriteBoolean((bool)node); break; + case JsonType.Date: WriteDate((JsonDate)node); break; + case JsonType.Null: WriteNull(); break; + case JsonType.Number: WriteNumber((JsonNumber)node); break; + case JsonType.String: WriteString(node); break; + } + } + + internal void WriteArray(IEnumerable array) + { + currentLevel++; + + writer.Write('['); + + bool doIndentation = false; + + if (pretty) + { + foreach (var node in array) + { + if (node.Type == JsonType.Object || node.Type == JsonType.Array) + { + doIndentation = true; + + break; + } + } + } + + bool isFirst = true; + + foreach (JsonNode node in array) + { + if (!isFirst) writer.Write(','); + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + WriteNode(node); + + isFirst = false; + } + + currentLevel--; + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + writer.Write(']'); + } + + internal void WriteIndent() + { + if (pretty) + { + writer.Write(Environment.NewLine); + + for (int level = 0; level < currentLevel; level++) + { + writer.Write(indentation); + } + } + } + + internal void WriteObject(JsonObject obj) + { + currentLevel++; + + writer.Write('{'); + + bool isFirst = true; + + foreach (var field in obj) + { + if (!isFirst) writer.Write(','); + + WriteIndent(); + + WriteFieldName(field.Key); + + writer.Write(':'); + + if (pretty) + { + writer.Write(' '); + } + + // Write the field value + WriteNode(field.Value); + + isFirst = false; + } + + currentLevel--; + + WriteIndent(); + + writer.Write('}'); + } + + internal void WriteFieldName(string fieldName) + { + writer.Write('"'); + writer.Write(HttpUtility.JavaScriptStringEncode(fieldName)); + writer.Write('"'); + } + + #region Primitives + + internal void WriteBinary(XBinary value) + { + writer.Write('"'); + writer.Write(value.ToString()); + writer.Write('"'); + } + + internal void WriteBoolean(bool value) + { + writer.Write(value ? "true" : "false"); + } + + internal void WriteDate(JsonDate date) + { + if (date.ToDateTime().Year == 1) + { + WriteNull(); + } + else + { + writer.Write('"'); + writer.Write(date.ToIsoString()); + writer.Write('"'); + } + } + + internal void WriteNull() + { + writer.Write("null"); + } + + internal void WriteNumber(JsonNumber number) + { + if (number.Overflows) + { + writer.Write('"'); + writer.Write(number.Value); + writer.Write('"'); + } + else + { + writer.Write(number.Value); + } + } + + internal void WriteString(string text) + { + if (text == null) + { + WriteNull(); + } + else + { + writer.Write('"'); + + writer.Write(HttpUtility.JavaScriptStringEncode(text)); + + writer.Write('"'); + } + } + + #endregion + } +} + + +// TODO: Replace with System.Text.Json when available diff --git a/swaggerci/containerservice.DefaultTag/generated/runtime/delegates.cs b/swaggerci/containerservice.DefaultTag/generated/runtime/delegates.cs new file mode 100644 index 000000000000..db943b0f6be9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/generated/runtime/delegates.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData=System.Func; + + public delegate Task SendAsync(HttpRequestMessage request, IEventListener callback); + public delegate Task SendAsyncStep(HttpRequestMessage request, IEventListener callback, ISendAsync next); + public delegate Task SignalEvent(string id, CancellationToken token, GetEventData getEventData); + public delegate Task Event(EventData message); + public delegate void SynchEvent(EventData message); + public delegate Task OnResponse(Response message); + public delegate Task OnResponse(Response message); +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/how-to.md b/swaggerci/containerservice.DefaultTag/how-to.md new file mode 100644 index 000000000000..65052af3b196 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.ContainerService`. + +## Building `Az.ContainerService` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder. + +## Testing `Az.ContainerService` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. + +## Packing `Az.ContainerService` +To pack `Az.ContainerService` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://learn.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.ContainerService`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.ContainerService.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.ContainerService.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.ContainerService`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.ContainerService` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/internal/Az.ContainerService.internal.psm1 b/swaggerci/containerservice.DefaultTag/internal/Az.ContainerService.internal.psm1 new file mode 100644 index 000000000000..fdd67828ea53 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/internal/Az.ContainerService.internal.psm1 @@ -0,0 +1,38 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.ContainerService.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Module]::Instance + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = $PSScriptRoot + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } +# endregion diff --git a/swaggerci/containerservice.DefaultTag/internal/Get-AzContainerServiceOperation.ps1 b/swaggerci/containerservice.DefaultTag/internal/Get-AzContainerServiceOperation.ps1 new file mode 100644 index 000000000000..a60b8c992752 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/internal/Get-AzContainerServiceOperation.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a list of operations. +.Description +Gets a list of operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceoperation +#> +function Get-AzContainerServiceOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/internal/ProxyCmdletDefinitions.ps1 b/swaggerci/containerservice.DefaultTag/internal/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..a60b8c992752 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/internal/ProxyCmdletDefinitions.ps1 @@ -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. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets a list of operations. +.Description +Gets a list of operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue +.Link +https://learn.microsoft.com/powershell/module/az.containerservice/get-azcontainerserviceoperation +#> +function Get-AzContainerServiceOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Models.Api20240402Preview.IOperationValue])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.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.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerService.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.ContainerService.private\Get-AzContainerServiceOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/containerservice.DefaultTag/internal/README.md b/swaggerci/containerservice.DefaultTag/internal/README.md new file mode 100644 index 000000000000..84860dfe7fcb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/internal/README.md @@ -0,0 +1,14 @@ +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.ContainerService.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.ContainerService`. Instead, this sub-module is imported by the `../custom/Az.ContainerService.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.ContainerService.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.ContainerService`. diff --git a/swaggerci/containerservice.DefaultTag/license.txt b/swaggerci/containerservice.DefaultTag/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/swaggerci/containerservice.DefaultTag/pack-module.ps1 b/swaggerci/containerservice.DefaultTag/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/pack-module.ps1 @@ -0,0 +1,9 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +Write-Host -ForegroundColor Green 'Packing module...' +dotnet pack $PSScriptRoot --no-build /nologo +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/readme.md b/swaggerci/containerservice.DefaultTag/readme.md new file mode 100644 index 000000000000..905ebeb0ea78 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../tools/SwaggerCI/readme.azure.noprofile.md + - $(this-folder)/../../../azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.powershell.md +``` diff --git a/swaggerci/containerservice.DefaultTag/resources/README.md b/swaggerci/containerservice.DefaultTag/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/run-module.ps1 b/swaggerci/containerservice.DefaultTag/run-module.ps1 new file mode 100644 index 000000000000..bec4c44f43a2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/run-module.ps1 @@ -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. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Code) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$isAzure = $true +if($isAzure) { + . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts + # Load the latest version of Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.ContainerService.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +function Prompt { + Write-Host -NoNewline -ForegroundColor Green "PS $(Get-Location)" + Write-Host -NoNewline -ForegroundColor Gray ' [' + Write-Host -NoNewline -ForegroundColor White -BackgroundColor DarkCyan $moduleName + ']> ' +} + +# where we would find the launch.json file +$vscodeDirectory = New-Item -ItemType Directory -Force -Path (Join-Path $PSScriptRoot '.vscode') +$launchJson = Join-Path $vscodeDirectory 'launch.json' + +# if there is a launch.json file, let's just assume -Code, and update the file +if(($Code) -or (test-Path $launchJson) ) { + $launchContent = '{ "version": "0.2.0", "configurations":[{ "name":"Attach to PowerShell", "type":"coreclr", "request":"attach", "processId":"' + ([System.Diagnostics.Process]::GetCurrentProcess().Id) + '", "justMyCode":false }] }' + Set-Content -Path $launchJson -Value $launchContent + if($Code) { + # only launch vscode if they say -code + code $PSScriptRoot + } +} + +Import-Module -Name $modulePath \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/test-module.ps1 b/swaggerci/containerservice.DefaultTag/test-module.ps1 new file mode 100644 index 000000000000..4d5c846be0aa --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test-module.ps1 @@ -0,0 +1,90 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) +{ + 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 + return +} + +# This is a workaround, since for string array parameter, pwsh -File will only take the first element +if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and ($TestName[0].Contains(','))) { + $TestName = $TestName[0].Split(",") +} + +$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 +. ("$PSScriptRoot\test\utils.ps1") + +if ($requireResourceModule) +{ + # Load the latest Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version + $resourceModulePSD = Get-Item -Path (Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psd1') + Import-Module -Name $resourceModulePSD.FullName +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) +{ + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.ContainerService.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +Import-Module -Name Pester +Import-Module -Name $modulePath + +$TestMode = 'playback' +$ExcludeTag = @("LiveOnly") +if($Live) +{ + $TestMode = 'live' + $ExcludeTag = @() +} +if($Record) +{ + $TestMode = 'record' +} +try +{ + if ($TestMode -ne 'playback') + { + setupEnv + } else { + $env:AzPSAutorestTestPlaybackMode = $true + } + $testFolder = Join-Path $PSScriptRoot 'test' + if ($null -ne $TestName) + { + Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } else { + Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } +} Finally +{ + if ($TestMode -ne 'playback') + { + cleanupEnv + } + else { + $env:AzPSAutorestTestPlaybackMode = '' + } +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceAgentPool.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceAgentPool.Tests.ps1 new file mode 100644 index 000000000000..dde2a3f675a1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceAgentPool.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceAgentPool')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceAgentPool.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceAgentPool' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.Tests.ps1 new file mode 100644 index 000000000000..108399910c3d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceAgentPoolAvailableAgentPoolVersion' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceAgentPoolUpgradeProfile.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceAgentPoolUpgradeProfile.Tests.ps1 new file mode 100644 index 000000000000..01ab777235bb --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceAgentPoolUpgradeProfile.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceAgentPoolUpgradeProfile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceAgentPoolUpgradeProfile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceAgentPoolUpgradeProfile' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceLoadBalancer.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceLoadBalancer.Tests.ps1 new file mode 100644 index 000000000000..90403c9449f7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceLoadBalancer.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceLoadBalancer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceLoadBalancer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceLoadBalancer' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceMachine.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceMachine.Tests.ps1 new file mode 100644 index 000000000000..c2b684973698 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceMachine.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceMachine')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceMachine.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceMachine' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceMaintenanceConfiguration.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceMaintenanceConfiguration.Tests.ps1 new file mode 100644 index 000000000000..c7d2c3e3d19b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceMaintenanceConfiguration.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceMaintenanceConfiguration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceMaintenanceConfiguration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceMaintenanceConfiguration' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedCluster.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedCluster.Tests.ps1 new file mode 100644 index 000000000000..b1d6bf5665c6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedCluster.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedCluster')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedCluster.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedCluster' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterAccessProfile.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterAccessProfile.Tests.ps1 new file mode 100644 index 000000000000..791c310c0e8e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterAccessProfile.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterAccessProfile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterAccessProfile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterAccessProfile' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterAdminCredentials.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterAdminCredentials.Tests.ps1 new file mode 100644 index 000000000000..62b7f3bd1b7d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterAdminCredentials.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterAdminCredentials')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterAdminCredentials.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterAdminCredentials' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterCommandResult.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterCommandResult.Tests.ps1 new file mode 100644 index 000000000000..59fe937c1e34 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterCommandResult.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterCommandResult')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterCommandResult.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterCommandResult' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterGuardrailVersion.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterGuardrailVersion.Tests.ps1 new file mode 100644 index 000000000000..f1bcda77ec05 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterGuardrailVersion.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterGuardrailVersion')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterGuardrailVersion.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterGuardrailVersion' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterKuberneteVersion.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterKuberneteVersion.Tests.ps1 new file mode 100644 index 000000000000..3150764ef92e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterKuberneteVersion.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterKuberneteVersion')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterKuberneteVersion.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterKuberneteVersion' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterMeshRevisionProfile.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterMeshRevisionProfile.Tests.ps1 new file mode 100644 index 000000000000..f21e3d912f43 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterMeshRevisionProfile.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterMeshRevisionProfile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterMeshRevisionProfile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterMeshRevisionProfile' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.Tests.ps1 new file mode 100644 index 000000000000..629a334336c8 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterMeshUpgradeProfile.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterMeshUpgradeProfile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterMeshUpgradeProfile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterMeshUpgradeProfile' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.Tests.ps1 new file mode 100644 index 000000000000..78dbd4aa2057 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterMonitoringUserCredentials.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterMonitoringUserCredentials')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterMonitoringUserCredentials.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterMonitoringUserCredentials' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterOSOption.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterOSOption.Tests.ps1 new file mode 100644 index 000000000000..a8d8295b8460 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterOSOption.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterOSOption')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterOSOption.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterOSOption' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.Tests.ps1 new file mode 100644 index 000000000000..c99ec9da5467 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterOutboundNetworkDependencyEndpoint' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterSafeguardVersion.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterSafeguardVersion.Tests.ps1 new file mode 100644 index 000000000000..bf6195cd102c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterSafeguardVersion.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterSafeguardVersion')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterSafeguardVersion.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterSafeguardVersion' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterSnapshot.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterSnapshot.Tests.ps1 new file mode 100644 index 000000000000..31fa48fc1633 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterSnapshot.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterSnapshot')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterSnapshot.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterSnapshot' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterUpgradeProfile.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterUpgradeProfile.Tests.ps1 new file mode 100644 index 000000000000..84902ab05b87 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterUpgradeProfile.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterUpgradeProfile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterUpgradeProfile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterUpgradeProfile' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterUserCredentials.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterUserCredentials.Tests.ps1 new file mode 100644 index 000000000000..c32da0c5df5d --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceManagedClusterUserCredentials.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceManagedClusterUserCredentials')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceManagedClusterUserCredentials.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceManagedClusterUserCredentials' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceOperationStatusResult.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceOperationStatusResult.Tests.ps1 new file mode 100644 index 000000000000..cf9add0f8f1c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceOperationStatusResult.Tests.ps1 @@ -0,0 +1,37 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceOperationStatusResult')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceOperationStatusResult.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceOperationStatusResult' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServicePrivateEndpointConnection.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServicePrivateEndpointConnection.Tests.ps1 new file mode 100644 index 000000000000..d84f58883178 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServicePrivateEndpointConnection.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServicePrivateEndpointConnection')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServicePrivateEndpointConnection.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServicePrivateEndpointConnection' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServicePrivateLinkResource.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServicePrivateLinkResource.Tests.ps1 new file mode 100644 index 000000000000..ee49bd9a3685 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServicePrivateLinkResource.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServicePrivateLinkResource')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServicePrivateLinkResource.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServicePrivateLinkResource' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceSnapshot.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceSnapshot.Tests.ps1 new file mode 100644 index 000000000000..4064d0c12f87 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceSnapshot.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceSnapshot')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceSnapshot.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceSnapshot' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceTrustedAccessRole.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceTrustedAccessRole.Tests.ps1 new file mode 100644 index 000000000000..0f804a3eccd1 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceTrustedAccessRole.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceTrustedAccessRole')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceTrustedAccessRole.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceTrustedAccessRole' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceTrustedAccessRoleBinding.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceTrustedAccessRoleBinding.Tests.ps1 new file mode 100644 index 000000000000..5ef91b3ed551 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Get-AzContainerServiceTrustedAccessRoleBinding.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzContainerServiceTrustedAccessRoleBinding')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzContainerServiceTrustedAccessRoleBinding.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzContainerServiceTrustedAccessRoleBinding' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Import-AzContainerServiceManagedCluster.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Import-AzContainerServiceManagedCluster.Tests.ps1 new file mode 100644 index 000000000000..540b3be05874 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Import-AzContainerServiceManagedCluster.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Import-AzContainerServiceManagedCluster')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Import-AzContainerServiceManagedCluster.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Import-AzContainerServiceManagedCluster' { + It 'LoadExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Load' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'LoadViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'LoadViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.Tests.ps1 new file mode 100644 index 000000000000..72daa572641c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceAbortAgentPoolLatestOperation.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzContainerServiceAbortAgentPoolLatestOperation')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzContainerServiceAbortAgentPoolLatestOperation.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzContainerServiceAbortAgentPoolLatestOperation' { + It 'Abort' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'AbortViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.Tests.ps1 new file mode 100644 index 000000000000..563e906076e2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceAbortManagedClusterLatestOperation.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzContainerServiceAbortManagedClusterLatestOperation')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzContainerServiceAbortManagedClusterLatestOperation.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzContainerServiceAbortManagedClusterLatestOperation' { + It 'Abort' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'AbortViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceResolvePrivateLinkServiceId.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceResolvePrivateLinkServiceId.Tests.ps1 new file mode 100644 index 000000000000..a5554efbe4dc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceResolvePrivateLinkServiceId.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzContainerServiceResolvePrivateLinkServiceId')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzContainerServiceResolvePrivateLinkServiceId.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzContainerServiceResolvePrivateLinkServiceId' { + It 'PostExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Post' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PostViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PostViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceRotateManagedClusterCertificate.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceRotateManagedClusterCertificate.Tests.ps1 new file mode 100644 index 000000000000..2cb6b7fc0bf4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceRotateManagedClusterCertificate.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzContainerServiceRotateManagedClusterCertificate')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzContainerServiceRotateManagedClusterCertificate.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzContainerServiceRotateManagedClusterCertificate' { + It 'Rotate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RotateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.Tests.ps1 new file mode 100644 index 000000000000..425881c02a55 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzContainerServiceRotateManagedClusterServiceAccountSigningKey' { + It 'Rotate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RotateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceAgentPool.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceAgentPool.Tests.ps1 new file mode 100644 index 000000000000..a207f372dc06 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceAgentPool.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzContainerServiceAgentPool')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzContainerServiceAgentPool.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzContainerServiceAgentPool' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceLoadBalancer.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceLoadBalancer.Tests.ps1 new file mode 100644 index 000000000000..da95b62ac924 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceLoadBalancer.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzContainerServiceLoadBalancer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzContainerServiceLoadBalancer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzContainerServiceLoadBalancer' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceMaintenanceConfiguration.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceMaintenanceConfiguration.Tests.ps1 new file mode 100644 index 000000000000..99e48bfdccdd --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceMaintenanceConfiguration.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzContainerServiceMaintenanceConfiguration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzContainerServiceMaintenanceConfiguration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzContainerServiceMaintenanceConfiguration' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceManagedCluster.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceManagedCluster.Tests.ps1 new file mode 100644 index 000000000000..900dbdd29184 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceManagedCluster.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzContainerServiceManagedCluster')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzContainerServiceManagedCluster.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzContainerServiceManagedCluster' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceManagedClusterSnapshot.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceManagedClusterSnapshot.Tests.ps1 new file mode 100644 index 000000000000..a72ea9746d52 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceManagedClusterSnapshot.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzContainerServiceManagedClusterSnapshot')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzContainerServiceManagedClusterSnapshot.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzContainerServiceManagedClusterSnapshot' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceSnapshot.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceSnapshot.Tests.ps1 new file mode 100644 index 000000000000..753dcd8f84e6 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceSnapshot.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzContainerServiceSnapshot')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzContainerServiceSnapshot.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzContainerServiceSnapshot' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceTrustedAccessRoleBinding.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceTrustedAccessRoleBinding.Tests.ps1 new file mode 100644 index 000000000000..07138bbc1f0e --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/New-AzContainerServiceTrustedAccessRoleBinding.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzContainerServiceTrustedAccessRoleBinding')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzContainerServiceTrustedAccessRoleBinding.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzContainerServiceTrustedAccessRoleBinding' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/README.md b/swaggerci/containerservice.DefaultTag/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/README.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceAgentPool.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceAgentPool.Tests.ps1 new file mode 100644 index 000000000000..d1b93cc239d9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceAgentPool.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzContainerServiceAgentPool')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzContainerServiceAgentPool.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzContainerServiceAgentPool' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceAgentPoolMachine.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceAgentPoolMachine.Tests.ps1 new file mode 100644 index 000000000000..deb51457d73f --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceAgentPoolMachine.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzContainerServiceAgentPoolMachine')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzContainerServiceAgentPoolMachine.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzContainerServiceAgentPoolMachine' { + It 'DeleteExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceLoadBalancer.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceLoadBalancer.Tests.ps1 new file mode 100644 index 000000000000..14494bf8c89b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceLoadBalancer.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzContainerServiceLoadBalancer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzContainerServiceLoadBalancer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzContainerServiceLoadBalancer' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceMaintenanceConfiguration.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceMaintenanceConfiguration.Tests.ps1 new file mode 100644 index 000000000000..498582383a9b --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceMaintenanceConfiguration.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzContainerServiceMaintenanceConfiguration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzContainerServiceMaintenanceConfiguration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzContainerServiceMaintenanceConfiguration' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceManagedCluster.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceManagedCluster.Tests.ps1 new file mode 100644 index 000000000000..398d82c4fe15 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceManagedCluster.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzContainerServiceManagedCluster')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzContainerServiceManagedCluster.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzContainerServiceManagedCluster' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceManagedClusterSnapshot.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceManagedClusterSnapshot.Tests.ps1 new file mode 100644 index 000000000000..e7565e4bce37 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceManagedClusterSnapshot.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzContainerServiceManagedClusterSnapshot')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzContainerServiceManagedClusterSnapshot.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzContainerServiceManagedClusterSnapshot' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServicePrivateEndpointConnection.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServicePrivateEndpointConnection.Tests.ps1 new file mode 100644 index 000000000000..38d8324eb6ed --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServicePrivateEndpointConnection.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzContainerServicePrivateEndpointConnection')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzContainerServicePrivateEndpointConnection.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzContainerServicePrivateEndpointConnection' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceSnapshot.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceSnapshot.Tests.ps1 new file mode 100644 index 000000000000..1c1dfc5c2fba --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceSnapshot.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzContainerServiceSnapshot')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzContainerServiceSnapshot.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzContainerServiceSnapshot' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceTrustedAccessRoleBinding.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceTrustedAccessRoleBinding.Tests.ps1 new file mode 100644 index 000000000000..394ef3b6b022 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Remove-AzContainerServiceTrustedAccessRoleBinding.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzContainerServiceTrustedAccessRoleBinding')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzContainerServiceTrustedAccessRoleBinding.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzContainerServiceTrustedAccessRoleBinding' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Reset-AzContainerServiceManagedClusterAadProfile.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Reset-AzContainerServiceManagedClusterAadProfile.Tests.ps1 new file mode 100644 index 000000000000..6253ab064831 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Reset-AzContainerServiceManagedClusterAadProfile.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Reset-AzContainerServiceManagedClusterAadProfile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Reset-AzContainerServiceManagedClusterAadProfile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Reset-AzContainerServiceManagedClusterAadProfile' { + It 'ResetExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Reset' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ResetViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ResetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.Tests.ps1 new file mode 100644 index 000000000000..59ecf0abea25 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Reset-AzContainerServiceManagedClusterServicePrincipalProfile.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Reset-AzContainerServiceManagedClusterServicePrincipalProfile')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Reset-AzContainerServiceManagedClusterServicePrincipalProfile.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Reset-AzContainerServiceManagedClusterServicePrincipalProfile' { + It 'ResetExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Reset' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ResetViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ResetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Start-AzContainerServiceManagedCluster.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Start-AzContainerServiceManagedCluster.Tests.ps1 new file mode 100644 index 000000000000..fb41bbd0883c --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Start-AzContainerServiceManagedCluster.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Start-AzContainerServiceManagedCluster')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Start-AzContainerServiceManagedCluster.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Start-AzContainerServiceManagedCluster' { + It 'Start' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'StartViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Start-AzContainerServiceManagedClusterCommand.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Start-AzContainerServiceManagedClusterCommand.Tests.ps1 new file mode 100644 index 000000000000..1102dfa2bf82 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Start-AzContainerServiceManagedClusterCommand.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Start-AzContainerServiceManagedClusterCommand')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Start-AzContainerServiceManagedClusterCommand.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Start-AzContainerServiceManagedClusterCommand' { + It 'RunExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Run' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RunViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RunViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Stop-AzContainerServiceManagedCluster.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Stop-AzContainerServiceManagedCluster.Tests.ps1 new file mode 100644 index 000000000000..c8b0f27eed48 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Stop-AzContainerServiceManagedCluster.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Stop-AzContainerServiceManagedCluster')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Stop-AzContainerServiceManagedCluster.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Stop-AzContainerServiceManagedCluster' { + It 'Stop' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'StopViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceAgentPoolNodeImageVersion.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceAgentPoolNodeImageVersion.Tests.ps1 new file mode 100644 index 000000000000..8d71d77be7cc --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceAgentPoolNodeImageVersion.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzContainerServiceAgentPoolNodeImageVersion')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzContainerServiceAgentPoolNodeImageVersion.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzContainerServiceAgentPoolNodeImageVersion' { + It 'Upgrade' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpgradeViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceManagedClusterSnapshotTag.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceManagedClusterSnapshotTag.Tests.ps1 new file mode 100644 index 000000000000..20687430aeb9 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceManagedClusterSnapshotTag.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzContainerServiceManagedClusterSnapshotTag')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzContainerServiceManagedClusterSnapshotTag.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzContainerServiceManagedClusterSnapshotTag' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceManagedClusterTag.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceManagedClusterTag.Tests.ps1 new file mode 100644 index 000000000000..34b9485d66f7 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceManagedClusterTag.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzContainerServiceManagedClusterTag')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzContainerServiceManagedClusterTag.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzContainerServiceManagedClusterTag' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceSnapshotTag.Tests.ps1 b/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceSnapshotTag.Tests.ps1 new file mode 100644 index 000000000000..e593e7bba5a2 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/Update-AzContainerServiceSnapshotTag.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzContainerServiceSnapshotTag')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzContainerServiceSnapshotTag.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzContainerServiceSnapshotTag' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/containerservice.DefaultTag/test/loadEnv.ps1 b/swaggerci/containerservice.DefaultTag/test/loadEnv.ps1 new file mode 100644 index 000000000000..d2166fb535d4 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/loadEnv.ps1 @@ -0,0 +1,21 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +$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 + $PSDefaultParameterValues=@{"*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/test/utils.ps1 b/swaggerci/containerservice.DefaultTag/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/test/utils.ps1 @@ -0,0 +1,31 @@ +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]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} + diff --git a/swaggerci/containerservice.DefaultTag/utils/Get-SubscriptionIdTestSafe.ps1 b/swaggerci/containerservice.DefaultTag/utils/Get-SubscriptionIdTestSafe.ps1 new file mode 100644 index 000000000000..5319862d3372 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/utils/Get-SubscriptionIdTestSafe.ps1 @@ -0,0 +1,7 @@ +param() +if ($env:AzPSAutorestTestPlaybackMode) { + $loadEnvPath = Join-Path $PSScriptRoot '..' 'test' 'loadEnv.ps1' + . ($loadEnvPath) + return $env.SubscriptionId +} +return (Get-AzContext).Subscription.Id \ No newline at end of file diff --git a/swaggerci/containerservice.DefaultTag/utils/Unprotect-SecureString.ps1 b/swaggerci/containerservice.DefaultTag/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/containerservice.DefaultTag/utils/Unprotect-SecureString.ps1 @@ -0,0 +1,16 @@ +#This script converts securestring to plaintext + +param( + [Parameter(Mandatory, ValueFromPipeline)] + [System.Security.SecureString] + ${SecureString} +) + +$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) +try { + $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) +} finally { + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) +} + +return $plaintext \ No newline at end of file